diff_diff.YatchewTestResults#
- class diff_diff.YatchewTestResults[source]#
Bases:
objectResult of
yatchew_hr_test()(paper Theorem 7 / Equation 29).Heteroskedasticity-robust specification test using Yatchew’s difference-based variance estimator. Two nulls are supported via the
null=argument onyatchew_hr_test()and reflected on thenull_formattribute below:"linearity"(default; paper Theorem 7, the same null asstute_test(), residuals from OLSdy ~ 1 + d) and"mean_independence"(R-parity extension mirroring RYatchewTest::yatchew_test(order=0), residuals from intercept-only OLSdy ~ 1). The test statisticT_hr = sqrt(G) * (sigma2_lin - sigma2_diff) / sigma2_Wis asymptotically N(0, 1) under H_0 in both modes; rejection uses the one-sided standard-normal critical value. Only the residual definition (and thereforesigma2_lin) differs between modes — thesigma2_diff/sigma2_W/ sort-by-dmachinery is shared.- sigma2_lin#
Residual variance under the chosen null. Under
null_form="linearity": residual variance from OLS ofdyond. Undernull_form="mean_independence":(1/G) * sum((dy - mean(dy))^2), the population variance ofdy.- Type:
- sigma2_diff#
Yatchew differencing variance
(1 / (2G)) * sum((dy_{(g)} - dy_{(g-1)})^2)- divisor is2G(paper-literal), NOT2(G-1).- Type:
- sigma2_W#
Heteroskedasticity-robust scale
sqrt((1 / (G-1)) * sum(eps_{(g)}^2 * eps_{(g-1)}^2)).- Type:
- null_form#
"linearity"(default; H_0:E[dY|D]is linear inD, residuals from OLSdy ~ 1 + d) or"mean_independence"(H_0:E[dY|D] = E[dY], residuals from intercept-only OLSdy ~ 1). Mirrors RYatchewTest::yatchew_test’sorderargument (order=1↔"linearity";order=0↔"mean_independence").- Type:
Methods
__init__(t_stat_hr, 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__(t_stat_hr, p_value, reject, alpha, critical_value, sigma2_lin, sigma2_diff, sigma2_W, n_obs, null_form='linearity')#
- classmethod __new__(*args, **kwargs)#