I run a gam with variable selection. But I want to evaluate the output of all the variables combination and not only for the best model for comparison. I am using mgcv package in R, is there some command for model evaluation (before I start coding many loops...).
Example:
set.seed(3);n<-200
dat <- gamSim(1,n=n,scale=.15,dist="poisson")
dat$x4 <- runif(n, 0, 1);dat$x5 <- runif(n, 0, 1) ## spurious
b<-gam(y~s(x0)+s(x1)+s(x2)+s(x3)+s(x4)+s(x5),data=dat,
family=poisson,select=TRUE,method="REML")
If I use summary(b), I only see the results of the best model.
So, if I'm following you correctly, you want to see the model output for
2^N - 1
models whereN
is the number of variables, since every variable is either in a model or not. Sounds like you would need to make a vector containing each possible model specification and then usemap
to run each model specification and store the result you want in a list.