diff_diff.RDPlotResult#

class diff_diff.RDPlotResult[source]#

Bases: Diagnostic

Quantities of a data-driven RD plot (field names follow R’s rdplot return list; vars_bins columns carry R’s rdplot_* names).

J is always integral: a fractional scale * J product takes the ceiling per CCT 2015 Equation 2 (see the Deviation note in RDPlot - R 4.0.0 crashes on that surface instead). vars_bins contains only NON-EMPTY bins (R’s tapply semantics) while bin_avg/bin_med summarize ALL bin lengths of the partition. CI columns are always computed (at ci_level); ci_requested records whether ci= was passed and is the default for drawing error bars in plot().

Methods

__init__(coef, vars_bins, vars_poly, J, ...)

plot([ax, title, xlabel, ylabel, ...])

Render the RD plot (binned means, global polynomial curves, cutoff line; error bars when CIs were requested at fit time or forced via show_ci=True).

summary()

Formatted summary mirroring R's summary.rdplot layout (rdplot.R:610-654), including the implied scale and WIMSE weights.

to_dataframe()

The non-empty-bin table (vars_bins), copied.

Attributes

covariate_coefficients

covariates_dropped

wimse_bias_weight

Implied WIMSE bias weights rscale^3/(1 + rscale^3) per side.

wimse_variance_weight

Implied WIMSE variance weights 1/(1 + rscale^3) per side (CCT 2015 Supplement S.1; printed by R's summary.rdplot).

coef

vars_bins

vars_poly

J

J_IMSE

J_MV

scale

rscale

bin_avg

bin_med

p

cutoff

h

N

N_h

binselect

kernel_type

ci_level

ci_requested

__init__(coef, vars_bins, vars_poly, J, J_IMSE, J_MV, scale, rscale, bin_avg, bin_med, p, cutoff, h, N, N_h, binselect, kernel_type, ci_level, ci_requested, covariate_coefficients=None, covariates_dropped=None)#
Parameters:
Return type:

None

classmethod __new__(*args, **kwargs)#