-
Notifications
You must be signed in to change notification settings - Fork 28
Open
Description
First let me express my gratitude for this amazing package.
Possibly there is a slight bug in the IVW/EGGER code for correlated variants.
For example in the Egger code https://github.com/cran/MendelianRandomization/blob/master/R/mr_egger-methods.R#L97
sigma <- solve(t(cbind(rep(1, nsnps), Bx))%*%solve(omega)%*%cbind(rep(1, nsnps), Bx))*max(sqrt(t(rse)%*%solve(omega)%*%rse/(nsnps-2)),1)
thetaEse <- sqrt(sigma[2,2])/min(1, rse.corr)
thetaInterse <- sqrt(sigma[1,1])/min(1, rse.corr)
The max(sqrt(t(rse)%*%solve(omega)%*%rse/(nsnps-2)),1) seems like it might possibly need to be sqrt(t(rse)%*%solve(omega)%*%rse/(nsnps-2)). This (as far as I understand) will make the min(1, rse.corr) in the 2 lines after that appropriately penalise the standard errors (so we get multiplicative random effect standard errors).
Many apologies if I am simply 100% wrong. Just wanted to flag this just in case it is helpful.
Best wishes,
Floriaan Schmidt
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels