statsmodels.stats.mediation.Mediation.fit#

Mediation.fit(method='parametric', n_rep=1000, *, rng=None)[source]#

Fit a regression model to assess mediation

Parameters:
methodstr, optional

Either ‘parametric’ or ‘bootstrap’.

n_repint, optional

The number of simulation replications.

rngint, array_like of int, numpy.random.Generator, numpy.random.RandomState, optional

If rng is None, a new Generator is created using fresh entropy from the operating system. If rng is an int or array of ints, a new Generator is created, seeded with rng. If rng is already a Generator or RandomState instance, that instance is used.

Returns:
MediationResults

Results of the mediation analysis.