fixcoef: Generic function to get fixed effects of a model

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

View source: R/main.R

Description

This is a generic S3 function that gets point estimates 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
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
fixcoef(model, ...)

## S3 method for class 'lmerMod'
fixcoef(model, ...)

## S3 method for class 'glmerMod'
fixcoef(model, ...)

## S3 method for class 'lmerModLmerTest'
fixcoef(model, ...)

## S3 method for class 'lme'
fixcoef(model, ...)

## S3 method for class 'multinom'
fixcoef(model, ...)

## S3 method for class 'mlm'
fixcoef(model, ...)

## Default S3 method:
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 only estimates of fixed-effects of a model. Random effects are ignored. The names of the element of this vector must be consistent with the rownames and colnames of the variance-covariance matrix that vcov_fixcoef returns. The vcov_fixcoef function, on the same model, must return a matrix with the same number and names of rows and columns as the length of the vector returned by fixcoef.

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

Value

Simple numeric vector with one item for each fixed effect of the model.

Methods (by class)

See Also

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

Examples

1
2
data(mtcars)
fixcoef(lm(data=mtcars, hp ~ 1)) # get mean horse power of cars listed in mtcars

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

Related to fixcoef in glmglrt...