Difficulty with gam and step.gam
Hello,
I have 21 covariates that I would like to screen using GAM in xpose. I
tried using the extra file in xpose. I couldn't figure out how to
communicate with xpose and tell it to use the additional variables in
the extra file as covariates during GAM. Could someone comment on how to
use the extra file in xpose?
As a work around to the above problem; I tried to hard code step.gam
with 21 explanatory variables in R. I ran into a problem again with the
"Error: cannot allocate vector of size 437.9 Mb". This problem comes up
if the list of explanatory variables is longer than 17. I have to
comment out 4 of the variables and can't test more than 17 variables at
a time (see below). I am wondering if there is a work around this
problem or should I run the steps of a step.gam manually in R?
Please help,
Mahesh
gam.object <- gam(YVAR~1, data=gam.data)
step.object <-step.gam(gam.object, scope=list( "FAC1"=~1+FAC1,
"FAC2"=~1+FAC2, "FAC3"=~1+FAC3, "NUM1"=~1+NUM1+ns(NUM1,df=2),
"NUM2"=~1+NUM2+ns(NUM2,df=2), "NUM3"=~1+NUM3+ns(NUM3,df=2),
"NUM4"=~1+NUM4+ns(NUM4,df=2), "NUM5"=~1+NUM5+ns(NUM5,df=2),
"NUM6"=~1+NUM6+ns(NUM6,df=2), "NUM7"=~1+NUM7+ns(NUM7,df=2),
"NUM8"=~1+NUM8+ns(NUM8,df=2), "NUM9"=~1+NUM9+ns(NUM9,df=2),
"NUM10"=~1+NUM10+ns(NUM10,df=2), "NUM11"=~1+NUM11+ns(NUM11,df=2),
"NUM12"=~1+NUM12+ns(NUM12,df=2),
"NUM13"=~1+NUM13+ns(NUM13,df=2),"NUM14"=~1+NUM14+ns(NUM14,df=2)
#"NUM15"=~1+NUM15+ns(NUM15,df=2),
#"NUM16"=~1+NUM16+ns(NUM16,df=2),
#"NUM17"=~1+NUM17+ns(NUM17,df=2),
#"NUM18"=~1+NUM18+ns(NUM18,df=2)
))