PrePostFit#

class causalpy.skl_experiments.PrePostFit[source]#

A class to analyse quasi-experiments where parameter estimation is based on just the pre-intervention data.

Parameters:
  • data – A pandas data frame

  • treatment_time – The index or time value of when treatment begins

  • formula – A statistical model formula

  • model – An scikit-learn model object

Methods

PrePostFit.__init__(data, treatment_time, ...)

PrePostFit.get_coeffs()

Returns model coefficients

PrePostFit.plot([counterfactual_label, round_to])

Plot experiment results

PrePostFit.plot_coeffs()

Plots coefficient bar plot

PrePostFit.print_coefficients([round_to])

Prints the model coefficients

PrePostFit.summary([round_to])

Print text output summarising the results

Attributes

expt_type

model

outcome_variable_name

__init__(data, treatment_time, formula, model=None, **kwargs)[source]#
__new__(*args, **kwargs)#