DifferenceInDifferences#

class causalpy.pymc_experiments.DifferenceInDifferences[source]#

A class to analyse data from Difference in Difference settings.

Note

There is no pre/post intervention data distinction for DiD, we fit all the data available.

Parameters:
  • data (DataFrame) – A pandas dataframe

  • formula (str) – A statistical model formula

  • time_variable_name (str) – Name of the data column for the time variable

  • group_variable_name (str) – Name of the data column for the group variable

  • model – A PyMC model for difference in differences

Methods

DifferenceInDifferences.__init__(data, ...)

DifferenceInDifferences.plot([round_to])

Plot the results.

DifferenceInDifferences.print_coefficients([...])

Prints the model coefficients

DifferenceInDifferences.summary([round_to])

Print text output summarising the results.

Attributes

expt_type

idata

Access to the models InferenceData object

model

__init__(data, formula, time_variable_name, group_variable_name, model=None, **kwargs)[source]#
Parameters:
__new__(*args, **kwargs)#