[R] Newbie question: plotting regression models

Douglas Bates bates at stat.wisc.edu
Wed Nov 3 21:56:30 CET 2004


Regarding plotting a regression fit - for a simple linear regression 
model the abline function adds the fitted line to a plot.

plot(optden ~ carb, Formaldehyde)
abline(fm1 <- lm(optden ~ carb, Formaldehyde))




More information about the R-help mailing list