[R] gam and step
Martin Wegmann
baliola at riseup.net
Mon Jul 14 17:34:28 CEST 2003
hello,
I am looking for a step() function for GAM's.
In the book Statistical Computing by Crawley and a removal of predictors has
been done "by hand"
model <- gam(y ~s(x1) +s(x2) + s(x3))
summary(model)
model2 <- gam(y ~s(x2) + s(x3)) # removal of the unsignificant variable
#then comparing these two models if an significant increase occurs.
anova(model, model2, test="F")
isn't there a way to drop and add variables automatically until the best model
is received? like in step(lm(...))?
Or as in grasp.step.gam() - but that doesn't work when I tried it outside
GRASP-R.
thanks for your help, cheers Martin
More information about the R-help
mailing list