Reputation: 3
My data is ratio data. So I'm trying to use lme4()
with a binomial model to analyze it.
Here is my code:
fate.reP = glmer(predated~type+(1|island),data=fate.rate,family="binomial")
Here is a sample set of data:
type cluster tree predated
B B7-1 1 0.48
B B7-1 2 0.66
B B7-2 3 0.18
M I63 8 0.55
M I63 9 0.6
M I63 20 0.41
M I63 21 0.42
S I14 5 0.75
S I14 17 0.53
S I15 6 0.23
S I15 7 0.03
When I run the model, it shows that :
Error: (maxstephalfit) PIRLS step-halvings failed to reduce deviance in pwrssUpdate
In addition: Warning message:
In eval(expr, envir, enclos) : non-integer #successes in a binomial glm!
Are there errors in my data, or any other errors? I am using R 3.0.3 for Windows.
Upvotes: 0
Views: 2259
Reputation: 226577
The warning non-integer #successes in a binomial glm!
gives you the hint that binomial responses in lme4
must be integers. I don't see the denominators (i.e. total number of individuals exposed to predation) anywhere here: if you have them in your data set as (e.g.) total_exposed
, you can use
fate.reP <- glmer(predated~type+(1|island),
data=fate.rate,family="binomial",
weights=total_exposed)
The behaviour of lme4
is a little bit different from glm
in base R, which will warn you but still produce results if glm
is non-integer.
Upvotes: 0