Description Usage Arguments Value Author(s) References See Also Examples
Calculates the residual maker matrix ≤ft( \mathbf{M} \right) using
\mathbf{M} = \mathbf{I} - \mathbf{P}
where
\mathbf{P} = \mathbf{X} ≤ft( \mathbf{X}^{T} \mathbf{X} \right)^{-1} \mathbf{X}^{T} .
The residual maker matrix ≤ft( \mathbf{M} \right) transforms the \mathbf{y} vector to the vector of residuals ≤ft( \mathbf{e} = \mathbf{My} \right) .
1 | M(X)
|
X |
|
Returns the residual maker matrix ≤ft( \mathbf{M} \right) .
Ivan Jacob Agaloos Pesigan
Other projection matrix functions:
.M()
,
.h()
,
P()
,
h()
1 2 3 4 5 6 7 8 9 10 11 12 | # Simple regression------------------------------------------------
X <- jeksterslabRdatarepo::wages.matrix[["X"]]
X <- X[, c(1, ncol(X))]
M <- M(X = X)
str(M, list.len = 6)
# Multiple regression----------------------------------------------
X <- jeksterslabRdatarepo::wages.matrix[["X"]]
# age is removed
X <- X[, -ncol(X)]
M <- M(X = X)
str(M, list.len = 6)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.