vcov_fixcoef: Gets the variance-covariance matrix of fixed effects of a...

Description Usage Arguments Details Methods (by class) See Also Examples

View source: R/main.R

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

1
2
3
4
5
6
7
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 p_value_contrast.default but that may be useful to some specializations.

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)

See Also

Other Wald-related functions: df_for_wald(), fixcoef(), p_value_contrast()

Examples

1
2
3
4
5
6
7
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

glmglrt documentation built on Aug. 7, 2020, 9:10 a.m.