[R] Help with step.gam

sbihorel Sebastien.Bihorel at cognigencorp.com
Thu Mar 3 02:07:47 CET 2016


Hi,

When very simple models are tested in step.gam, I have observed the some 
difference in the final output result based upon the version of the 
package tested.  Is this an expected behavior or a bug in the latest 
version of the gam package?

With gam 1.4:
 > data(gam.data)
 > gam.object <- gam(y~1, data=gam.data)
 > step.object <- step.gam(gam.object, scope=list(x=c('1','x')))
Start:  y ~ 1; AIC= 232.8823
Trial:  y ~  x; AIC= 126.5148
Step :  y ~ x ; AIC= 126.5148
 > step.object
Call:
gam(formula = y ~ x, data = gam.data, trace = FALSE)

Degrees of Freedom: 99 total; 98 Residual
Residual Deviance: 19.53955

With gam 1.9.1 or 1.12:
 > data(gam.data)
 > gam.object <- gam(y~1, data=gam.data)
 > step.object <- step.gam(gam.object, scope=list(x=c('1','x')))
Start:  y ~ 1; AIC= 232.8823
Step:1 y ~ x ; AIC= 126.5148
 > step.object
NULL

Thank you

Sebastien



More information about the R-help mailing list