0

I want to run a linear mixed model (LMM) testing the effects of two continuous variables (FD and FI) over time (Year:FD, Year:FI) on my response variable (QMD). For LMMs I typically use lmer4 but as in this model the variance increases over time, I want to use nlme to weight the model variance by year (using VarIdent=Year). However, when I run the ANOVA table of the model, it seems something is not correct. The Denonminator degrees of freedom (DenDF) do not seem correct.

When I compare the estimated DenDF of lmer (lme4) and lme (nlme) models, they are very different. The other estimates vary also, but I assumed this was because, as I said before, in the lme model I weighted the variance by year. Do you know why the two models report so different DenDFs?

Here the lmer model without weighting the variance by year

mod_lmer <- lmer (QMD ~ FD*Year + FI*Year + (1|Block) + (1|Plot), data=QMD_data, REML=TRUE)

enter image description here

Now, running the lme model - following BenBolker's approach to include crossed random factors in lme models - enter link description here

mod_lme = lme (QMD ~ FdisPC1 * Inv + CWM_PC1 * Inv,
                    random=list(Dummy = pdBlocked(list(pdIdent(~Plot-1),
                                                       pdIdent(~Block-1)))), 
                    data=QMD_data,
                    weights = varIdent(form = ~1 | Inv),method="REML",control =list(msMaxIter = 1000, msMaxEval = 1000))

enter image description here

Does someone know why the estimated DenDF are so different from each other? Also, I realized that when in lmer model the DenDF for FDisPC1 and CWM_PC1 are different than the rest of the variables (34), in lme model both have the same DenDF that the other effects (1591)

Urgota
  • 1
  • 1
    This answer explains the problems in determining the degrees of freedom associated with fixed effects of a mixed model. The anova() for the older lme function doesn't even try to take those problems into account. See this page for approximations used in lmer models. – EdM May 19 '23 at 16:03

0 Answers0