Welcome to Code Sharer, a code gallery for creating, saving and sharing all kinds of code snippets.

R — Regression line

Posted On: Thursday, November 27, 2014 at 6:44 PM

Plot a regression line in R and print the summary of the regression line.





fit<-lm(y~x)
abline(lm(x~y), col="red") # regression line (y~x)
print(summary(fit))

Ryan Bradley-Evans (Admin)

Joined on
Contributed 22 Snips

Get Social and Share

Tags