{
  "abstract": "Mendelian randomization (MR) uses genetic variants as instrumental variables (IVs) to estimate the causal effect of an exposure on an outcome. When individual-level data on the instruments, exposure, and outcome are available in a single sample (one-sample MR), a range of IV estimators can be used beyond the standard two-stage least squares estimator, including structural mean models (SMMs) and two-stage predictor substitu- tion (TSPS) and two-stage residual inclusion (TSRI) estimators with nonlinear second stage models. These estimators are important when the outcome is binary, where in- vestigators typically wish to report causal risk ratios or causal odds ratios. However, implementations of these estimators are scattered across software packages and are of- ten unavailable with standard errors that account for the estimation of the first stage. We describe two packages which implement these estimators: OneSampleMR for R and ivonesamplemr for Stata. Both packages fit the multiplicative and logistic SMMs and TSPS and TSRI estimators with identity, log-additive, log-multiplicative, and logit links using the generalized method of moments (GMM), so that the standard errors account for the uncertainty in both stages of estimation. OneSampleMR additionally provides the Sanderson-Windmeijer conditional F-statistic for assessing instrument strength in models with multiple exposures, and ivonesamplemr additionally provides prefix commands for moving window and within-quantile estimation for exploring nonlinear exposure-outcome relationships. We illustrate both packages using the same simulated dataset and show that they give the same estimates as each other and as existing implementations.",
  "abstract_shown": true,
  "affiliations": [],
  "article_type": null,
  "arxiv": "2611.02887",
  "author_total": 3,
  "authors": [
    {
      "name": "Tom Palmer"
    },
    {
      "name": "Nicolai Vitt"
    },
    {
      "name": "Eleanor Sanderson"
    }
  ],
  "bibtex": "https://research.draconitic.com/paper/fsh9hpm1g0caw.bib",
  "cited_by": 0,
  "doi": "10.48550/arxiv.2611.02887",
  "fulltext_url": null,
  "id": "fsh9hpm1g0caw",
  "issns": [],
  "landing_url": "https://arxiv.org/abs/2611.02887",
  "language": null,
  "licence": "CC-BY-4.0",
  "licence_label": "CC BY 4.0",
  "licence_source": "article",
  "licence_url": "http://creativecommons.org/licenses/by/4.0/",
  "metadata_licence": "CC0-1.0",
  "native_subjects": [
    [
      "arxiv",
      "stat.AP"
    ],
    [
      "arxiv",
      "stat.CO"
    ],
    [
      "arxiv",
      "stat.ME"
    ]
  ],
  "openalex": null,
  "pdf_url": "https://arxiv.org/pdf/2611.02887",
  "pmcid": null,
  "pmid": null,
  "published": "2026-11-02",
  "publisher": null,
  "ris": "https://research.draconitic.com/paper/fsh9hpm1g0caw.ris",
  "sources": [
    {
      "first_seen": "2026-11-03T12:21:21Z",
      "native_id": "2611.02887",
      "source": "arxiv",
      "url": "https://arxiv.org/abs/2611.02887"
    }
  ],
  "subjects": [
    {
      "field": "mathematics",
      "origin": "arxiv:stat.AP",
      "subfield": "statistics"
    }
  ],
  "title": "One-Sample Mendelian Randomization and Instrumental Variable Analyses in R and Stata: The OneSampleMR and ivonesamplemr Packages",
  "title_text": "One-Sample Mendelian Randomization and Instrumental Variable Analyses in R and Stata: The OneSampleMR and ivonesamplemr Packages",
  "type": "preprint",
  "updated_at": "2026-11-05T15:20:35Z",
  "url": "https://research.draconitic.com/paper/fsh9hpm1g0caw",
  "venue": "arXiv",
  "versions": []
}