On Wed, 2007-01-31 at 09:25 -0800, amna khan wrote:
> Sir I am not finding the function to plot least square regression line on
> type="o" plot of two variables.
> guid me in this regard.

Did you want something like this:

 x <- 1:50
 y <- rnorm(50)
 plot(x, y, type = "o")
 abline(lm(y ~ x))

See ?abline if so.

Alternatively, see ?predict.lm for additional possibilities.

HTH,

Marc Schwartz

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to