Module Expr Str Import alias identifier Import alias identifier ImportFrom alias Import alias identifier ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults NameLoad NameLoad NameLoad NameLoad body Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr IfExp CompareIsNot NameLoad NameLoad NameLoad Dict If CompareIs NameLoad NameLoad body Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr NameLoad Str orelse Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr IfExp CompareIsNot NameLoad NameLoad NameLoad Dict Assign AttributeStore NameLoad attr IfExp CompareIsNot NameLoad NameLoad NameLoad Dict Assign AttributeStore NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr Assign AttributeStore NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Str Str Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Str Str Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Str Str decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body If CompareEq NameLoad Str body Assign NameStore AttributeLoad NameLoad attr orelse Assign NameStore AttributeLoad NameLoad attr If CompareEq NameLoad Str body Return SubscriptLoad Call NameLoad AttributeLoad NameLoad attr NameLoad Index Num Assign NameStore AttributeLoad NameLoad attr Assign NameStore BoolOpAnd CompareEq Call NameLoad NameLoad Num CompareNotEq Call NameLoad NameLoad Call NameLoad Str If NameLoad body If CompareEq NameLoad Str body Return SubscriptLoad NameLoad Index Num orelse If CompareEq NameLoad Str body Return SubscriptLoad NameLoad Index Num orelse Return SubscriptLoad Call NameLoad NameLoad NameLoad Index Num decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body If Call NameLoad NameLoad Str body Return Call AttributeLoad SubscriptLoad Call AttributeLoad AttributeLoad NameLoad attr attr Str Index Num attr orelse Raise Call NameLoad BinOpMod Str NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr Return Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore AttributeLoad NameLoad attr If UnaryOpNot Call NameLoad AttributeLoad NameLoad attr Str body Assign SubscriptStore NameLoad ExtSlice Slice Index AttributeLoad NameLoad attr NameLoad For NameStore AttributeLoad NameLoad attr body Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index NameLoad Assign SubscriptStore NameLoad ExtSlice Slice Index SubscriptLoad NameLoad Index Num NameLoad orelse Assign NameStore Call AttributeLoad AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr attr Assign SubscriptStore AttributeLoad NameLoad attr ExtSlice Slice Index AttributeLoad NameLoad attr NameLoad For NameStore AttributeLoad NameLoad attr body Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index NameLoad Assign SubscriptStore AttributeLoad NameLoad attr ExtSlice Slice Index NameLoad NameLoad Assign NameStore AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Call AttributeLoad NameLoad attr keyword NameLoad NameLoad Assign NameStore AttributeLoad NameLoad attr Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign NameStore AttributeLoad NameLoad attr If UnaryOpNot Call NameLoad AttributeLoad NameLoad attr Str body Assign SubscriptStore NameLoad ExtSlice Slice Index AttributeLoad NameLoad attr NameLoad Assign SubscriptStore NameLoad ExtSlice Slice Index AttributeLoad NameLoad attr NameLoad For NameStore AttributeLoad NameLoad attr body Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index NameLoad Assign SubscriptStore NameLoad ExtSlice Slice Index SubscriptLoad NameLoad Index Num NameLoad orelse Assign NameStore Call AttributeLoad AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr attr Assign SubscriptStore AttributeLoad NameLoad attr ExtSlice Slice Index AttributeLoad NameLoad attr NameLoad Assign SubscriptStore AttributeLoad NameLoad attr ExtSlice Slice Index AttributeLoad NameLoad attr NameLoad For NameStore AttributeLoad NameLoad attr body Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index NameLoad Assign SubscriptStore AttributeLoad NameLoad attr ExtSlice Slice Index NameLoad NameLoad Assign NameStore AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Call AttributeLoad NameLoad attr keyword NameLoad NameLoad Assign NameStore AttributeLoad NameLoad attr Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults NameLoad body Assign NameStore AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore AttributeLoad NameLoad attr Assign NameStore AttributeLoad NameLoad attr If NameLoad body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Num Call NameLoad NameLoad Call NameLoad NameLoad Assign NameStore SubscriptLoad NameLoad Index NameLoad Assign NameStore SubscriptLoad NameLoad ExtSlice Index NameLoad Slice Assign NameStore Call NameLoad NameLoad NameLoad NameLoad Return Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults Str Num body Expr Str If Call AttributeLoad NameLoad attr Str body Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr orelse If UnaryOpNot Call AttributeLoad NameLoad attr Str body Raise Str Assign NameStore ListLoad ListLoad ListLoad Assign NameStore ListLoad ListLoad ListLoad For NameStore Call NameLoad NameLoad body If CompareEq NameLoad Str body Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad orelse Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr keyword NameLoad Assign NameStore AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr keyword NameLoad Assign NameStore AttributeLoad NameLoad attr Assign NameStore ListLoad ListLoad NameLoad NameLoad ListLoad NameLoad NameLoad For NameStore TupleLoad Num Num body Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad AttributeLoad NameLoad attr keyword NameLoad Assign NameStore Call AttributeLoad NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Index Num For NameStore TupleLoad Num Num body Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad Assign SubscriptStore SubscriptLoad NameLoad Index NameLoad Index NameLoad NameLoad For NameStore TupleLoad Num Num body Expr Call AttributeLoad SubscriptLoad NameLoad Index NameLoad attr BinOpSub SubscriptLoad SubscriptLoad NameLoad Index Num Index NameLoad SubscriptLoad SubscriptLoad NameLoad Index Num Index NameLoad Expr Call AttributeLoad SubscriptLoad NameLoad Index NameLoad attr BinOpSub SubscriptLoad SubscriptLoad NameLoad Index NameLoad Index Num SubscriptLoad SubscriptLoad NameLoad Index NameLoad Index Num For NameStore TupleLoad Num Num body Assign SubscriptStore NameLoad Index NameLoad AttributeLoad Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index NameLoad attr Assign SubscriptStore NameLoad Index NameLoad AttributeLoad Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index NameLoad attr Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign NameStore Call NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr NameLoad Return NameLoad decorator_list decorator_list FunctionDef arguments args NameParam defaults body Return BinOpDiv BinOpMult Num Call NameLoad Call NameLoad CompareGt NameLoad Num Call NameLoad CompareLt NameLoad Num Call NameLoad Call NameLoad NameLoad decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam defaults body Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign NameStore ListLoad NameLoad NameLoad Assign NameStore ListLoad NameLoad NameLoad For NameStore TupleLoad Num Num body Assign SubscriptStore NameLoad Index NameLoad Call AttributeLoad SubscriptLoad NameLoad Index NameLoad attr Num Assign SubscriptStore NameLoad Index NameLoad Call AttributeLoad SubscriptLoad NameLoad Index NameLoad attr Num Assign AttributeStore NameLoad attr SubscriptLoad NameLoad Index Num Assign AttributeStore NameLoad attr SubscriptLoad NameLoad Index Num Assign AttributeStore NameLoad attr SubscriptLoad NameLoad Index Num Assign AttributeStore NameLoad attr SubscriptLoad NameLoad Index Num Assign AttributeStore NameLoad attr BinOpDiv BinOpAdd BinOpAdd BinOpAdd AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Num Assign AttributeStore NameLoad attr BinOpDiv AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr BinOpDiv AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr BinOpDiv BinOpAdd AttributeLoad NameLoad attr AttributeLoad NameLoad attr Num Assign AttributeStore NameLoad attr BinOpDiv BinOpAdd AttributeLoad NameLoad attr AttributeLoad NameLoad attr Num Assign AttributeStore NameLoad attr BinOpDiv BinOpAdd AttributeLoad NameLoad attr AttributeLoad NameLoad attr Num decorator_list FunctionDef arguments args NameParam NameParam defaults Num body Expr Str Assign NameStore ListLoad Str Str Str Str Assign NameStore ListLoad Str Str Str Str Str Str Str Str Str Str Assign NameStore Call AttributeLoad NameLoad attr keyword NameLoad keyword NameLoad For TupleStore NameStore NameStore Call NameLoad ListLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr body If BoolOpOr CompareIs NameLoad AttributeLoad NameLoad attr CompareIs NameLoad AttributeLoad NameLoad attr CompareIs NameLoad AttributeLoad NameLoad attr body Assign SubscriptStore AttributeLoad NameLoad attr Index TupleLoad NameLoad Num Call AttributeLoad NameLoad attr NameLoad orelse Assign SubscriptStore AttributeLoad NameLoad attr Index TupleLoad NameLoad Num Call AttributeLoad NameLoad attr Assign SubscriptStore AttributeLoad NameLoad attr Index TupleLoad NameLoad Num Call AttributeLoad NameLoad attr NameLoad BinOpDiv BinOpMult Num NameLoad Num Assign SubscriptStore AttributeLoad NameLoad attr Index TupleLoad NameLoad Num Call AttributeLoad NameLoad attr NameLoad BinOpMult Num BinOpSub Num BinOpDiv NameLoad Num Assign SubscriptStore AttributeLoad NameLoad attr Index TupleLoad NameLoad Num Call NameLoad NameLoad If CompareLt AttributeLoad NameLoad attr Str body Assign NameStore Call AttributeLoad NameLoad attr keyword NameLoad orelse Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr keyword Str Return NameLoad decorator_list decorator_list
N/A N/A 
Mediation analysis

Implements algorithm 1 ('parametric inference') and algorithm 2
('nonparametric inference') from:

Imai, Keele, Tingley (2010).  A general approach to causal mediation
analysis. Psychological Methods 15:4, 309-334.

http://imai.princeton.edu/research/files/BaronKenny.pdf

The algorithms are described on page 317 of the paper.

In the case of linear models with no interactions involving the
mediator, the results should be similar or identical to the earlier
Barron-Kenny approach.
 N/A numpy np N/A pandas pd statsmodels.graphics.utils maybe_name_or_idx N/A statsmodels.compat.pandas pdc Mediation N/A object N/A N/A 
    Conduct a mediation analysis.

    Parameters
    ----------
    outcome_model : statsmodels model
        Regression model for the outcome.  Predictor variables include
        the treatment/exposure, the mediator, and any other variables
        of interest.
    mediator_model : statsmodels model
        Regression model for the mediator variable.  Predictor
        variables include the treatment/exposure and any other
        variables of interest.
    exposure : string or (int, int) tuple
        The name or column position of the treatment/exposure
        variable.  If positions are given, the first integer is the
        column position of the exposure variable in the outcome model
        and the second integer is the position of the exposure variable
        in the mediator model.  If a string is given, it must be the name
        of the exposure variable in both regression models.
    mediator : string or int
        The name or column position of the mediator variable in the
        outcome regression model.  If None, infer the name from the
        mediator model formula (if present).
    moderators : dict
        Map from variable names or index positions to values of
        moderator variables that are held fixed when calculating
        mediation effects.  If the keys are index position they must
        be tuples `(i, j)` where `i` is the index in the outcome model
        and `j` is the index in the mediator model.  Otherwise the
        keys must be variable names.
    outcome_fit_kwargs : dict-like
        Keyword arguments to use when fitting the outcome model.
    mediator_fit_kwargs : dict-like
        Keyword arguments to use when fitting the mediator model.

    Returns a ``MediationResults`` object.

    Notes
    -----
    The mediator model class must implement ``get_distribution``.

    Examples
    --------
    A basic mediation analysis using formulas:

    >>> probit = sm.families.links.probit
    >>> outcome_model = sm.GLM.from_formula("cong_mesg ~ emo + treat + age + educ + gender + income",
                                        data, family=sm.families.Binomial(link=probit))
    >>> mediator_model = sm.OLS.from_formula("emo ~ treat + age + educ + gender + income", data)
    >>> med = Mediation(outcome_model, mediator_model, "treat", "emo").fit()
    >>> med.summary()

    A basic mediation analysis without formulas.  This may be slightly
    faster than the approach using formulas.  If there are any
    interactions involving the treatment or mediator variables this
    approach will not work, you must use formulas.

    >>> outcome = np.asarray(data["cong_mesg"])
    >>> outcome_exog = patsy.dmatrix("emo + treat + age + educ + gender + income", data,
                                  return_type='dataframe')
    >>> probit = sm.families.links.probit
    >>> outcome_model = sm.GLM(outcome, outcome_exog, family=sm.families.Binomial(link=probit))
    >>> mediator = np.asarray(data["emo"])
    >>> mediator_exog = patsy.dmatrix("treat + age + educ + gender + income", data,
                                 return_type='dataframe')
    >>> mediator_model = sm.OLS(mediator, mediator_exog)
    >>> tx_pos = [outcome_exog.columns.tolist().index("treat"),
    >>>           mediator_exog.columns.tolist().index("treat")]
    >>> med_pos = outcome_exog.columns.tolist().index("emo")
    >>> med = Mediation(outcome_model, mediator_model, tx_pos, med_pos).fit()
    >>> med.summary()

    A moderated mediation analysis.  The mediation effect is computed
    for people of age 20.

    >>> fml = "cong_mesg ~ emo + treat*age + emo*age + educ + gender + income",
    >>> outcome_model = sm.GLM.from_formula(fml, data,
    >>>                                     family=sm.families.Binomial())
    >>> mediator_model = sm.OLS.from_formula("emo ~ treat*age + educ + gender + income", data)
    >>> moderators = {"age" : 20}
    >>> med = Mediation(outcome_model, mediator_model, "treat", "emo",
                        moderators=moderators).fit()

    References
    ----------
    Imai, Keele, Tingley (2010).  A general approach to causal mediation
    analysis. Psychological Methods 15:4, 309-334.
    http://imai.princeton.edu/research/files/BaronKenny.pdf

    Tingley, Yamamoto, Hirose, Keele, Imai (2014).  mediation : R
    package for causal mediation analysis.  Journal of Statistical
    Software 59:5.  http://www.jstatsoft.org/v59/i05/paper
     __init__ N/A N/A self outcome_model mediator_model exposure mediator moderators outcome_fit_kwargs mediator_fit_kwargs N/A None None None None N/A N/A N/A self outcome_model outcome_model N/A N/A self mediator_model mediator_model N/A N/A self exposure exposure N/A N/A self moderators N/A N/A moderators None moderators N/A N/A N/A mediator None N/A N/A N/A self mediator N/A N/A self _guess_endog_name mediator_model mediator N/A N/A N/A self mediator mediator N/A N/A self _outcome_fit_kwargs N/A N/A outcome_fit_kwargs None outcome_fit_kwargs N/A N/A N/A self _mediator_fit_kwargs N/A N/A mediator_fit_kwargs None mediator_fit_kwargs N/A N/A N/A self _outcome_exog N/A N/A N/A outcome_model exog copy N/A N/A self _mediator_exog N/A N/A N/A mediator_model exog copy N/A N/A self _exp_pos_mediator N/A N/A self _variable_pos exposure mediator N/A N/A self _exp_pos_outcome N/A N/A self _variable_pos exposure outcome N/A N/A self _med_pos_outcome N/A N/A self _variable_pos mediator outcome N/A _variable_pos N/A N/A self var model N/A N/A N/A N/A model mediator N/A N/A mod N/A self mediator_model N/A N/A mod N/A self outcome_model N/A N/A var mediator N/A N/A N/A N/A maybe_name_or_idx N/A self mediator mod N/A 1 N/A exp N/A self exposure N/A exp_is_2 N/A N/A N/A len exp 2 N/A N/A type exp N/A type N/A exp_is_2 N/A N/A N/A model outcome N/A N/A N/A exp N/A 0 N/A N/A N/A model mediator N/A N/A N/A exp N/A 1 N/A N/A N/A N/A maybe_name_or_idx exp mod N/A 1 N/A _guess_endog_name N/A N/A self model typ N/A N/A N/A N/A hasattr model formula N/A N/A N/A N/A N/A N/A N/A N/A model formula split ~ N/A 0 strip N/A N/A N/A ValueError N/A cannot infer %s name without formula typ N/A _simulate_params N/A N/A self result N/A N/A N/A 
        Simulate model parameters from fitted sampling distribution.
         N/A mn N/A result params N/A cov N/A N/A result cov_params N/A N/A N/A N/A np random multivariate_normal mn cov N/A _get_mediator_exog N/A N/A self exposure N/A N/A N/A 
        Return the mediator exog matrix with exposure set to the given
        value.  Set values of moderated variables as needed.
         N/A mediator_exog N/A self _mediator_exog N/A N/A N/A hasattr N/A self mediator_model formula N/A N/A N/A mediator_exog N/A N/A N/A N/A self _exp_pos_mediator exposure N/A ix N/A self moderators N/A N/A v N/A N/A self moderators N/A ix N/A N/A mediator_exog N/A N/A N/A N/A ix N/A 1 v N/A N/A df N/A N/A N/A N/A N/A self mediator_model data frame copy N/A N/A N/A df loc N/A N/A N/A N/A self exposure exposure N/A vname N/A self moderators N/A N/A v N/A N/A self moderators N/A vname N/A N/A N/A df loc N/A N/A N/A vname v N/A klass N/A N/A self mediator_model __class__ N/A init_kwargs N/A N/A N/A self mediator_model _get_init_kwds N/A model N/A N/A klass from_formula data df init_kwargs N/A mediator_exog N/A model exog N/A mediator_exog N/A _get_outcome_exog N/A N/A self exposure mediator N/A N/A N/A 
        Retun the exog design matrix with mediator and exposure set to
        the given values.  Set values of moderated variables as
        needed.
         N/A outcome_exog N/A self _outcome_exog N/A N/A N/A hasattr N/A self outcome_model formula N/A N/A N/A outcome_exog N/A N/A N/A N/A self _med_pos_outcome mediator N/A N/A outcome_exog N/A N/A N/A N/A self _exp_pos_outcome exposure N/A ix N/A self moderators N/A N/A v N/A N/A self moderators N/A ix N/A N/A outcome_exog N/A N/A N/A N/A ix N/A 0 v N/A N/A df N/A N/A N/A N/A N/A self outcome_model data frame copy N/A N/A N/A df loc N/A N/A N/A N/A self exposure exposure N/A N/A N/A df loc N/A N/A N/A N/A self mediator mediator N/A vname N/A self moderators N/A N/A v N/A N/A self moderators N/A vname N/A N/A N/A df loc N/A N/A N/A vname v N/A klass N/A N/A self outcome_model __class__ N/A init_kwargs N/A N/A N/A self outcome_model _get_init_kwds N/A model N/A N/A klass from_formula data df init_kwargs N/A outcome_exog N/A model exog N/A outcome_exog N/A _fit_model N/A N/A self model fit_kwargs boot N/A False N/A N/A klass N/A model __class__ N/A init_kwargs N/A N/A model _get_init_kwds N/A endog N/A model endog N/A exog N/A model exog N/A boot N/A N/A ii N/A N/A N/A np random randint 0 N/A len endog N/A len endog N/A endog N/A endog N/A ii N/A exog N/A exog N/A N/A ii N/A N/A outcome_model N/A klass endog exog init_kwargs N/A N/A N/A outcome_model fit fit_kwargs N/A fit N/A N/A self method n_rep N/A parametric 1000 N/A N/A 
        Fit a regression model to assess mediation.

        Arguments
        ---------
        method : string
            Either 'parametric' or 'bootstrap'.
        n_rep : integer
            The number of simulation replications.

        Returns a MediationResults object.
         N/A N/A N/A method startswith para N/A N/A outcome_result N/A N/A self _fit_model N/A self outcome_model N/A self _outcome_fit_kwargs N/A mediator_result N/A N/A self _fit_model N/A self mediator_model N/A self _mediator_fit_kwargs N/A N/A N/A N/A N/A method startswith boot N/A N/A method must be either 'parametric' or 'bootstrap' N/A indirect_effects N/A N/A N/A N/A direct_effects N/A N/A N/A N/A iter N/A range n_rep N/A N/A N/A method parametric N/A N/A outcome_params N/A N/A self _simulate_params outcome_result N/A mediation_params N/A N/A self _simulate_params mediator_result N/A N/A outcome_result N/A N/A self _fit_model N/A self outcome_model N/A self _outcome_fit_kwargs boot True N/A outcome_params N/A outcome_result params N/A mediator_result N/A N/A self _fit_model N/A self mediator_model N/A self _mediator_fit_kwargs boot True N/A mediation_params N/A mediator_result params N/A predicted_outcomes N/A N/A None None N/A None None N/A tm N/A 0 1 N/A N/A mex N/A N/A self _get_mediator_exog tm N/A gen N/A N/A N/A self mediator_model get_distribution mediation_params N/A mediator_result scale exog mex N/A potential_mediator N/A N/A gen rvs N/A N/A mex shape N/A 0 N/A te N/A 0 1 N/A N/A oex N/A N/A self _get_outcome_exog te potential_mediator N/A po N/A N/A N/A self outcome_model predict outcome_params oex N/A N/A N/A predicted_outcomes N/A tm N/A te po N/A t N/A 0 1 N/A N/A N/A N/A N/A indirect_effects N/A t append N/A N/A N/A predicted_outcomes N/A 1 N/A t N/A N/A predicted_outcomes N/A 0 N/A t N/A N/A N/A N/A direct_effects N/A t append N/A N/A N/A predicted_outcomes N/A t N/A 1 N/A N/A predicted_outcomes N/A t N/A 0 N/A t N/A 0 1 N/A N/A N/A indirect_effects N/A t N/A N/A N/A np asarray N/A indirect_effects N/A t T N/A N/A direct_effects N/A t N/A N/A N/A np asarray N/A direct_effects N/A t T N/A N/A self indirect_effects indirect_effects N/A N/A self direct_effects direct_effects N/A rslt N/A MediationResults N/A self indirect_effects N/A self direct_effects N/A N/A rslt method method N/A rslt N/A N/A _pvalue N/A N/A vec N/A N/A N/A N/A N/A 2 N/A min N/A sum N/A vec 0 N/A sum N/A vec 0 N/A float N/A len vec N/A MediationResults N/A object N/A N/A 
    A class for holding the results of a mediation analysis.

    The following terms are used in the summary output:

    ACME : average causal mediated effect
    ADE : average direct effect
     __init__ N/A N/A self indirect_effects direct_effects N/A N/A N/A N/A self indirect_effects indirect_effects N/A N/A self direct_effects direct_effects N/A indirect_effects_avg N/A None None N/A direct_effects_avg N/A None None N/A t N/A 0 1 N/A N/A N/A indirect_effects_avg N/A t N/A N/A N/A indirect_effects N/A t mean 0 N/A N/A direct_effects_avg N/A t N/A N/A N/A direct_effects N/A t mean 0 N/A N/A self ACME_ctrl N/A indirect_effects_avg N/A 0 N/A N/A self ACME_tx N/A indirect_effects_avg N/A 1 N/A N/A self ADE_ctrl N/A direct_effects_avg N/A 0 N/A N/A self ADE_tx N/A direct_effects_avg N/A 1 N/A N/A self total_effect N/A N/A N/A N/A N/A self ACME_ctrl N/A self ACME_tx N/A self ADE_ctrl N/A self ADE_tx 2 N/A N/A self prop_med_ctrl N/A N/A self ACME_ctrl N/A self total_effect N/A N/A self prop_med_tx N/A N/A self ACME_tx N/A self total_effect N/A N/A self prop_med_avg N/A N/A N/A self prop_med_ctrl N/A self prop_med_tx 2 N/A N/A self ACME_avg N/A N/A N/A self ACME_ctrl N/A self ACME_tx 2 N/A N/A self ADE_avg N/A N/A N/A self ADE_ctrl N/A self ADE_tx 2 N/A summary N/A N/A self alpha N/A 0.05 N/A N/A 
        Provide a summary of a mediation analysis.
         N/A columns N/A Estimate Lower CI bound Upper CI bound P-value N/A index N/A ACME (control) ACME (treated) ADE (control) ADE (treated) Total effect Prop. mediated (control) Prop. mediated (treated) ACME (average) ADE (average) Prop. mediated (average) N/A smry N/A N/A pd DataFrame columns columns index index N/A N/A i vec N/A enumerate N/A N/A self ACME_ctrl N/A self ACME_tx N/A self ADE_ctrl N/A self ADE_tx N/A self total_effect N/A self prop_med_ctrl N/A self prop_med_tx N/A self ACME_avg N/A self ADE_avg N/A self prop_med_avg N/A N/A N/A N/A vec N/A self prop_med_ctrl N/A vec N/A self prop_med_tx N/A vec N/A self prop_med_avg N/A N/A N/A N/A smry iloc N/A N/A i 0 N/A N/A np median vec N/A N/A N/A N/A smry iloc N/A N/A i 0 N/A N/A vec mean N/A N/A N/A smry iloc N/A N/A i 1 N/A N/A np percentile vec N/A N/A 100 alpha 2 N/A N/A N/A smry iloc N/A N/A i 2 N/A N/A np percentile vec N/A 100 N/A 1 N/A alpha 2 N/A N/A N/A smry iloc N/A N/A i 3 N/A _pvalue vec N/A N/A N/A pdc version 0.17.0 N/A N/A smry N/A N/A smry convert_objects convert_numeric True N/A N/A smry N/A N/A smry apply N/A pd to_numeric errors coerce N/A smry N/A N/A