rondolab / MR-PRESSO

Performs the Mendelian Randomization Pleiotropy RESidual Sum and Outlier (MR-PRESSO) method.
81 stars 30 forks source link

Error when there are no significant outliers #1

Closed explodecomputer closed 7 years ago

explodecomputer commented 7 years ago

Great package and a very interesting method! Just trying it out and noticed an error, I think because there are no significant outliers and BiasTest becomes a single string but is treated as a list afterwards. This is the code:

load("dat.rdata")
p2 <- mr_presso(BetaOutcome = "beta.outcome", BetaExposure = "beta.exposure", SdOutcome = "se.outcome", SdExposure = "se.exposure", OUTLIERtest = TRUE, DISTORTIONtest = TRUE, data = dat, NbDistribution = 1000,  SignifThreshold = 0.05)

The dataset is here https://www.dropbox.com/s/fr4k4hikep93csy/dat.rdata?dl=0 if you'd like to try to reproduce

Thank you for making this code available, hope this is helpful

rondolab commented 7 years ago

Thank you very much for pointing that out and for using MR-PRESSO, I have fixed the issue.