@@ -1496,7 +1496,7 @@ class InversePropensityWeighting(ExperimentalDesign, PropensityDataValidator):
14961496 A string denoting which weighting scheme to use among: 'raw', 'robust',
14971497 'doubly robust' or 'overlap'. See Aronow and Miller "Foundations
14981498 of Agnostic Statistics" for discussion and computation of these
1499- weighting schemes.
1499+ weighting schemes.
15001500 :param model:
15011501 A PyMC model
15021502
@@ -1550,9 +1550,9 @@ def __init__(
15501550 self .model .fit (X = self .X , t = self .t , coords = COORDS )
15511551
15521552 def make_robust_adjustments (self , ps ):
1553- """ This estimator is discussed in Aronow
1554- and Miller's book as being related to the
1555- Horvitz Thompson method """
1553+ """This estimator is discussed in Aronow
1554+ and Miller's book as being related to the
1555+ Horvitz Thompson method"""
15561556 X = pd .DataFrame (self .X , columns = self .labels )
15571557 X ["ps" ] = ps
15581558 X [self .outcome_variable ] = self .y
@@ -1570,8 +1570,8 @@ def make_robust_adjustments(self, ps):
15701570 return weighted_outcome0 , weighted_outcome1 , n_ntrt , n_trt
15711571
15721572 def make_raw_adjustments (self , ps ):
1573- """ This estimator is discussed in Aronow and
1574- Miller as the simplest of base form of
1573+ """This estimator is discussed in Aronow and
1574+ Miller as the simplest of base form of
15751575 inverse propensity weighting schemes"""
15761576 X = pd .DataFrame (self .X , columns = self .labels )
15771577 X ["ps" ] = ps
@@ -1589,10 +1589,10 @@ def make_raw_adjustments(self, ps):
15891589 return weighted_outcome0 , weighted_outcome1 , n_ntrt , n_trt
15901590
15911591 def make_overlap_adjustments (self , ps ):
1592- """This weighting scheme was adapted from
1593- Lucy D’Agostino McGowan's blog on
1594- Propensity Score Weights referenced in
1595- the primary CausalPy explainer notebook"""
1592+ """This weighting scheme was adapted from
1593+ Lucy D’Agostino McGowan's blog on
1594+ Propensity Score Weights referenced in
1595+ the primary CausalPy explainer notebook"""
15961596 X = pd .DataFrame (self .X , columns = self .labels )
15971597 X ["ps" ] = ps
15981598 X [self .outcome_variable ] = self .y
@@ -1609,7 +1609,7 @@ def make_overlap_adjustments(self, ps):
16091609 return weighted_outcome0 , weighted_outcome1 , n_ntrt , n_trt
16101610
16111611 def make_doubly_robust_adjustment (self , ps ):
1612- """ The doubly robust weighting scheme is also
1612+ """The doubly robust weighting scheme is also
16131613 discussed in Aronow and Miller, but a bit more generally
16141614 than our implementation here. Here we have specified
16151615 the outcome model to be a simple OLS model.
@@ -1740,7 +1740,8 @@ def make_hists(idata, i, axs, method=method):
17401740 0.9 , linestyle = "--" , label = "Hi Extreme Propensity Scores" , color = "black"
17411741 )
17421742 axs [0 ].set_title (
1743- "Weighted and Unweighted Draws from the Posterior \n Propensity Scores Distribution" , fontsize = 20
1743+ "Weighted and Unweighted Draws from the Posterior \n Propensity Scores Distribution" ,
1744+ fontsize = 20 ,
17441745 )
17451746 axs [0 ].set_ylabel ("Counts of Observations" )
17461747 axs [0 ].set_xlabel ("Propensity Scores" )
0 commit comments