Description Usage Arguments Value Author(s) References See Also Examples
Calculates residuals using
\boldsymbol{\hat{\varepsilon}} = \mathbf{My} .
where
\mathbf{M} = \mathbf{I} - \mathbf{P} \\ = \mathbf{I} - \mathbf{X} ≤ft( \mathbf{X}^{T} \mathbf{X} \right)^{-1} \mathbf{X}^{T} .
1 | My(X, y)
|
X |
|
y |
Numeric vector of length |
Returns an n \times 1 matrix of residuals ≤ft( \boldsymbol{\hat{\varepsilon}} \right), that is, the difference between the observed ≤ft( \mathbf{y} \right) and predicted ≤ft( \mathbf{\hat{y}} \right) values of the regressand variable ≤ft( \boldsymbol{\hat{\varepsilon}} = \mathbf{y} - \mathbf{\hat{y}} \right).
Ivan Jacob Agaloos Pesigan
Wikipedia: Errors and Residuals
Other residuals functions:
.My()
,
.tepsilonhat()
,
.yminusyhat()
,
epsilonhat()
,
tepsilonhat()
,
yminusyhat()
1 2 3 4 5 6 7 8 9 10 11 12 13 | # Simple regression------------------------------------------------
X <- jeksterslabRdatarepo::wages.matrix[["X"]]
X <- X[, c(1, ncol(X))]
y <- jeksterslabRdatarepo::wages.matrix[["y"]]
My <- My(X = X, y = y)
hist(My)
# Multiple regression----------------------------------------------
X <- jeksterslabRdatarepo::wages.matrix[["X"]]
# age is removed
X <- X[, -ncol(X)]
My <- My(X = X, y = y)
hist(My)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.