Hi,
I would like to enquire if by typing plot (lm(y~x)) would this show me the
plot of the fitted line? I tried this function previously but I was only
able to get the last 4 plots starting with Residuals vs fitted.
Thank You.
Melissa
[EMAIL PROTECTED] wrote:
Hi,
I would like to enquire if by typing plot (lm(y~x)) would this show me the
plot of the fitted line? I tried this function previously but I was only
able to get the last 4 plots starting with Residuals vs fitted.
No, it shows plots for analyses of the residuals.
Try
Try this:
plot(x, y)
abline(lm(y ~ x)) #plots the fitted line
or this if you need the model results elsewhere:
mod.lm - lm(y ~ x) # store the model
plot(x, y)# plot the data
abline(mod.lm)# plot the fitted line
see ?plot.lm and ?abline
HTH
Gav
[EMAIL PROTECTED] wrote: