[R] residual plots

From: Matt Scholz <scholzilla_at_gmail.com>
Date: Tue, 25 Nov 2008 13:48:15 -0700


I've fit a linear model to my data set using the <lm> function. One of the outputs of that function is a vector of the residuals. I would like to do a residual plot of this data versus a predictor variable, but the length of the residual vector is shorter than the length of the predictor variable vector. This is because when <lm> computes the residual vector, it deletes entries that came up NA (and lists these as a vector called na.action). Could someone please tell me how I can do a simple scatterplot of residuals v. predictor variable in an instance such as this? I'm not much of a code-jockey and haven't been able to find the right function if it exists.

Thanks,

Matt

        [[alternative HTML version deleted]]



R-help_at_r-project.org 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. Received on Tue 25 Nov 2008 - 20:51:46 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 25 Nov 2008 - 22:30:30 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive