# Checking an R port against Stata

- Researcher: Francis DiTraglia
- Role: Econometrician and author of ivreg2r
- Field: economics
- Tools: Claude Code; Stata; R
- Published: 2026-07-21
- Source: https://restatr.com/ivreg2r/articles/validation.html
- Latest flagship models when written: Claude Fable 5 and GPT-5.6 Sol. Latest now: Claude Opus 5.5 and GPT-6.1 Sol.

## What he did

Francis DiTraglia reports using Claude Code and the GPL-licensed Stata source to port `ivreg2` to R. The R package, `ivreg2r`, was published on CRAN on 21 July 2026. [Package and development notes](https://restatr.com/ivreg2r/) · [CRAN record](https://cran.r-project.org/web/packages/ivreg2r/index.html)

In the validation guide, Stata runs the test cases and exports the results to CSV. The R tests read those files and compare coefficients, covariance matrices and diagnostic statistics at documented tolerances. They also check integer counts. The project includes scripts to regenerate the expected results from Stata. [Validation guide](https://restatr.com/ivreg2r/articles/validation.html)

## Limits of this account

The checks cover the cases in the guide. This account draws on the full validation guide, the package’s development notes and the CRAN record. I did not rerun the tests in Stata or R.
