Published June 24, 2026 | Version v0.7.9

TwoSampleMR R package

Description

  • Fixed inflated bootstrap standard errors (and p-values) in mr_mode() and mr_rucker_bootstrap() introduced in v0.6.30. The pre-generated rnorm() matrix was filled column-by-column while the per-SNP means and standard errors recycled element-wise, so each bootstrap draw was taken from the wrong SNP's distribution; the means and SEs are now laid out with rep(..., each = nboot) so each column draws from its own SNP. Point estimates were unaffected. (thanks @peterk87 reported in #684)
  • Fixed mr_rucker_bootstrap() which errored ("values must be length 1") because it accessed the per-combination result ($rucker, $Q, $res, $selected) directly while mr_rucker() returns a list with one element per exposure-outcome combination; it now unwraps the first element.
  • Fixed mr_rucker_cooksdistance(), which had the same return-shape problem: $cooksdistance was NULL so the Cook's distance filtering loop never ran and a malformed object was returned; it now unwraps the first element.
  • Added regression tests for the mr_mode() and mr_rucker_bootstrap() bootstrap standard errors and for mr_rucker_cooksdistance().

Notes

Please cite this software using the metadata from 'preferred-citation'.

Files

MRCIEU/TwoSampleMR-v0.7.9.zip

Files (6.1 MB)

Name Size Download all
md5:0b9d10a911906f100ac83f6b9b7c8c28
6.1 MB Preview Download

Additional details

Related works