Hi,
I have multi-season data that I am analyzing with colext models. I haven't used model-averaging much in the past and I'm really struggling with it, and would appreciate some guidance. Say for example I have 8 models (listed below) that each have different combinations of covariates (2 continuous, 2 categorical) influencing psi. For simplicity, I've left the col, ext, and p parameters as constant here.
#Sites: 31
#Primary sampling periods: 5
#Secondary sampling occasions: 3
#Covariates influencing psi:
#elev.site=700:1600
#rip.site=0:1.5
#res.site='low', 'none'
#burn.site='C', 'E', 'I'
m1 <- colext(~burn.site, ~1, ~1, ~1, umf)
m2 <- colext(~res.site, ~1, ~1, ~1, umf)
m3 <- colext(~burn.site + res.site, ~1, ~1, ~1, umf)
m4 <- colext(~1, ~1, ~1, ~1, umf)
m5 <- colext(~burn.site + scale(elev.site), ~1, ~1, ~1, umf)
m6 <- colext(~res.site + scale(elev.site), ~1, ~1, ~1, umf)
m7 <- colext(~burn.site + scale(rip.site), ~1, ~1, ~1, umf)
m8 <- colext(~res.site + scale(rip.site), ~1, ~1, ~1, umf)
#I then create a fitList and run the model selection:
fmList <- fitList(m1=m1, m2=m2, m3=m3, m4=m4, m5=m5, m6=m6, m7=m7, m8=m8)
modSel(fmList)
#Once I have the model selection output, I am wondering how you get model-average predictions for each covariate. Because I have 4 different covariates in my set of candidate models, I need to include all 4 of them in the dataframe, correct?
data.predict <- data.frame(elev.site=seq(700, 1600, length=31), rip.site=seq(0, 1.5, length=31),
burn.site=rep(c("C", "E", "I"), length=31),
res.site=rep(c("low", "none"), length=31))
mod.pred <- predict(fmList, type='psi', newdata=data.predict, appendData=TRUE)
mod.pred
#However, this gives all possible combinations and doesn't really allow you to tease apart each covariate. From reading some of the other posts and going through the vignette (2012), it seems like I should set the continuous variables to 0 and/or set one of the categorical variables to a particular level. So, I tried something like this:
data.predict <- data.frame(elev.site=0, rip.site=0,
burn.site=rep(c("C", "E", "I")),
res.site=factor('low', levels=c("low", "none")))
mod.pred <- predict(fmList, type='psi', newdata=data.predict, appendData=TRUE)
mod.pred
#But, I get this error:
Error in X[i, ] : subscript out of bounds
Any insights on how to get these estimates so I can present them in a figure, or should I compare a simpler set of models? I would really appreciate your help.
Thanks.