statsmodels.stats.mediation.Mediation.fit#
- Mediation.fit(method='parametric', n_rep=1000, *, rng=None)[source]#
Fit a regression model to assess mediation
- Parameters:
- method
str Either ‘parametric’ or ‘bootstrap’.
- n_rep
int The number of simulation replications.
- rng{
None,int, array_like[int],numpy.random.Generator,numpy.random.RandomState},optional If rng is None, a new
Generatoris created using fresh entropy from the operating system. If rng is an int or array of ints, a newGeneratoris created, seeded with rng. If rng is already aGeneratororRandomStateinstance, that instance is used.
- method
- Returns:
MediationResultsResults of the mediation analysis.