diff_diff.RDDensityTestResult#
- class diff_diff.RDDensityTestResult[source]#
Bases:
DiagnosticResults of the CJM 2020 manipulation (density-discontinuity) test.
The headline
t_stat/p_valueare the ROBUST BIAS-CORRECTED test (order-qdensity estimators at order-p-optimal bandwidths), with the standard error selected byvcov_type- whenq > p; a fit withq == pmakes the headline the CONVENTIONAL (uncorrected) test, which over-rejects at data-driven bandwidths (see the estimator class docstring). The*_conventionalfields carry the same caveat. Thef_*fields are WHOLE-SAMPLE-scale densities exactly as R’shat$left/right/diffreport 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’sn/n_sidefactors apply to the paper’s(1/n)*sumEDF, which is not what R computes.There are deliberately no
att/se/conf_intfields: Rrddensityreports no confidence interval anywhere in its output (intervals belong tordplotdensity), 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*_conventionalrows whenreport_all=True); columnsestimate/se/t_stat/p_value(inference populated on thediffrows only).Attributes
t_statp_valuef_leftf_rightf_diffse_leftse_rightse_difff_left_conventionalf_right_conventionalf_diff_conventionalse_left_conventionalse_right_conventionalse_diff_conventionalt_stat_conventionalp_value_conventionalnn_leftn_rightn_eff_leftn_eff_righth_lefth_rightbandwidthscutoffpqfitselectkernelvcov_typebwselectbandwidth_methodmasspointsmasspoints_adjustedregularizen_local_minn_unique_minreport_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:
t_stat (float)
p_value (float)
f_left (float)
f_right (float)
f_diff (float)
se_left (float)
se_right (float)
se_diff (float)
f_left_conventional (float | None)
f_right_conventional (float | None)
f_diff_conventional (float | None)
se_left_conventional (float | None)
se_right_conventional (float | None)
se_diff_conventional (float | None)
t_stat_conventional (float | None)
p_value_conventional (float | None)
n (int)
n_left (int)
n_right (int)
n_eff_left (int)
n_eff_right (int)
h_left (float)
h_right (float)
bandwidths (DataFrame | None)
cutoff (float)
p (int)
q (int)
fitselect (str)
kernel (str)
vcov_type (str)
bwselect (str)
bandwidth_method (str)
masspoints (str)
masspoints_adjusted (bool)
regularize (bool)
n_local_min (int)
n_unique_min (int)
report_all (bool)
- Return type:
None
- classmethod __new__(*args, **kwargs)#