Skip to content

ivreg2r

0.1.0Package record

Extended Instrumental Variables Estimation with Diagnostics

0packages depend
1.1Kdownloads / year
91.1%test coverage
13/13flavors OK

Overview

About

Comprehensive instrumental variables and GMM estimation with automatic diagnostics, inspired by the 'Stata' command 'ivreg2' of Baum, Schaffer, and Stillman (2003) doi:10.1177/1536867X0300300101 and Baum, Schaffer, and Stillman (2007) doi:10.1177/1536867X0800700402. Supports 2SLS, LIML, Fuller, k-class, two-step efficient GMM, and continuously-updated (CUE) estimators. Provides classical, robust, cluster-robust, HAC, and Driscoll-Kraay standard errors. Reports weak identification, underidentification, overidentification, and endogeneity tests at estimation time. All outputs are verified against 'Stata' within tight numerical tolerances.

Changes in 0.1.0

Initial CRAN release. ivreg2r provides extended instrumental variables and GMM estimation with automatic diagnostics, inspired by Stata's ivreg2 (Baum, Schaffer & Stillman).

  • Estimators: 2SLS, LIML, Fuller, k-class, two-step efficient GMM, and the continuously-updated estimator (CUE).
  • Variance estimators: classical, heteroskedasticity-robust, one- and two-way cluster-robust, HAC/AC with eight kernels and automatic bandwidth selection, Kiefer, and Driscoll-Kraay.
  • Diagnostics reported at estimation time: weak identification (Kleibergen-Paap, Cragg-Donald, Stock-Yogo critical values), underidentification, overidentification (Sargan, Hansen J, Stock-Wright S), first-stage tests (Sanderson-Windmeijer, Angrist-Pischke), endogeneity, and orthogonality.
  • Tidyverse integration: a three-part formula interface and tidy(), glance(), and augment() methods, plus diagnostics() and first_stage() accessors that return the specification tests and first-stage results as tidy objects.
  • Bundled datasets used throughout the help-file examples and vignettes: card, mroz, wagepan, griliches, klein, grunfeld, abdata, nlswork, phillips, stockwatson, and cigar.
  • All outputs verified against Stata ivreg2 within tight numerical tolerances.

From NEWS.md in the release

Install

Health

CRAN checks
13OK
Slowest check: 13.3 min · r-oldrel-macos-x86_64
Status changes
  • OK13 OK2026-08-05
  • NOTE12 OK, 1 NOTE2026-08-01
  • OK7 OK2026-07-22
Advisories

none known

Documentation

In release 0.1.0
READMEYes · 512 wordsVignettesYes · 3 · evaluation depends on the environmentNEWSYes · 67% structured · mentions 0.1.0Citation fileYes · cites a publicationWebsiteYes · pkgdown

The repository also keeps web-only articles.

Help pages
36 (2 internal)includes a package overview page
Examples that run
100%19 run in a plain check
Exported functions with examples
80%
Documented parameters
100%
Return-value docs
80%
Help pages citing references
6%

Downloads

1.1K
CRAN downloads in the past year
Rank #10,723 · ~3/day · ~93/mo
Daily download trend is not available in this view yet.
36230 days
97890 days
1.1K1 year
Compare downloads with other packages →
Also on19 r2u5 autocran

Repository

2Stars
0Forks
0Open issues
0Open PRs
0Releases
304Commits
1Commit identities
304 commits · Last activity 2026-07-21 · +100% stars, 30d · Default branch at 0.1.0.9000, ahead of CRAN 0.1.0 (checked 2026-10-21)
Responsiveness
not measured

Stars over time

2026-07-22 · 12026-10-12 · 2
PracticesBeta

8 development-tooling and community-health practices detected across 4 families in the upstream repository

Checks run against github.com/restatr/ivreg2r on 2026-10-21.

Continuous integration (2)
GitHub ActionsR CMD check workflow

The R CMD check workflow runs on Linux, macOS and Windows

Docs source (4)
README.Rmdpkgdown

GitHub Pages site last deployed 2026-07-21 · The repository has a site deploy workflow

pkgdown site last built 2026-07-21

Reproducibility and dev environment (1)
data-raw/
CRAN release process (1)
cran-comments.md
How this is detected·Detection ruleset v4 (2026-10-20)
AI coding toolsBeta

This repository shows signs of AI coding tools.

  • Claude Codefirst seen 2026-02-18
    Commits: at least 303 crediting it in the message
Models named in its commits
  • Claude Opus 4.6100 commits · Feb to Mar 2026

Some of these counts are a minimum, because the search stopped before the oldest commits.

Counts are commits, not lines of code. Commits by a tool's accounts count once across all of its accounts. Commits crediting it are the largest count among its credit lines, a minimum.How this is detected·Detection ruleset v4 (updated 2026-09-27)

Dependencies

Declared dependencies
11 external dependencies (excludes base and recommended)

Installing ivreg2r adds 12 packages (7 with compiled code, 4.1 MB of source tarballs). Heaviest: vctrs 1.0 MB, rlang 766 KB, cli 629 KB.

Depends (1)
R >= 4.4.0
Imports (4)
LinkingTo (0)
none
Enhances (0)
none
Reverse dependencies
0direct
0indirect

Nothing depends on this yet.

Datasets

People & History

People (4)
Author, Maintainer since 0.1.0 (2026)
Contributor, Copyright holder
Author of the Stata ivreg2 program from which ivreg2r is adapted
Contributor, Copyright holder
Author of the Stata ivreg2 program from which ivreg2r is adapted
Contributor, Copyright holder
Author of the Stata ivreg2 program from which ivreg2r is adapted
Releases (1)
  • 0.1.0Latest
    2026-07-21 · current release
  • R
    R 4.6.0 released · 2026-04-24

Package metadata

First published
2026-07-21
Total releases
1 / 1 yrs
License
GPL-3 OSI
Copyright
Adapted from the Stata package 'ivreg2' by Christopher F Baum, Mark E Schaffer, and Steven Stillman, distributed under GPL-3. Component-level provenance for the adapted code and the bundled datasets is in inst/COPYRIGHTS.
Minimum R
≥ 4.4.0
Bundled data
407 KB / 11 files
Download size
1.4 MB

Cite

Cite this package

Run in R for the authors' entry:

citation("ivreg2r")

The package provides a citation file, so citation() returns the authors' own entry.

It points to 10.1177/1536867x0300300101, 10.1177/1536867x0800700402.

Cite the R Observatory

For a number measured here: a download total, a coverage figure, an archival date.

APA

Balamuta, J. J. (2026). R Observatory: Metrics for ivreg2r version 0.1.0 [Data set]. HJJB, LLC. Data release v2026-10-24. https://doi.org/10.5281/zenodo.21843040

From data release v2026-10-24, which the citation names so these numbers can be found later. More on citing and the projects behind them.

Report a problem with this page →

Privacy choices

These apply to this browser and are stored on this device only. Nothing about your choice is sent to us.

Read the privacy policy