Calculate the residuals from the regression of each column of a data.frame against all the other columns.
1 2 3 4 5 6 7 8 9 10  X.residuals(x, ...)
## Default S3 method:
X.residuals(x, y.name, na.action = na.exclude, ...) ## x is a data.frame
## S3 method for class 'formula'
X.residuals(x, data, na.action = na.exclude, ...) ## x is a formula
## S3 method for class 'lm'
X.residuals(x, na.action = na.exclude, ...) ## x is a "lm" object computed with x=TRUE

x 

na.action 
See

... 
additional arguments. 
y.name 
Name of Yvariable to be excluded from the computations. 
data 
A data frame in which the variables specified in the formula will be found. If missing, the variables are searched for in the standard way. 
Data.frame of residuals, one column from each regression.
Richard M. Heiberger <rmh@temple.edu>
Heiberger, Richard M. and Holland, Burt (2004b). Statistical Analysis and Data Display: An Intermediate Course with Examples in SPlus, R, and SAS. Springer Texts in Statistics. Springer. ISBN 0387402705.
1 2 3 4 5 6 7 8 9 10 11 12 13 14  data(usair)
usair$lnSO2 < log(usair$SO2)
usair$lnmfg < log(usair$mfgfirms)
usair$lnpopn < log(usair$popn)
usair.lm < lm(lnSO2 ~ temp + lnmfg + wind + precip, data=usair)
X.residuals(usair.lm)
X.residuals(lnSO2 ~ temp + lnmfg + wind + precip, data=usair)
X.residuals(usair)
X.residuals(usair, y.name="lnSO2")

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.
Please suggest features or report bugs with the GitHub issue tracker.
All documentation is copyright its authors; we didn't write any of that.