Skip to content
Prev 306163 / 398506 Next

add lowess predicted line to scatter plot

Is GNI sorted?  if not then the lines function plots the line segments
to the points in the order given and that would explain part of the
strangeness (the png file did not make it through).  Are there gaps
between the GNI values?  even if GNI is sorted, your code below will
just draw line segments between values that GNI was observed at and
not a smooth curve between them.

Better would be something like:

xx <- seq( min(GNI), max(GNI), length.out=250 )
y.predict <- predict(y.loess, newdata=data.frame(GNI=xx))
lines(xx,y.predict)

On Mon, Sep 24, 2012 at 2:58 AM, Maximilian Lklweryc
<maxlklweryc at gmail.com> wrote: