iRBCrd Stata 2.1: native validation against R 2.1
Report generated: 2026-10-28 15:42:12 CET
Executed with Stata/SE 18.0 on macOS.

PASS: native interface, design, bootstrap, and error-handling tests.
PASS: 420 cross-language cases; 381045 numerical values.
Largest absolute difference: 3.583267e-11
Largest abs(Stata-R)/(1+abs(R)): 1.641439e-12
Required scaled tolerance: 1e-7; missing-value patterns also matched.
PASS: 420 public-command checks; 154102 returned values.
Largest public-output/core difference: 0

Coverage of the comparison suite:
- Sharp, fuzzy, covariate-adjusted sharp, and covariate-adjusted fuzzy RD,
  each in levels and kinks; analytic and bootstrap inference.
- Sample/asymptotic Q, iRBC-HC0..HC3, CCT-HC0..HC3, and loo residuals.
- Fixed/bootstrap fuzzy and covariate weights in every applicable combination.
- Rademacher, Mammen, and normal multipliers; B=19 and B=999 cases.
- Kernel and bandwidth pairs, fast calculations, higher polynomial orders,
  shifted cutoffs, ties, binary treatment, and sparse-bandwidth regularization.
- Estimates, standard errors, confidence intervals, residuals, component
  covariance matrices, and retained bootstrap draws/weights where available.

Both programs received identical data and observation-level multipliers.
Identical numeric seeds alone do not match R and Stata bootstrap streams.
Agreement is established for these tests, not a proof for every possible input.

Fixes made during native validation:
- Lowercase declarations for underscore-containing Stata options.
- Valid Mata global initialization and a nonreserved bootstrap-mask name.
- Safe empty-cache-hit check for population kink constants.
The R implementation was not modified.

R reference MD5:
iRBC_functions.R 0cd3a0240aa62deaa84f0be6663b30a9
iRBCrd.R 9b09aa8c6879a207e76ee740f6ceece0

Validated Stata/test MD5:
irbcrd.ado 8691545b4f5b24613f9f7db719b0f812
irbcrd.mata 551674b7cf481fefbd9e100b51edd1fe
tests/run_tests.do 2ecd194a5aee0b7c9b9906aff1f38ee1
tests/prepare_reference.R ccf66d341cbe79bdebb4fc0408835efe
tests/compare_R.mata 99726930217cf05e763a855b5edce4c4
tests/compare_R.do 19e80a24afa28c8e8dff47f8bcc1fe89

Detailed cases and differences: tests/reference_fixtures/.
Native logs: run_tests.log and compare_R.log.
