# March 26, 2009 # curvature of the spine library(rpart) library(mgcv) # kyphosis dataset (children who had corrective surgery) # kyphosis - yes/no (after surgery) # age - months # number - number of vertebrae involved # start - number of 1st vertebra # some GAM examples from s-plus from help page with alternatives a = glm( Kyphosis ~ Age + Number + Start, family=binomial, data=kyphosis) aa = gam(Kyphosis ~ s(Age,k=4,fx=TRUE,bs="cr") + s(Number,k=4,fx=TRUE,bs="cr") + s(Start,k=4,fx=TRUE,bs="cr"), family = binomial, data = kyphosis) plot.gam(aa)