Learn R Programming

dcce (version 0.4.2)

.unit_ols: Unit-level OLS

Description

Fast OLS for a single cross-sectional unit. Uses normal equations rather than lm() for speed when called in a loop.

Usage

.unit_ols(y, X)

Value

A list with elements:

b

Coefficient vector.

V

Variance-covariance matrix of coefficients.

e

Residual vector.

r2

R-squared.

df_resid

Residual degrees of freedom.

sigma2

Residual variance (s^2).

Arguments

y

Numeric vector: dependent variable.

X

Numeric matrix: regressors (including intercept if desired).