Skip to content

Possible bug in IVW/Egger with correlated variants #5

@afschmidt

Description

@afschmidt

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions