diff_diff.RDDensityTestResult#

class diff_diff.RDDensityTestResult[source]#

Bases: Diagnostic

Results of the CJM 2020 manipulation (density-discontinuity) test.

The headline t_stat/p_value are the ROBUST BIAS-CORRECTED test (order-q density estimators at order-p-optimal bandwidths), with the standard error selected by vcov_type - when q > p; a fit with q == p makes the headline the CONVENTIONAL (uncorrected) test, which over-rejects at data-driven bandwidths (see the estimator class docstring). The *_conventional fields carry the same caveat. The f_* fields are WHOLE-SAMPLE-scale densities exactly as R’s hat$left/right/diff report them (joint-basis estimates). Per-side CONDITIONAL densities are these times (N-1)/(n_left-1) and (N-1)/(n_right-1) - the exact conversion under the rank-based EDF (0:(N-1))/(N-1) that R (and this port) implement; the CJM 2020 paper’s n/n_side factors apply to the paper’s (1/n)*sum EDF, which is not what R computes.

There are deliberately no att/se/conf_int fields: R rddensity reports no confidence interval anywhere in its output (intervals belong to rdplotdensity), and the estimand vocabulary of the treatment-effect estimators does not apply to a density test.

Methods

__init__(t_stat, p_value, f_left, f_right, ...)

summary()

R-style summary block.

to_dataframe()

Tidy per-side table: rows left/right/diff (plus the *_conventional rows when report_all=True); columns estimate/se/t_stat/p_value (inference populated on the diff rows only).

Attributes

t_stat

p_value

f_left

f_right

f_diff

se_left

se_right

se_diff

f_left_conventional

f_right_conventional

f_diff_conventional

se_left_conventional

se_right_conventional

se_diff_conventional

t_stat_conventional

p_value_conventional

n

n_left

n_right

n_eff_left

n_eff_right

h_left

h_right

bandwidths

cutoff

p

q

fitselect

kernel

vcov_type

bwselect

bandwidth_method

masspoints

masspoints_adjusted

regularize

n_local_min

n_unique_min

report_all

__init__(t_stat, p_value, f_left, f_right, f_diff, se_left, se_right, se_diff, f_left_conventional, f_right_conventional, f_diff_conventional, se_left_conventional, se_right_conventional, se_diff_conventional, t_stat_conventional, p_value_conventional, n, n_left, n_right, n_eff_left, n_eff_right, h_left, h_right, bandwidths, cutoff, p, q, fitselect, kernel, vcov_type, bwselect, bandwidth_method, masspoints, masspoints_adjusted, regularize, n_local_min, n_unique_min, report_all)#
Parameters:
Return type:

None

classmethod __new__(*args, **kwargs)#