Skip to content
Prev 247248 / 398503 Next

add a linear regression line to the plot

ep
Hi, 

if it should be "lines" so you can do that

xy.lm <- lm(y~x)
lines(x, xy.lm$coeff[1] + x*xy.lm$coeff[2], col="blue", lwd=3)

Regards

ep