0

I'm trying to use the dredge() function to evaluate models by completing every combination of variables (up to five variables per model) and comparing models using AIC corrected for small sample size (AICc).

However, I'm presented with one error and two warning messages as follows:

Fixed term is "(Intercept)" Warning messages: 1: In dredge(MaxN.model, m.min = 2, m.max = 5) : comparing models fitted by REML 2: In dredge(MaxN.model, m.min = 2, m.max = 5) : arguments 'm.min' and 'm.max' are deprecated, use 'm.lim' instead

I've tried changing to 'm.lim' as specified but it comes up with the error:

Error in dredge(MaxN.model, m.lim = 5) : invalid 'm.lim' value In addition: Warning message: In dredge(MaxN.model, m.lim = 5) : comparing models fitted by REML

The code I'm using is:

MaxN.model<-lme(T_MaxN~Seagrass.cover+composition.pca1+composition.pca2+Sg.Richness+traits.pca1+
              land.use.pc1+land.use.pc2+seascape.pc2+D.landing.site+T_Depth, 
                random=~1|site, data = sgdf, na.action = na.fail, method = "REML")
Dd_MaxN<-dredge(MaxN.model, m.min = 2 , m.max = 5)

What am I doing wrong?

1 Answers1

0
  1. You didn't tell us what you tried to specify for m.lim. ?dredge says:

m.lim ...optionally, the limits ‘c(lower, upper)’ for number of terms in a single model

so you should specify a two-element numeric (integer) vector.

  1. You should definitely be using method="ML" rather than method="REML". The warning/error about REML is very serious; comparing models with different fixed effects that are fitted via REML will lead to nonsense.

So you should try:

MaxN.model <- lme(..., method = "ML")  ## where ... is the rest of your fit
Dd_MaxN <- dredge(MaxN.model, m.lim=c(2,5))
Ben Bolker
  • 211,554
  • 25
  • 370
  • 453
  • Thanks for your rapid response. I've now changed to m.lim = c(NA, 5) and that part works perfectly. I've changed to method="ML" and my top models are remarkably different. Can you suggest anything to read about difference between ML and REML. I had read that for small sample sizes (n=55) REML was better. I'm also comparing two models with the exact same fixed effects. Still getting the "Fixed term is "(Intercept)"" message though. – Benjamin Jones Sep 30 '19 at 21:47
  • Fixed term is (Intercept) is a harmless message. See https://stats.stackexchange.com/questions/116770/reml-or-ml-to-compare-two-mixed-effects-models-with-differing-fixed-effects-but for ML vs REML and https://stats.stackexchange.com/questions/41123/reml-vs-ml-stepaic/41192#41192 ... – Ben Bolker Sep 30 '19 at 21:48