Searcharxiv⌕ Search

arXiv · 2611.02887

One-Sample Mendelian Randomization and Instrumental Variable Analyses in R and Stata: The OneSampleMR and ivonesamplemr Packages

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.

Explore related subjects

Keep this discovery

Explore connections, maps & timelines

BibTeXRIS

Tom Palmer, Nicolai Vitt, Eleanor Sanderson. 2026-11-02. One-Sample Mendelian Randomization and Instrumental Variable Analyses in R and Stata: The OneSampleMR and ivonesamplemr Packages. https://arxiv.org/abs/2611.02887

Cite the original work for its findings. Save a collection to share your selection of sources.

KEEP EXPLORING

Related papers

Debiased Estimating Equation Method for Robust and Efficient Mendelian Randomization Using a Large Number of Correlated Weak and Invalid Instruments

Mendelian randomization (MR) is a widely used tool for causal inference in the presence of unmeasured confounders, which uses single nucleotide polymorphisms (SNPs) as instrumental variables to estimate causal effects. However, SNPs often have weak effects on complex traits, leading to bias in existing MR analyses when weak instruments are included. In addition, existing MR methods often restrict analysis to independent SNPs via linkage disequilibrium clumping and result in a loss of efficiency in estimating the causal effect due to discarding correlated SNPs. To address these issues, we propose the Debiased Estimating Equation Method (DEEM), a summary statistics-based MR approach that can incorporate a large number of correlated, weak-effect, and invalid SNPs. DEEM effectively eliminates the weak instrument bias and improves the statistical efficiency of the causal effect estimation by leveraging information from a large number of correlated SNPs. DEEM also allows for pleiotropic effects, adjusts for the winner's curse, and applies to both two-sample and one-sample MR analyses. Asymptotic analyses of the DEEM estimator demonstrate its attractive theoretical properties. Through extensive simulations and two real data examples, we demonstrate that DEEM significantly improves the efficiency and robustness of MR analysis compared with existing methods.

stat.ME↗

Latent Space Graph-fused LASSO for Clustering in Attributed Graphs

This manuscript studies latent space graph-fused LASSO methods for clustering graphs with multivariate nodal attributes. The framework includes node-specific priors of low-dimensional representations coupled with a neural decoder that bridges the observed attributes with the latent variables. Both structural and attribute information are incorporated for the clustering through a graph-fused LASSO regularization on prior nodal means. The optimization problem is solved via the alternating direction method of multipliers with Langevin dynamics for posterior inference. Simulations on grid and block graphs, together with applications to California county temperatures and Los Angeles traffic data, demonstrate the effectiveness of the proposed method.

stat.ME↗

Missing data and cluster graphs: cluster-level missingness vs variable-level missingness

Missing data is pervasive in many scientific domains such as public health, environmental science, and the social sciences. Recoverability from missing data is typically studied using fully specified variable-level missingness models despite that, in many applications, only coarse structural information is available, for instance when variables are grouped into clusters due to limited knowledge or interpretability reasons. In this paper, we investigate recoverability from such abstract representations. We introduce two classes of cluster-based missingness graphs: the m-C-DMG, which retains variable-specific missingness indicators, and the cm-C-DMG, which aggregates missingness mechanisms at the cluster level. We formalize the notion of compatibility between these abstract graphs and underlying variable-level missingness models, and study how this abstraction affects the recoverability of probabilistic and causal queries. In particular, we give graphical conditions of recovering the joint distribution as well as graphical conditions of recovering a macro causal effect.

stat.ME↗