[R] plot output function
cp133 at york.ac.uk
Fri May 23 18:03:35 CEST 2003
no, I'm afraid abline does not help, it works only for straight lines.
The output of my function is a vector of fitted values (called fit).
I would like to superimpose the fitted regression line to the
scatterplot of the data.
Therefore, I use the commands "plot(x,y)"to display the scatterplot;
"lines(x,fit)" to add the estimated regression line.
The graph displays the scatterplot correctly but not the fitted
When I use the command "plot(x,fit)" I get the correct regression line
but the plot is very rough, it looks like that, instead of a single
clear line, I get several thin lines.
Hope this is clearer.
Uwe Ligges wrote:
> cp133 wrote:
> > Hi,
> > I have written my own function to estimate a local linear regression.
> > When I plot the output vector on the scatterplot of the data, the
> > function lines does not work and I get a rescaled regression line.
> > When I plot the output vector alone, the graph looks right, but choosing
> > the type "line" instead of the default does not deliver a clear single
> > line.
> > Does somebody know why this is happening.
> Does abline() help?
> If not, please be more specific in your question and tell us what you
> are exactly going to do.
> Uwe Ligges
More information about the R-help