Dredge with the global model failing to converge

主宰稳场 提交于 2019-12-04 02:52:42

问题


I am trying to run gamm models with multiple variable combinations in dredge (MuMIn) framework, with a cutoff based TRUE/FALSE correlation matrix as subset.

Problem is, my full model is quite complex with random effects, >20 predictor variables including 3 fixed effects, and therefore won't converge. My predictors are highly correlated, as mentioned I included a TRUE/FALSE correlation matrix as subset. Due a low correlation cutoff I expect very few combinations and not really interested in the full model.

However, my construction of gamm (or uGamm) full model, which includes 20+ predictors (smoothed terms and fixed effects, random effects) does not converge. This essentially means that dredge won't run since the full model doesn't converge, even though I am not interested in the full model per se, rather in the single models and a few combinations.

It also appears that I cant use fm1 <- gamm(y ~ (.), data = Cement) option, as this gives the following error:

Error in s(.) : s(.) not yet supported

Is there a way to bypass the full model which will not converge and have my variable combinations regardless? and/Or is there a way to avoid the above error with (.)?

Any suggestions? my data is too large to include here.


回答1:


You can trick dredge by replacing the formula in a simpler model, and then use that model as a "global model". Assign the full model formula to <gam.model> $ gam $ formula. For example:

# fit some simple model
fm <- uGamm(y ~ s(x1), ...) # add other arguments as in the proper full model
fm$gam$formula <- y ~ x0 + s(x1) + s(x2) + ... + s(xn)
dredge(fm) 


来源:https://stackoverflow.com/questions/28744959/dredge-with-the-global-model-failing-to-converge

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!