[R] Plotting of the lm

2003-09-23 Thread Melissa_Kuang
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

Re: [R] Plotting of the lm

2003-09-23 Thread Uwe Ligges
[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

Re: [R] Plotting of the lm

2003-09-23 Thread Gavin Simpson
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: