PrePostFit#
- class causalpy.pymc_experiments.PrePostFit[source]#
A class to analyse quasi-experiments where parameter estimation is based on just the pre-intervention data.
- Parameters:
data (
DataFrame
) – A pandas dataframetreatment_time (
Union
[int
,float
,Timestamp
]) – The time when treatment occured, should be in reference to the data indexvalidation_time – Optional time to split the data into training and validation data sets
formula (
str
) – A statistical model formulamodel – A PyMC model
Methods
PrePostFit.__init__
(data, treatment_time, ...)PrePostFit.plot
([counterfactual_label, round_to])Plot the results
PrePostFit.print_coefficients
([round_to])Prints the model coefficients
PrePostFit.summary
([round_to])Print text output summarising the results
Attributes
expt_type
idata
Access to the models InferenceData object
model
- __new__(*args, **kwargs)#