Skip to contents

This function computes generalized Marginal Effects (gME) for a given model and regressor of interest.

Usage

get_gME(
  model_fit,
  reg_of_interest = NULL,
  integration = NULL,
  seed = NULL,
  ndraws = 10000,
  separate_interactions = FALSE,
  catRIbin = FALSE,
  ...
)

Arguments

model_fit

A fitted model object.

reg_of_interest

The regressor of interest for which gME values are calculated.

integration

An integration function. Default is NULL. #TOFIX ... assumption1 assumption2 assumption3

seed

Seed for random number generation. Default is NULL.

ndraws

Number of draws for sampling. Default is 1000.

separate_interactions

Boolean indicating whether interactions should be separated. Default is FALSE.

catRIbin

Boolean indicating categorical RI binning. Default is FALSE.

...

Additional arguments to be passed to other functions.

Value

A matrix containing gME values for the regressor of interest.

Details

This function computes gME values based on the specified model and regressor of interest. It supports various types of models including GLM and GLMM. The gME values are computed either empirically or through other standard options depending on the distribution.

Note

...

References

Kümpel, H. & Hoffmann, S. A formal framework for generalized reporting methods in parametric settings. ArXiv Prepr. ArXiv221102621 (2022).

Examples

if (FALSE) {
model <- lm(mpg ~ cyl + disp + hp + drat, data = mtcars)
get_gME(model_fit = model, reg_of_interest = "cyl")
}