Contents
How to do term selection in Gamm using R?
Here’s an example of my global model: M0 <- gamm (response ~ var1*var2 + var3 + s (var4) + s (var5) + s (var6,var7), random=list (placeID= ~1), correlation= corAR1 (form= ~ year | placeID), data=data, family=quasipoisson) I’d like to do term selection on the global model to drop any nonrelevant variables, but I’m not sure how it should be done.
Do you use mL in GAM and LME?
Currently, I am using ML in all models and also use the same package (mgcv) to estimate lme, gam, and gamm to estabilish comparability. Any help/ advice or ideas on this would be greatly appreciated!! Thank you very much for this!
Can you use AIC for model selection in Gamm?
Since the model uses PQL, I gather that AIC is not recommended (although included in lme part). The gam.selection text mentions different scores: “In general the most logically consistent method to use for deciding which terms to include in the model is to compare GCV/UBRE/ML scores for models with and without the term.”
Can you fit an AMM to a Gamm?
You are not fitting a GAM but a GAMM. If you look at ?gamm you’ll see that there are two options for model fitting an AMM and only one when fitting a GAMM: method: Which of ‘”ML”’ or ‘”REML”’ to use in the Gaussian additive mixed model case when ‘lme’ is called directly.
How to use GAM and LME in mgcv?
To use this function effectively it helps to be quite familiar with the use of gam and lme .
How is smoothness of a model selected in GAM?
Smoothness selection criteria. Given a model structure specified by a gam model formula, gam() attempts to find the appropriate smoothness for each applicable model term using prediction error criteria or likelihood based methods.
How are generalized additive models used in mgcv?
The Bayesian model of spline smoothing introduced by Wahba (1983) and Silverman (1985) opens up the possibility of estimating the degree of smoothness of terms in a generalized additive model as variances of the wiggly components of the smooth terms treated as random effects.