vcov_fixcoef {glmglrt} | R Documentation |
Gets the variance-covariance matrix of fixed effects of a fitted model
Description
This is a generic S3 function that gets the variance-covariance matrix of fixed effects of a statistical model, implemented on a wide range of models and that can be extended to new models.
Usage
vcov_fixcoef(model, ...)
## Default S3 method:
vcov_fixcoef(model, ...)
## S3 method for class 'survreg'
vcov_fixcoef(model, ...)
Arguments
model |
a fitted statistical model |
... |
argument unused by |
Details
It must return variance-covariance for fixed effects of a model, not random effects nor scale parameters.
The rownames
and colnames
of the returned matrix
must be consistent with names
of fixcoef(object)
.
The functions vcov_fixcoef
and fixcoef
would be pointless if the behavior of
vcov
and coef
were not inconsistent from package to package.
fixcoef
and vcov_fixcoef
, together with df_for_wald
are used by p_value_contrast.default
Methods (by class)
-
default
: default implementation, simple proxy ofvcov(model)
-
survreg
: implementation for survreg, removing the extra column for Scale
See Also
Other Wald-related functions:
df_for_wald()
,
fixcoef()
,
p_value_contrast()
Examples
data(mtcars)
mod = lm(data=mtcars, hp ~ cyl+wt)
est = fixcoef(mod) # get estimates
SE = sqrt(diag(vcov_fixcoef(mod))) # get standard errors of estimates
z = est/SE # get z-score of estimates
df = df_for_wald(mod) # degrees of freedom
pvalues = 2*pt(-abs(z), df=df) # get two-sided P-values