问题
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