diff --git a/doubleml/rdd/datasets/simple_dgp.py b/doubleml/rdd/datasets/simple_dgp.py index ff59b94da..aa386c985 100644 --- a/doubleml/rdd/datasets/simple_dgp.py +++ b/doubleml/rdd/datasets/simple_dgp.py @@ -34,7 +34,9 @@ def make_simple_rdd_data(n_obs=5000, p=4, fuzzy=True, binary_outcome=False, **kw dim_x : int The number of independent covariates. Default is 3. a : float - Factor to control interaction of score and covariates to the outcome equation. + Factor to control interaction of score and covariates to the outcome equation. Default is 0.0. + tau : float + Parameter to control the true effect in the generated data at the given cutoff. Default is 1.0. Returns ------- @@ -48,7 +50,8 @@ def make_simple_rdd_data(n_obs=5000, p=4, fuzzy=True, binary_outcome=False, **kw cutoff = kwargs.get('cutoff', 0.0) dim_x = kwargs.get('dim_x', 3) - a = kwargs.get('a', 0) + a = kwargs.get('a', 0.0) + tau = kwargs.get('tau', 1.0) score = np.random.normal(size=n_obs) # independent covariates @@ -62,7 +65,7 @@ def make_simple_rdd_data(n_obs=5000, p=4, fuzzy=True, binary_outcome=False, **kw g_cov = np.sum(covs, axis=1) g0 = 0.1 * score**2 - g1 = 1 + 0.1 * score**2 - 0.5 * score**2 + a * np.sum(X, axis=1) * score + g1 = tau + 0.1 * score**2 - 0.5 * score**2 + a * np.sum(X, axis=1) * score eps_scale = 0.2 # potential outcomes with independent errors diff --git a/doubleml/rdd/rdd.py b/doubleml/rdd/rdd.py index 23ff97630..0ea051fb9 100644 --- a/doubleml/rdd/rdd.py +++ b/doubleml/rdd/rdd.py @@ -166,7 +166,16 @@ def __str__(self): lines.append(line) result = "\n".join(lines) - return result + + additional_info = ( + "\nDesign Type: " + ("Fuzzy" if self.fuzzy else "Sharp") + + f"\nCutoff: {self.cutoff}" + + f"\nFirst Stage Kernel: {self.fs_kernel}" + + f"\nFinal Bandwidth: {self.h}" + ) + + return result + additional_info + else: return "DoubleML RDFlex Object. Run `.fit()` for estimation."