File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -307,6 +307,9 @@ def __init__(
307
307
terms = [treatment ] + sorted (list (adjustment_set )) + sorted (list (effect_modifiers ))
308
308
self .formula = f"{ outcome } ~ { '+' .join (terms )} "
309
309
310
+ for term in self .effect_modifiers :
311
+ self .adjustment_set .add (term )
312
+
310
313
def add_modelling_assumptions (self ):
311
314
"""
312
315
Add modelling assumptions to the estimator. This is a list of strings which list the modelling assumptions that
@@ -332,7 +335,7 @@ def estimate_coefficient(self) -> float:
332
335
treatment = design_info .column_names [design_info .term_name_slices [self .treatment ]]
333
336
assert set (treatment ).issubset (
334
337
model .params .index .tolist ()
335
- ), f"{ treatment } not in\n { ' ' + str (model .params .index ).replace (newline , newline + ' ' )} "
338
+ ), f"{ treatment } not in\n { ' ' + str (model .params .index ).replace (newline , newline + ' ' )} "
336
339
unit_effect = model .params [treatment ] # Unit effect is the coefficient of the treatment
337
340
[ci_low , ci_high ] = self ._get_confidence_intervals (model , treatment )
338
341
if str (self .df .dtypes [self .treatment ]) != "object" :
You can’t perform that action at this time.
0 commit comments