avm.vcov | R Documentation |
The function simply calculates
\mathrm{Cov}{\hat{\beta}}=(X'X)^{-1}X'\hat{\Omega}X(X'X)^{-1}
,
where X
is the design matrix of a linear regression model and
\hat{\Omega}
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
.
avm.vcov(object, as_matrix = TRUE)
object |
Either an object of class |
as_matrix |
A logical. If |
Either a numeric matrix or a numeric vector, whose (diagonal)
elements are \widehat{\mathrm{Var}}(\hat{\beta}_j)
,
j=1,2,\ldots,p
.
alvm.fit
, anlvm.fit
,
avm.fwls
. If a matrix is returned, it can be
passed to coeftest
for implementation
of a quasi-t
-test of significance of the \beta
coefficients.
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.