统计学 > 方法论
[提交于 2026年11月2日 (v1),最后修订于 2026年11月30日 (此版本, v2)]
标题:One-Sample Mendelian Randomization and Instrumental Variable Analyses in R and Stata: The OneSampleMR and ivonesamplemr Packages
查看中文 PDF 查看原文 PDF EasyResearch 阅读摘要: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 substitution (TSPS) and two-stage residual inclusion (TSRI) estimators with nonlinear second stage models. These estimators are important when the outcome is binary, where investigators typically wish to report causal risk ratios or causal odds ratios. However, implementations of these estimators are scattered across software packages and are often 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. Both packages also provide the Sanderson-Windmeijer conditional F-statistic for assessing instrument strength in models with multiple exposures, and 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.
提交历史
来自:Tom Palmer[v1] 2026年11月2日 星期一 10:22:17 UTC (61 KB)
[v2] 2026年11月30日 星期一 10:33:17 UTC (62 KB)