I used the glmulti package in R to generate a linear model with interactions. The response variable has 21 observations, set against 5 input variables, one of which is a binary factor while the rest are continuous. The "best model" produced by glmulti, as judged according to aic, had 6 predictor terms (4 main effects and two interactions). The model fit beautifully in terms of fit (R2, all terms are significant p<0.01) and diagnostics, but the degrees of freedom are a problem.

Each of the 21 observations is the average of about 4 observations. This is to say that there were 21 sites with four sub-samples per site. I then re-fit the same model with the sub-samples nested within sites with a GLMM with a gaussian distribution. The same results were produced as before. The coefficients still only have 13 degrees of freedom, however the number of observations for the model in its entirety has jumped up to around 75.

Do I bypass the problem of having too few degrees of freedom by opting for a mixed model? I reviewed some of the other answers concerning df in GLMM but have yet to discern a clear answer to this problem.

  • 1
    $\begingroup$ As a comment: notice that there are group size limits that make mixed models applicable, e.g. stats.stackexchange.com/questions/128872/… , so, as a rule of thumb, you should not use mixed models if you have too few observations in groups or too few groups. $\endgroup$ – Tim Jun 23 '15 at 15:17

The statement seems right to me.

Using sites as a random effect in a mixed model does not consume any degrees of freedom. In contrast, using sites as a dummy variable in the fixed part of the model, would consume a lot of DF (21-1).

However, you may want to check if sites have any effect at all. If there is no inner site correlation, you may assume that the observations are independent. In this case you could use all observations within the model without a random effect.

Graficcaly, you could check this with a boxplot of the residuals of the model for each site and compare the medians. Or you can compare the AIC of the model with and without the random effect.

  • $\begingroup$ One should first ask oneself if the replicates within site are true replicates, or just extra readings, or something. $\endgroup$ – kjetil b halvorsen Feb 27 '17 at 11:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.