[R] Loess with glm ?

Simon Wood snw at mcs.st-and.ac.uk
Thu Oct 31 18:06:48 CET 2002


You could take a look at gam() in package mgcv - it will fit thin plate
spline like multi-dimensional smoothers (and other models) in a GLM
setting. (With 5000 observations you'd probably want to check the help
files for some simple tricks to speed up fitting, though.)
Simon 

> I am wondering if there is an easy way to combine loess() with glm()
> to produce a locally fitted generalised regression.
> 
> I have a data set of about 5,000 observations and 5 explanatory variables,
> with a binary outcome. One of the explanatory variables (lets call it X)
> is much more predictive than the others. A single glm() regression over
> the entire data set produces rather poor results, so I have split the
> data based on sub ranges of X, and performed a separate glm() regression
> on each subset.
> 
> This produces much more satisfactory results, but the problem is that
> at the boundaries, the result hyper-surfaces don't coincide.
> 
> I am using this model in a predictive role so that given a new observation
> on the 5 explanatory variables, I want to predict the probability of a
> positive outcome (actually whether a protein has a certain conformation
> or not). At the boundary determined by the value of X, my prediction has
> a discontinuity, which is not very satisfactory. My solution has been to
> take a weighted average of the results of adjacent models for cases where X
> is close to a boundary so as to smooth over the discontinuities. Although
> this works, it seems rather simplistic and arbitrary in terms of choices
> about how and where the weighed averages are computed.  It seems to me
> that what I am doing is a kind of poor mans loess.
> 
> Can anyone suggest a better way to deal with this analysis ? I have only
> a sketchy knowledge of loess.
> 
> Thanks,
> 
> Luke Whitaker
> Inpharmatica
> 
> 
> 
> -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
> r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
> Send "info", "help", or "[un]subscribe"
> (in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
> _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
> 

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list