0

I am working on a large dataset looking at effects of soil temperature, soil moisture and topography on greenhouse gases (GHG; CO2, CH4 and N2O). According to my hypotheses, I look at each GHG seperately with mixed models including random effects. My fixed effects are soil temperature, soil moisture and topography, whereas my random effects are chambers and date. Chambers are a tool to measure GHG, and we had 16 chambers in 4 distances from a stream (= 4x4 replicates), with differing topography (inclination = flat and slope). I cannot include both inclination and distance into the code, and because I only have 4 distances, I can also not include it as a random effect. I thus run the models separately for "Inclination" and "Distance" (the following code shows Inclination). I have received the following code from a colleague, where I build a saturated model with all explanatory variables:

CO2.null <- lmer(log(CO2_flux) ~ Temperature + Moisture + Inclination 
                 + (1|Chamber) + (1|Date), data= data_CO2_noNA, REML = FALSE)
nullmodel_CO2 <- MuMIn:::.nullFitRE(CO2.null)
options(na.action = "na.fail")     

library(lmerTest)
dredge_CO2 <- dredge(CO2.null, m.lim = c(0,5), rank = "AIC", extra =list(R2 = function(x) {
  r.squaredGLMM(x, null = nullmodel_CO2)})) 
dredge_CO2
dredge_CO2[1,] # this is the most parsimonious (=best) model, thus the one I will use 
subset(dredge_CO2, delta < 2)
summary(get.models(dredge_CO2, subset = 1)[[1]])

However, this code is from a different project and I don't understand how the m.lim was defined (neither does my colleague). In the R help page, it says "optionally, the limits c(lower, upper) for the number of terms in a single model (excluding the intercept). An NA means no limit. See ‘Subsetting’. Specifying limits as m.min and m.max is allowed for backward compatibility." Unfortunately, I don't understand how to define the number of terms in a single model, also after reading "Subsetting". When I change it, my outcome also changes a lot, so I need to be able to understand how to set my limits.

Can someone help me? This is my first question on StackExchange, so please bear with me :) I'm happy to provide more information if needed. I also tried a few other approaches (not using dredge) and am more than happy to discuss these!

0 Answers0