Description Usage Arguments Author(s) Examples
Get Residuals from data given a model
1 | get.resids(Y, mod)
|
Y |
Matrix of data |
mod |
Model matrix parameterizing coefficients |
Brig Mecham <brig.mecham@sagebase.org> and John D. Storey <jstorey@princeton.edu>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | ##---- Should be DIRECTLY executable !! ----
##-- ==> Define data, use random,
##-- or do help(data=index) for the standard data sets.
## The function is currently defined as
function (data.matrix, design.matrix)
{
x.qr <- qr(design.matrix)
x.det <- prod(diag(x.qr$qr))
x.cov.unscaled <- solve(t(qr.R(x.qr)) %*% qr.R(x.qr))
x.df <- nrow(design.matrix) - x.qr$rank
Fit.coef <- qr.coef(x.qr, t(data.matrix))
Fit.res <- qr.resid(x.qr, t(data.matrix))
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.