Learn R Programming

glmglrt (version 0.2.2)

fixcoef: Generic function to get fixed effects of a model

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

fixcoef(model, ...)

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

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

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

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

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

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

# S3 method for default fixcoef(model, ...)

Arguments

model

a fitted statistical model

...

argument unused by p_value_contrast.default but that may be useful to some specializations.

Value

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

Methods (by class)

  • lmerMod: implementation for lme4::lmer

  • glmerMod: implementation for lme4::glmer

  • lmerModLmerTest: implementation for lmerTest::lmer

  • lme: implementation for nlme::lme

  • multinom: implementation for nnet::multinom

  • mlm: implementation for multiple responses linear models generated by stats::lm when the response is a matrix. It transforms the matrix to a vector, consistent with stats::vcov.

  • default: default implementation, simply calls coef(model).

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

See Also

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

Examples

Run this code
# NOT RUN {
data(mtcars)
fixcoef(lm(data=mtcars, hp ~ 1)) # get mean horse power of cars listed in mtcars
# }

Run the code above in your browser using DataLab