Skip to content
Prev 156904 / 398506 Next

Options for viewing / using results from lm

I haven't seen a response to this yet, so I will give my $0.25US worth (which is not worth that much anymore ).  :-)
Why do you think it is better done in another program?  Keeping it in R saves you from the exporting, which you say you are having trouble with.
See ?residuals.

Try the following:

x <- sample(1:20, 100, replace=TRUE)
y <- rnorm(100)
fit.lm <- lm(y ~ x)
plot(residuals(fit.lm))
plot(x,residuals(fit.lm))
Hope this is helpful,

Dan

Daniel J. Nordlund
Washington State Department of Social and Health Services
Planning, Performance, and Accountability
Research and Data Analysis Division
Olympia, WA  98504-5204