# mma

##### Marginal Mediation

Provides the ability to perform marginal mediation. Marginal mediation is particularly useful for situations where the mediator or outcome is categorical, a count, or some other non-normally distributed variable. The results provide the average marginal effects of the models, providing simple interpretation of the indirect effects.

##### Usage

`mma(..., ind_effects, ci_type = "perc", boot = 500, ci = 0.95)`

##### Arguments

- ...
the glm model objects; the first is the model with the outcome while the others are the mediated effects ("a" paths)

- ind_effects
a vector of the desired indirect effects. Has the form

`"var1-var2"`

.- ci_type
a string indicating the type of bootstrap method to use (currently "perc" and "basic" are available; "perc" is recommended). Further development will allow the Bias-Corrected bootstrap soon.

- boot
the number of bootstrapped samples; default is 500

- ci
the confidence interval; the default is .95 which is the 95% confidence interval.

##### Details

Using the average marginal effects as discussed by Tamas Bartus (2005), the coefficients are transformed into probabilities (for binary outcomes) or remain in their original units (continuous outcomes).

##### Value

A list of class `mma`

containing:

the indirect effects reported in the average marginal effect

the direct effects reported in the average marginal effect

the confidence level

the original data frame

the indirect effects the user requested (in the `...`

)

the number of bootstrap samples

the formulas of the individual sub-models

the original function call

##### References

Bartus, T. (2005). Estimation of marginal effects using margeff. The Stata Journal, 5(3), 309<U+2013>329.

MacKinnon, D. (2008). Introduction to Statistical Mediation Analysis. Taylor \& Francis, LLC.

##### Examples

```
# NOT RUN {
## A minimal example:
library(furniture)
data(nhanes_2010)
bcpath = glm(marijuana ~ home_meals + gender + age + asthma,
data = nhanes_2010,
family = "binomial")
apath = glm(home_meals ~ gender + age + asthma,
data = nhanes_2010,
family = "gaussian")
(fit = mma(bcpath, apath,
ind_effects = c("genderFemale-home_meals",
"age-home_meals",
"asthmaNo-home_meals"),
boot = 10))
# }
```

*Documentation reproduced from package MarginalMediation, version 0.5.1, License: GPL-2*