[S] Prediction of Smooth Spline Fit

James Janisse (jjanis@med.wayne.edu)
Mon, 15 Jun 1998 21:17:51 -0400


According to the S-PLUS documention when fitting a cubic B-spline using
gam, smooth.spline does the smoothing. To graph the smooth I usually
use smooth.spline within the lines object. When I compare this with the
line produced using predict.gam the lines are not the same when df = 2.

Am I missing something here? Shouldn't the two lines be the same? I
have included the three lines of code that I used to produce the initial
gam fit and the two plotted lines. Can anyone shed some light on this?
I am using S-PLUS 4.5 on a Pentium 233.

Thanks in advance

James

> plot(Age,Sleep)

> fit.1_gam(formula = Sleep ~ s(Age, df = 2))

> lines(Age,predict.gam(fit.1))

> lines(smooth.spline(Age,Sleep,df=2))

--------------------------------------------------------------------------

James J. Janisse
Department of Psychology
Center for Healthcare Effectiveness Research
Wayne State University
Detroit Medical Center, Detroit MI USA
--------------------------------------------------------------------------

-----------------------------------------------------------------------
This message was distributed by s-news@wubios.wustl.edu. To unsubscribe
send e-mail to s-news-request@wubios.wustl.edu with the BODY of the
message: unsubscribe s-news