InversePropensityWeighting#
- class causalpy.pymc_experiments.InversePropensityWeighting[source]#
A class to analyse inverse propensity weighting experiments.
- Parameters:
- :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.
This weighting scheme was adapted from Lucy D’Agostino McGowan's blog on Propensity Score Weights referenced in the primary CausalPy explainer notebook
This estimator is discussed in Aronow and Miller as the simplest of base form of inverse propensity weighting schemes
This estimator is discussed in Aronow and Miller's book as being related to the Horvitz Thompson method
InversePropensityWeighting.plot_ATE
([idata, ...])Plotting function takes a single covariate and shows the differences in the ECDF between the treatment and control groups before and after weighting.
Prints the model coefficients
perc : percentile in [0-1]!
Attributes
expt_type
idata
Access to the models InferenceData object
model
- __new__(*args, **kwargs)#