linreg_vcov: Linear Regression (variance-covariance of OLS estimates)

Description Usage Arguments Value Author(s)

View source: R/linreg.R

Description

Calculates the variance-covariance matrix of ordinary least squares estimates (σ^2 ≤ft(\mathbf{X}^{\prime} \mathbf{X} \right)^{-1}).

Usage

1
linreg_vcov(beta_hat = NULL, X, y, m = FALSE, s2_est = "ols")

Arguments

beta_hat

Vector of k estimated regression parameters. If NULL, regression coefficients are estimated using ≤ft( \mathbf{X}^{\prime} \mathbf{X} \right)^{-1} ≤ft( \mathbf{X}^{\prime} \mathbf{y} \right) .

X

The data matrix, that is an n \times k matrix of n observations of k regressors, which includes a regressor whose value is 1 for each observation.

y

n \times 1 vector of observations on the regressand variable.

m

Logical. If TRUE, the function uses an alternative formula e = \mathbf{M} \mathbf{y} . See linreg_m for \mathbf{M}.

s2_est

String. Residual variance estimator. If "both", returns both OLS and ML estimates as a vector. If "ols", returns OLS estimate. If "ml", returns ML estimate.

Value

Returns variance-covariance matrix of regression coefficients.

Author(s)

Ivan Jacob Agaloos Pesigan


jeksterslabds/jeksterslabRds documentation built on July 16, 2020, 3:41 p.m.