OLS estimation with the QR decomposition and, for some options, computation of variance covariance matrices
1 
y 
numeric vector, the regressand 
x 
numeric matrix, the regressors 
tol 
numeric value. The tolerance for detecting linear dependencies in the columns of the regressors, see 
LAPACK 
logical, TRUE or FALSE (default). If true use LAPACK otherwise use LINPACK, see 
method 
1 (default) or 2. Method 2 returns slightly more information, which means it is slightly slower. However, the information returned can be used to speed up the computation of variancecovariance matrices 
user.fun 
the name of the userfunction (a character) 
user.options 
a list with arguments (entries) that are passed on to the userfunction 
method = 1
or 2 only returns the OLS coefficient estimates together with the QRinformation. method = 1
is slightly faster than method=2
. method=3
returns in addition the ordinary variancecovariance matrix of the OLS estimator. method=4
returns the White (1980) heteroscedasticity robust variancecovariance matrix in addition to the information returned by method=3
, whereas method=5
does the same except that the variancecovariance matrix now is that of Newey and West (1987).
A list with some or all of the following elements:
qr 

rank 

qraux 

pivot 

xtxinv 

xtx 

xty 

coefficients 

fitted 

residuals 

resids2 

rss 

df 

sigma2 

omegahat 

vcov 
Genaro Sucarrat, http://www.sucarrat.net/
H. White (1980): 'A HeteroskedasticityConsistent Covariance Matrix and a Direct Test for Heteroskedasticity', Econometrica 48, pp. 817838.
W. Newey and K. West (1987): 'A Simple Positive SemiDefinite, Heteroskedasticity and Autocorrelation Consistent Covariance Matrix', Econometrica 55, pp. 703708.
Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.
Please suggest features or report bugs with the GitHub issue tracker.
All documentation is copyright its authors; we didn't write any of that.