statsmodels.stats.mediation.Mediation.fit

Mediation.fit(method='parametric', n_rep=1000)[source]

Fit a regression model to assess mediation.

Parameters:

method : string

Either ‘parametric’ or ‘bootstrap’.

n_rep : integer

The number of simulation replications.

Returns a MediationResults object.