RegressionDiscontinuity#
- class causalpy.skl_experiments.RegressionDiscontinuity[source]#
A class to analyse sharp regression discontinuity experiments.
- Parameters:
data – A pandas dataframe
formula – A statistical model formula
treatment_threshold – A scalar threshold value at which the treatment is applied
model – A sci-kit learn model object
running_variable_name – The name of the predictor variable that the treatment threshold is based upon
epsilon (
float) – A small scalar value which determines how far above and below the treatment threshold to evaluate the causal impact.bandwidth (
Optional[float]) – Data outside of the bandwidth (relative to the discontinuity) is not used to fit the model.
Methods
RegressionDiscontinuity.__init__(data, ...)RegressionDiscontinuity.plot([round_to])Plot results
Prints the model coefficients
RegressionDiscontinuity.summary([round_to])Print text output summarising the results
Attributes
expt_typemodeloutcome_variable_name- __init__(data, formula, treatment_threshold, model=None, running_variable_name='x', epsilon=0.001, bandwidth=None, **kwargs)[source]#
- __new__(*args, **kwargs)#