|
28 | 28 |
|
29 | 29 |
|
30 | 30 | class DoubleMLDIDCSBinary(LinearScoreMixin, DoubleML):
|
| 31 | + """Double machine learning for difference-in-differences models with repeated cross sections (binary setting in terms of group and time |
| 32 | + combinations). |
| 33 | +
|
| 34 | + Parameters |
| 35 | + ---------- |
| 36 | + obj_dml_data : :class:`DoubleMLPanelData` object |
| 37 | + The :class:`DoubleMLPanelData` object providing the data and specifying the variables for the causal model. |
| 38 | +
|
| 39 | + g_value : int |
| 40 | + The value indicating the treatment group (first period with treatment). |
| 41 | + Default is ``None``. This implements the case for the smallest, non-zero value of G. |
| 42 | +
|
| 43 | + t_value_pre : int |
| 44 | + The value indicating the baseline pre-treatment period. |
| 45 | +
|
| 46 | + t_value_eval : int |
| 47 | + The value indicating the period for evaluation. |
| 48 | +
|
| 49 | + ml_g : estimator implementing ``fit()`` and ``predict()`` |
| 50 | + A machine learner implementing ``fit()`` and ``predict()`` methods (e.g. |
| 51 | + :py:class:`sklearn.ensemble.RandomForestRegressor`) for the nuisance function :math:`g_0(d,X) = E[Y_1-Y_0|D=d, X]`. |
| 52 | + For a binary outcome variable :math:`Y` (with values 0 and 1), a classifier implementing ``fit()`` and |
| 53 | + ``predict_proba()`` can also be specified. If :py:func:`sklearn.base.is_classifier` returns ``True``, |
| 54 | + ``predict_proba()`` is used otherwise ``predict()``. |
| 55 | +
|
| 56 | + ml_m : classifier implementing ``fit()`` and ``predict_proba()`` |
| 57 | + A machine learner implementing ``fit()`` and ``predict_proba()`` methods (e.g. |
| 58 | + :py:class:`sklearn.ensemble.RandomForestClassifier`) for the nuisance function :math:`m_0(X) = E[D=1|X]`. |
| 59 | + Only relevant for ``score='observational'``. |
| 60 | +
|
| 61 | + control_group : str |
| 62 | + Specifies the control group. Either ``'never_treated'`` or ``'not_yet_treated'``. |
| 63 | + Default is ``'never_treated'``. |
| 64 | +
|
| 65 | + anticipation_periods : int |
| 66 | + Number of anticipation periods. Default is ``0``. |
| 67 | +
|
| 68 | + n_folds : int |
| 69 | + Number of folds. |
| 70 | + Default is ``5``. |
| 71 | +
|
| 72 | + n_rep : int |
| 73 | + Number of repetitions for the sample splitting. |
| 74 | + Default is ``1``. |
| 75 | +
|
| 76 | + score : str |
| 77 | + A str (``'observational'`` or ``'experimental'``) specifying the score function. |
| 78 | + The ``'experimental'`` scores refers to an A/B setting, where the treatment is independent |
| 79 | + from the pretreatment covariates. |
| 80 | + Default is ``'observational'``. |
| 81 | +
|
| 82 | + in_sample_normalization : bool |
| 83 | + Indicates whether to use a slightly different normalization from Sant'Anna and Zhao (2020). |
| 84 | + Default is ``True``. |
| 85 | +
|
| 86 | + trimming_rule : str |
| 87 | + A str (``'truncate'`` is the only choice) specifying the trimming approach. |
| 88 | + Default is ``'truncate'``. |
| 89 | +
|
| 90 | + trimming_threshold : float |
| 91 | + The threshold used for trimming. |
| 92 | + Default is ``1e-2``. |
| 93 | +
|
| 94 | + draw_sample_splitting : bool |
| 95 | + Indicates whether the sample splitting should be drawn during initialization of the object. |
| 96 | + Default is ``True``. |
| 97 | +
|
| 98 | + print_periods : bool |
| 99 | + Indicates whether to print information about the evaluated periods. |
| 100 | + Default is ``False``. |
| 101 | +
|
| 102 | + """ |
31 | 103 |
|
32 | 104 | def __init__(
|
33 | 105 | self,
|
|
0 commit comments