diff_diff.StuteTestResults#

class diff_diff.StuteTestResults[source]#

Bases: object

Result of stute_test() (paper Appendix D).

The Stute test rejects the null that E[ΔY | D_2] is linear in D_2 (paper Assumption 8) when the sorted-residual CvM statistic S = (1/G^2) Σ (Σ_{h=1}^g eps_{(h)})^2 exceeds the Mammen wild bootstrap 1 - alpha quantile.

cvm_stat#

CvM statistic. NaN when G < 10 (below the threshold the statistic is not well-calibrated).

Type:

float

p_value#

Bootstrap p-value (1 + sum(S_b >= S)) / (B + 1). NaN when the statistic is NaN.

Type:

float

reject#

True iff p_value <= alpha. False on NaN.

Type:

bool

alpha#

Significance level used.

Type:

float

n_bootstrap#

Number of Mammen wild bootstrap replications.

Type:

int

n_obs#

Number of observations.

Type:

int

seed#

Seed passed to np.random.default_rng. None when unseeded.

Type:

int or None

Methods

__init__(cvm_stat, p_value, reject, alpha, ...)

print_summary()

Print the summary to stdout.

summary()

Formatted summary table.

to_dataframe()

Return a one-row DataFrame of the result dict.

to_dict()

Return results as a JSON-safe dict.

Attributes

__init__(cvm_stat, p_value, reject, alpha, n_bootstrap, n_obs, seed)#
Parameters:
Return type:

None

classmethod __new__(*args, **kwargs)#