[R] predicting from a local regression and plotting in lattice

Dieter Menne dieter.menne at menne-biomed.de
Sat Oct 11 12:34:07 CEST 2008


Alex Karner <aakarner <at> ucdavis.edu> writes:

> I'm trying to (1)  plot loess lines for each of my groupings using the same
> color for each group; (2) plot loess predicted values.
> 
> The first part is easy:

.. Example removed... Thanks, it was a good example of what you wanted!

> My question is, how do I plot predicted values from loess to extend the
> lines beyond the range of x? Let's say I want all lines to stop at x = 15.

loess is "local polynomial regression fitting". It is good to guide your eyes
through confusing data points, but not at all suitable for extrapolation (that's
why it is good locally). I would say, it is not even good for interpolation, but
that a matter of discussion.

I doubt that an extrapolation of a factor 2 beyond the initial range is possible
at all without a VERY good model of your data. But in each case, you need a
model, for example from earlier longer records. How does the poor function know
that your data do not bend down logistic-like after you last value?


Dieter



More information about the R-help mailing list