← Back to all sparks
O

OneSampleMR

ANALYTICS
Velocity0.0

One Sample Mendelian Randomization and Instrumental Variable Analyses

OneSampleMR found that argument order in a formula was silently changing its estimates

mendelian randomizationrinstrumental variablesepidemiologycorrectnessinstrument strength
Current state
OneSampleMR implements one-sample Mendelian randomization estimators — two-stage predictor substitution, two-stage residual inclusion, and Sanderson-Windmeijer conditional F statistics for instrument strength. The package spent its first years on packaging and dependency upkeep. The 2026 releases turn to substance: broader support for models fitted elsewhere, then a correctness fix for a defect that depended on nothing more than where covariates appeared in a formula.
Where it's heading
Two threads. The first is reach — fsw() now reads models fitted by AER::ivreg(), estimatr::iv_robust() and fixest::feols() in addition to ivreg::ivreg(), which makes conditional F statistics available without refitting in the package's own idiom. The second is hardening: clear errors when more than one exposure is given or when a variable collides with the reserved name y, and print methods that no longer fail on user-specified t0 with log or logit links. Both come largely from user reports rather than a plan.
Prediction
The estimator-support work has been adding one IV-fitting package at a time on outside contributions, so further backends are the likeliest next content — the package's own estimators have been stable since first release.

Recent moves

  1. 1mo ago

    OneSampleMR fixes estimates broken by covariate order in the formula

    A defect that produced wrong numbers with no error: when exogenous covariates were listed before the exposures or instruments in a model formula, tsps() and tsri() returned incorrect estimates and fsw() reported conditional F statistics for the wrong variables. The release also adds guardrails — a clear error for multiple exposures or a variable named y, and print methods that survive a user-specified t0 with log or logit links.

    View source ↗
  2. 5mo ago

    OneSampleMR computes conditional F for three more IV packages

    fsw() extends beyond ivreg::ivreg() to models fitted by AER::ivreg(), estimatr::iv_robust() and fixest::feols(), contributed from outside. This is the package positioning as the instrument-strength utility for R's IV ecosystem rather than only for its own fits.

    View source ↗
  3. 1y ago

    OneSampleMR 0.1.6

    fsw() fixed for factor exogenous covariates and made to error outright when an exposure is a factor. An early instance of the same pattern the 2026 releases repeat — user-reported cases where the function accepted input it could not handle correctly.

    View source ↗
  4. 2y ago

    OneSampleMR 0.1.5

    Dots checking moved from the ellipsis package to rlang. Internal only.

    View source ↗
  5. 2y ago

    OneSampleMR 0.1.4

    Packaging work: a CITATION file, a README note on the GNU Fortran requirement for older gmm on macOS, and R version floors ratcheted twice through the ivreg dependency chain.

    View source ↗
  6. 3y ago

    OneSampleMR 0.1.3

    A roxygen2 bump and fewer imported functions. Representative of the package's early maintenance-only years.

    View source ↗