Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions doubleml/rdd/datasets/simple_dgp.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
-------
Expand All @@ -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
Expand All @@ -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
Expand Down
11 changes: 10 additions & 1 deletion doubleml/rdd/rdd.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."

Expand Down