avm.vcov {skedastic} | R Documentation |
Estimate Covariance Matrix of Ordinary Least Squares Estimators Using Error Variance Estimates from an Auxiliary Variance Model
Description
The function simply calculates
,
where is the design matrix of a linear regression model and
is an estimate of the diagonal variance-covariance
matrix of the random errors, whose diagonal elements have been
obtained from an auxiliary variance model fit with
alvm.fit
or anlvm.fit
.
Usage
avm.vcov(object, as_matrix = TRUE)
Arguments
object |
Either an object of class |
as_matrix |
A logical. If |
Value
Either a numeric matrix or a numeric vector, whose (diagonal)
elements are ,
.
References
There are no references for Rd macro \insertAllCites
on this help page.
See Also
alvm.fit
, anlvm.fit
,
avm.fwls
. If a matrix is returned, it can be
passed to coeftest
for implementation
of a quasi--test of significance of the
coefficients.
Examples
mtcars_lm <- lm(mpg ~ wt + qsec + am, data = mtcars)
myalvm <- alvm.fit(mainlm = mtcars_lm, model = "linear",
varselect = "qgcv.linear")
myvcov <- avm.vcov(myalvm)
lmtest::coeftest(mtcars_lm, vcov. = myvcov)