\right)})} }}{{b_{zx(i)}b_{zx(\rm {top})}}} +\\ b_{xy(i)}b_{xy(\rm {top})} \left[ \frac{r_i{\sqrt {{\mathrm{var}}\left( {\hat b_{zx\left( i \right)}} \right){\mathrm{var}}{\left( {\hat b_{zx\left( {\rm {top}} \right)}} \right)} }}}{{b_{zx\left( i \right)}b_{zx\left( {\rm {top}} \right)}}} - \frac{{{{\mathrm{var}}\left( {\hat b_{zx\left( i \right)}} \right){\mathrm{var}}{\left( {\hat b_{zx\left( {\rm {top}} \right)}} \right)} }}}{{b^2_{zx\left( i \right)}b^2_{zx\left( {\rm {top}} \right)}}} \right] \end{array}$$\end{document}covb^xyi,b^xytop=rivar(b^zyi)var(b^zytop)bzx(i)bzx(top)+bxy(i)bxy(top)rivarb^zxivarb^zxtopbzxibzxtop-varb^zxivarb^zxtopbzxi2bzxtop2, and r is the LD correlation between the two SNPs (estimated from a reference sample with individual-level genotypes). We can test the deviation of each SNP from the causal model using the χ2-statistic \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$T = \hat d_i^2/{\mathrm{var}}(\hat d_i)$$\end{document}T=d^i2∕var(d^i), and remove the SNPs with P-values < 0.01. We call this approach HEIDI-outlier. We choose a relatively less stringent P-value threshold for the HEIDI-outlier analysis because even if a causal signal is detected as pleiotropy and eliminated from the analysis, it will only affect the power rather than the false positive rate or biasedness of the GSMR analysis. To retain as much power as possible to detect heterogeneity, we use a modest threshold 0.01. This means that even if there is no pleiotropic outlier, we will remove only ~1% of the instruments by chance, which is very unlikely to result in a substantial decrease in power