ols: OLS estimation

Description Usage Arguments Details Value Author(s) References See Also

View source: R/ols.R

Description

OLS estimation with the QR decomposition and, for some options, computation of variance- covariance matrices

Usage

1
2
ols(y, x, untransformed.residuals=NULL, tol=1e-07, LAPACK=FALSE, method=3,
  user.fun=NULL, user.options=NULL)

Arguments

y

numeric vector, the regressand

x

numeric matrix, the regressors

untransformed.residuals

NULL, the default, or - when method=6 - a numeric vector containing the untransformed residuals

tol

numeric value. The tolerance for detecting linear dependencies in the columns of the regressors, see the qr function. Only used if LAPACK is FALSE

LAPACK

logical, TRUE or FALSE (default). If true use LAPACK otherwise use LINPACK, see the qr function

method

an integer, 0 to 6, that determines the estimation method

user.fun

NULL (default) or the name (a character) of the user-defined estimator

user.options

NULL (default) or a list with arguments (entries) that are passed on to the user-defined function

Details

method = 1 or 2 only returns the OLS coefficient estimates together with the QR-information. method = 1 is slightly faster than method=2. method=3 returns in addition the ordinary variance-covariance matrix of the OLS estimator. method=4 returns the White (1980) heteroscedasticity robust variance-covariance matrix in addition to the information returned by method=3, whereas method=5 does the same except that the variance-covariance matrix now is that of Newey and West (1987). method=6 undertakes OLS estimation of a log-variance model.

Value

A list with items depending on the method

Author(s)

Genaro Sucarrat, http://www.sucarrat.net/

References

H. White (1980): 'A Heteroskedasticity-Consistent Covariance Matrix and a Direct Test for Heteroskedasticity', Econometrica 48, pp. 817-838.

W. Newey and K. West (1987): 'A Simple Positive Semi-Definite, Heteroskedasticity and Autocorrelation Consistent Covariance Matrix', Econometrica 55, pp. 703-708.

See Also

qr, solve.qr


gets documentation built on Oct. 8, 2017, 1:03 a.m.