On Thu, Jul 19, 2012 at 9:20 PM, Yolande Tra <yolande.tra at gmail.com> wrote:
Dear Douglas, I am sorry to bother you but this is very important. I posted the following question (in a slight different version) at r-sig-ME question list but it seems no one is able to answer it.
But Ben answered it. When you specify family="poisson" you are fitting a generalized linear mixed model. The parameter estimates provided for such a model by lme4 are the maximum likelihood estimates, up to an approximation. The default approximation is the Laplace approximation. This data has quite complicated design. I did not find any example that is similar in the literature on lme4. According to the investigator this is a partial nested design. Counts were collected at different transects, different depths and different sites at different times. Time is continuous and assumed to be random, all the others are categorical fixed where transect is nested within depth which is nested within site. Definitely the three factors are nested within each other but based on the the attached files and the table below, it looks like this a repeated measurement design where time (dive_id) is nested within the three factor level combination. So far if I am wrong, please correct me. I believe the main effect is site (b) and level (a) is nested within depth(b) which in turn is nested within site(b). dive_id which represents also time is random.
I read some examples you gave. My output is different. 1. The fit is done with Laplace approximation, not REML 2. There is no residual random effect 3. anova(g) did not give any output In this table the cell represents the number of times each combination was used to obtain the counts (based on the attached file). Hopkins Lovers Point Point Pinos Total 5 B 8 6 6 20 M 8 6 6 20 Total 16 12 12 40 10 B 7 6 7 20 M 7 6 7 20 Total 14 12 14 40 15 B 7 6 8 21 M 7 6 8 21 Total 14 12 16 42 Total 44 36 42 122 d2 <- read.csv(file.path(dataDir,"aggregate_2008.csv"), as.is=T,stringsAsFactors = FALSE)
a<-factor(d2$level) b<-factor(d2$site) c<-factor(d2$depth) g=lmer(total_count ~ b+(1|b:c)+(1|b:c:a)+(1|dive_id), d2, REML=TRUE,family = "poisson") summary(g)
Generalized linear mixed model fit by the Laplace approximation
Formula: total_count ~ b + (1 | b:c) + (1 | b:c:a) + (1 | dive_id)
Data: d2
AIC BIC logLik deviance
1153 1169 -570.3 1141
Random effects:
Groups Name Variance Std.Dev.
dive_id (Intercept) 0.60707 0.77915
b:c:a (Intercept) 0.16273 0.40340
b:c (Intercept) 0.16273 0.40340
Number of obs: 122, groups: dive_id, 61; b:c:a, 9; b:c, 9
Fixed effects:
Estimate Std. Error z value Pr(>|z|)
(Intercept) 1.98724 0.37388 5.315 1.07e-07 ***
bLovers Point 0.02358 0.53618 0.044 0.965
bPoint Pinos -0.43114 0.53273 -0.809 0.418
---
Signif. codes: 0 ?***? 0.001 ?**? 0.01 ?*? 0.05 ?.? 0.1 ? ? 1
Correlation of Fixed Effects:
(Intr) bLvrsP
bLoversPont -0.697
bPointPinos -0.702 0.489
anova(g)
Error in anova(g) : single argument anova for GLMMs not yet implemented I really appreciate any of your insight as author of the package lme4. Yolande