@@ -543,18 +543,19 @@ class RegressionDiscontinuity(ExperimentalDesign):
543543 """
544544 A class to analyse regression discontinuity experiments.
545545
546- :param data: A pandas dataframe
547- :param formula: A statistical model formula
548- :param treatment_threshold: A scalar threshold value at which the treatment
549- is applied
550- :param model: A PyMC model
551- :param running_variable_name: The name of the predictor variable that the treatment
552- threshold is based upon
553-
554- .. note::
555-
556- There is no pre/post intervention data distinction for the regression
557- discontinuity design, we fit all the data available.
546+ :param data:
547+ A pandas dataframe
548+ :param formula:
549+ A statistical model formula
550+ :param treatment_threshold:
551+ A scalar threshold value at which the treatment is applied
552+ :param model:
553+ A PyMC model
554+ :param running_variable_name:
555+ The name of the predictor variable that the treatment threshold is based upon
556+ :param epsilon:
557+ A small scalar value which determines how far above and below the treatment
558+ threshold to evaluate the causal impact.
558559 """
559560
560561 def __init__ (
@@ -564,6 +565,7 @@ def __init__(
564565 treatment_threshold : float ,
565566 model = None ,
566567 running_variable_name : str = "x" ,
568+ epsilon : float = 0.001 ,
567569 ** kwargs ,
568570 ):
569571 super ().__init__ (model = model , ** kwargs )
@@ -572,6 +574,7 @@ def __init__(
572574 self .formula = formula
573575 self .running_variable_name = running_variable_name
574576 self .treatment_threshold = treatment_threshold
577+ self .epsilon = epsilon
575578 self ._input_validation ()
576579
577580 y , X = dmatrices (formula , self .data )
@@ -609,7 +612,10 @@ def __init__(
609612 self .x_discon = pd .DataFrame (
610613 {
611614 self .running_variable_name : np .array (
612- [self .treatment_threshold - 0.001 , self .treatment_threshold + 0.001 ]
615+ [
616+ self .treatment_threshold - self .epsilon ,
617+ self .treatment_threshold + self .epsilon ,
618+ ]
613619 ),
614620 "treated" : np .array ([0 , 1 ]),
615621 }
0 commit comments