InversePropensityWeighting#

class causalpy.pymc_experiments.InversePropensityWeighting[source]#

A class to analyse inverse propensity weighting experiments.

Parameters:
  • data (DataFrame) – A pandas dataframe

  • formula (str) – A statistical model formula for the propensity model

:param outcome_variable

A string denoting the outcome variable in datq to be reweighted

Parameters:
  • weighting_scheme (str) – A string denoting which weighting scheme to use among: ‘raw’, ‘robust’, ‘doubly robust’ or ‘overlap’. See Aronow and Miller “Foundations of Agnostic Statistics” for discussion and computation of these weighting schemes.

  • model – A PyMC model

Methods

InversePropensityWeighting.__init__(data, ...)

InversePropensityWeighting.get_ate(i, idata)

InversePropensityWeighting.make_doubly_robust_adjustment(ps)

The doubly robust weighting scheme is also discussed in Aronow and Miller, but a bit more generally than our implementation here.

InversePropensityWeighting.make_overlap_adjustments(ps)

This weighting scheme was adapted from Lucy D’Agostino McGowan's blog on Propensity Score Weights referenced in the primary CausalPy explainer notebook

InversePropensityWeighting.make_raw_adjustments(ps)

This estimator is discussed in Aronow and Miller as the simplest of base form of inverse propensity weighting schemes

InversePropensityWeighting.make_robust_adjustments(ps)

This estimator is discussed in Aronow and Miller's book as being related to the Horvitz Thompson method

InversePropensityWeighting.plot_ATE([idata, ...])

InversePropensityWeighting.plot_balance_ecdf(...)

Plotting function takes a single covariate and shows the differences in the ECDF between the treatment and control groups before and after weighting.

InversePropensityWeighting.print_coefficients([...])

Prints the model coefficients

InversePropensityWeighting.weighted_percentile(...)

perc : percentile in [0-1]!

Attributes

expt_type

idata

Access to the models InferenceData object

model

__init__(data, formula, outcome_variable, weighting_scheme, model=None, **kwargs)[source]#
Parameters:
__new__(*args, **kwargs)#