the fixed effect "sit" is a logit transformed proportion of "psit". Some of
the values in "psit" equal zero. Other than that, I don't know what could
be the problem. To be honest, I haven't use the scale function before in a
lmer. Thus, I don't quite understand why a different coef estimate is a
problem? Since I transformed the "sit" values, why shouldn't the coef
change accordingly?
Julia
2012/5/22 Ewart Thomas <ethomas at stanford.edu>
julia, there's something funny about your new fixed effects. i expected
the intercept to change, and it did - a reduction of 1.1.
i expected the effect of sitc (1.3) to be the same as that of sit (.75);
and the effect of dive to be the same. why the change in the sitc coeff.
scale() just centers, it doesn't standardise, correct?
see if you can figure out what's 'wrong', e.g., by looking at your raw
data file, coding of birds (as a factor), coding of sit as numeric. i
estimate the sit mean to be 0.84. is this right? ...
ewart
On May 21, 2012, at 6:31 PM, Julia Sommerfeld wrote:
Hi Ewart,
Thanks for the quick reply. I've run the model using "sitc". But the
variance is still zero.
dat$sitc <- scale(dat$sit)
mod8 <- lmer(ars1 ~ sitc + dive + (1|bird), data=dat, family=binomial)
Generalized linear mixed model fit by the Laplace approximation
Formula: ars1 ~ sitc + dive + (1 | bird)
Data: dat
AIC BIC logLik deviance
159.4 171.7 -75.71 151.4
Random effects:
Groups Name Variance Std.Dev.
bird (Intercept) 0 0
Number of obs: 160, groups: bird, 25
Fixed effects:
Estimate Std. Error z value Pr(>|z|)
(Intercept) -1.5423 0.3705 -4.163 3.14e-05 ***
sitc 1.2913 0.2495 5.175 2.28e-07 ***
dive 1.3076 0.4374 2.990 0.00279 **
---
Signif. codes: 0 ?***? 0.001 ?**? 0.01 ?*? 0.05 ?.? 0.1 ? ? 1
Correlation of Fixed Effects:
(Intr) sitc
sitc -0.156
dive -0.827 0.005
2012/5/22 Ewart Thomas <ethomas at stanford.edu>
julia, while doug bates is right in noting that the 0 estimate suggests
that var(intercept) is truly 0 (and can be omitted), i think your result is
suspicious (not wrong).
try centering 'sit': sitc = scale(sit)
then use sitc instead of sit in mod6. the meaning of 'intercept' for
each bird has changed: it is now a bird's average response (on the logit(p)
scale) when the bird happens to have it's 'sit' value = the sample mean of
'sit'. you may know how best to interpret such 'intercepts'.
good luck!
ewart
On May 21, 2012, at 6:07 PM, Julia Sommerfeld wrote:
Dear list,
I'm running a lmer (package lme4) with a binomial error distribution and
"bird" as the random effect (160 observations of 25 birds). The response
variable "ars1" is coded as 0, 1.
The fixed effect "sit" is numerical and "dive" is categorical (0, 1).
What puzzles me a little is that the a variance and sd of the random
is ZERO. Same question has been posted before and Douglas Bates answer
"No, an estimate of zero is not suspicious. It is simply an indication
that the variability between individuals is not significantly larger
than what one would expect from the random variability in the
response."
While another answer suggested that the model was "wrong":
"A zero estimate of a variance possibly indicates the model is wrong."
wrong model seemed to be related to a negative covariation of one of the
fixed effects ?
My simplified model is:
mod6 <- lmer(ars1 ~ sit + dive + (1|bird), data=dat, family=binomial)
Generalized linear mixed model fit by the Laplace approximation
Formula: ars1 ~ sit + dive + (1 | bird)
Data: dat
AIC BIC logLik deviance
159.4 171.7 -75.71 151.4
Random effects:
Groups Name Variance Std.Dev.
bird (Intercept) 0 0
Number of obs: 160, groups: bird, 25
Fixed effects:
Estimate Std. Error z value Pr(>|z|)
(Intercept) -0.3615 0.4037 -0.895 0.37059
sit 0.7492 0.1448 5.175 2.28e-07 ***
dive 1.3076 0.4374 2.990 0.00279 **
---
Signif. codes: 0 ?***? 0.001 ?**? 0.01 ?*? 0.05 ?.? 0.1 ? ? 1
Correlation of Fixed Effects:
(Intr) sit
sit 0.422
dive -0.756 0.005
Based on the summary output (zero variance and sd) and the two plots
I'm inclined to believe that in fact my random effect bird does not
for any of the variance in the model. I.e., that there is no significant
variability between birds that I should account for.
*QUESTION: Could I be overlooking something or is it justified to run a
without the random effect bird instead of a lmer?*
Thank you!
Best regards, Julia
dotplot(ranef(mod6, postVar=TRUE))
qqnorm(unlist(ranef(mod6)), main="normal qq-plot, random effects")
qqline(unlist(ranef(mod6))) # qq of random effects
[[alternative HTML version deleted]]