[R] plotting least-squares regression against x-axis

Jason Priem priem at email.unc.edu
Sun Sep 20 02:35:21 CEST 2009


Hi,
I want to plot the residuals of a least-squares regression.

plot(lm(y~x), which=1)

does this, but it plots the y-axis of my data on the x-axis of the 
residuals plot.  That is, it plots the residual for each y-value in the 
data.  Can I instead use the x-axis of my data as the x-axis of the 
residuals plot, showing the residual for a given x?

Thanks!

Jason Priem
University of North Carolina at Chapel Hill
School of Information and Library Science




More information about the R-help mailing list