Description Usage Arguments Value Examples
get residuals of columns in data regressed cov with lm
1 | getResiduals(data, cov, addmean = TRUE)
|
data |
a data frame or tibble, contains the columns to calculate residuals |
cov |
a data frame or tibble, contains the columns as covariate. The length of row should be the same as data |
addmean |
logical, should the mean of original data should be added back to the residual, default is true |
a data frame with same dimension with data, containing the residuals of the original columns
1 2 3 4 5 | data("mtcars")
getResiduals(mtcars[1:3], mtcars[4:5])
#get residual without adding mean back
getResiduals(mtcars[1:3], mtcars[4:5],addmean = FALSE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.