[R] Drawing the regression line and the 95% confidence intervals
drjimlemon at gmail.com
Wed May 6 01:02:49 CEST 2015
The line you have requested is off the plot. The following will
produce what I think you are asking, but I cannot speak for whether it
means anything sensible.
On Wed, May 6, 2015 at 8:01 AM, varin sacha <varinsacha at yahoo.fr> wrote:
> Hi, Dear R-helpers,
> Here below you will find a reproducible fictitious example working except the "abline" function.
> First thing : I try to draw the regression line (multiple linear regression). I try the "abline" function but it does not work. I don't get any error message but the straight line does not appear on the scatterplot.
> Second thing : I try to draw the 95% confidence intervals on the regression line. How could I do ?
> Using abline(0,1), I can of course add a line 45 degrees angle passing through the origin (intercept=0 and slope=1), but it is not what I am looking for.
> LinearModel.1=lm(GDP.per.head ~ Quality.score + Competitivness.score)
> plot(GDP.per.head, fitted(LinearModel.1))
> abline(GDP.per.head, fitted(LinearModel.1))
> Thanks for your help. Looking forward to reading you.
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
More information about the R-help