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 dataframe

  • treatment_time (Union[int, float, Timestamp]) – The time when treatment occured, should be in reference to the data index

  • validation_time – Optional time to split the data into training and validation data sets

  • formula (str) – A statistical model formula

  • model – 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

__init__(data, treatment_time, formula, validation_time=None, model=None, **kwargs)[source]#
Parameters:
Return type:

None

__new__(*args, **kwargs)#