Skip to content
Back to formatted view

Raw Message

Message-ID: <49C2E146.5000702@utoronto.ca>
Date: 2009-03-20T00:20:22Z
From: Kevin E. Thorpe
Subject: Difference between gam() and loess().
In-Reply-To: <565B0378-4D10-4904-9AC7-3F8896890C07@auckland.ac.nz>

Rolf Turner wrote:
> 
> It seems that in general
> 
>     gam(y~lo(x)) # gam() from the gam package.
> 
> and
>     loess(y~x)
> 
> give slightly different results (in respect of the predicted/fitted 
> values).
> Most noticeable at the endpoints of the range of x.
> 
> Can anyone enlighten me about the reason for this difference?
> 
> Is it possible to twiddle the control parameters, for either or both 
> functions,
> so as to obtain identical results?

There are two obvious differences in the defaults.  In lo() from the gam 
package, span=0.5 and degree=1 while for loess(), span=0.75 and degree=2.

Try gam(y~lo(x,span=0.75,degree=2)) and see if that helps.

Kevin

-- 
Kevin E. Thorpe
Biostatistician/Trialist, Knowledge Translation Program
Assistant Professor, Dalla Lana School of Public Health
University of Toronto
email: kevin.thorpe at utoronto.ca  Tel: 416.864.5776  Fax: 416.864.6057