Skip to content
Back to formatted view

Raw Message

Message-ID: <1294934988502-3216099.post@n4.nabble.com>
Date: 2011-01-13T16:09:48Z
From: ep
Subject: add a linear regression line to the plot
In-Reply-To: <1666b43.87c5.12d7e83cb3b.Coremail.wangxipei@gmail.com>

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

-- 
View this message in context: http://r.789695.n4.nabble.com/add-a-linear-regression-line-to-the-plot-tp3215455p3216099.html
Sent from the R help mailing list archive at Nabble.com.