You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit was created on GitHub.com and signed with GitHub’s verified signature.
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().