Learn R Programming

effects (version 4.2-0)

effCoef: Function to get coefficient estimates from regression models for use in the effects package.

Description

This function uses the get_parameters function in the insight package to get a vector of regression coefficients for use in the effects package. It converts the two-column data.frame returned by get_parameters to a vector of named elements.

Usage

effCoef(mod, ...)

# S3 method for default effCoef(mod, ...)

Arguments

mod

A model object with a linear predictor representing fixed effects.

...

Additional parameter passed to get_parameters.

Value

A vector of coefficient estimates

Details

The get_parameters function can be used to retrieve the coefficient estimates corresponding to a linear predictor for many regression models, and return them as a two column data.frame, with regressor names in the first column and estimates in the second column. This function converts this output to a named vector as is expected by the effects package.

See Also

get_parameters, and vignette Regression Models Supported by the effects Package

Examples

Run this code
# NOT RUN {
m1 <- lm(prestige ~ type + income + education, Duncan)
effCoef(m1)
# }

Run the code above in your browser using DataLab