statsmodels.stats.mediation.Mediation.fit#

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

Fit a regression model to assess mediation

Parameters:
methodstr

Either ‘parametric’ or ‘bootstrap’.

n_repint

The number of simulation replications.

rng{None, int, array_like[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.