Description Usage Arguments Details Value Author(s) See Also Examples
View source: R/betahat_matrix.R
Estimates of Regression Slopes \boldsymbol{\hat{β}}_{2, \cdots, k}
1 | slopeshat(X, y)
|
X |
|
y |
Numeric vector of length |
Estimates of the linear regression slopes are calculated using
\boldsymbol{\hat{β}}_{2, \cdots, k} = \boldsymbol{\hat{Σ}}_{\mathbf{X}}^{T} \boldsymbol{\hat{σ}}_{\mathbf{y}, \mathbf{X}}
where
\boldsymbol{\hat{Σ}}_{\mathbf{X}} is the p \times p covariance matrix of the regressor variables X_2, X_3, \cdots, X_k and
\boldsymbol{\hat{σ}}_{\mathbf{y}, \mathbf{X}} is the p \times 1 column vector of the covariances between the regressand y variable and regressor variables X_2, X_3, \cdots, X_k
Returns the estimated slopes \boldsymbol{\hat{β}}_{2, \cdots, k} of a linear regression model derived from the estimated variance-covariance matrix.
Ivan Jacob Agaloos Pesigan
Other beta-hat functions:
.betahatnorm()
,
.betahatqr()
,
.betahatsvd()
,
.intercepthat()
,
.slopeshatprime()
,
.slopeshat()
,
betahat()
,
intercepthat()
,
slopeshatprime()
1 2 3 4 5 6 7 8 9 10 11 | # Simple regression------------------------------------------------
X <- jeksterslabRdatarepo::wages.matrix[["X"]]
X <- X[, c(1, ncol(X))]
y <- jeksterslabRdatarepo::wages.matrix[["y"]]
slopeshat(X = X, y = y)
# Multiple regression----------------------------------------------
X <- jeksterslabRdatarepo::wages.matrix[["X"]]
# age is removed
X <- X[, -ncol(X)]
slopeshat(X = X, y = y)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.