Fig. 2: Simulation performance of TMR_GXE and the two-step procedure.

A–D No medication was present. The simulation details were described in “Methods”. A Box plots of \(\hat{\theta }\) in simulations under different environments in GWAs data. The top and bottom edges of the box plots represent the 25th and 75th percentiles of \(\hat{\theta }\), and the horizontal middle line represents the 50th percentile. The vertical bars extend from the 25th (or 75th) percentile of \(\hat{\theta }\) to the minimum (or maximum) value of simulated data. \(E\left(\hat{\theta }\right)\) is close to 1 as expected. B Box plots of the direct estimate of \({\beta }_{3}\) in GWIS (top panel) and by \(\left(\hat{\alpha }-{\hat{\beta }}_{1}\hat{\theta }\right)/{\mu }_{e}\) through MR- \(G\times E\) analysis (bottom panel). The box plots are interpreted the same as in (A) accordingly. Both the estimates of \({\beta }_{3}\) and that by \(\left(\hat{\alpha }-{\hat{\beta }}_{1}\hat{\theta }\right)/{\mu }_{e}\) are unbiased. Here s = −1 refers to the scenario when the main effect and interaction effect have opposite effect directions; s = 0 refers to no main effect; and s = 1 refers to the scenario when the main effect and interaction effect have the same effect direction. C Type I error rate comparison between \({T}_{{MR\_GxE}}\) and the direct test for different main and interaction effect directions. Both \({T}_{{MR\_GxE}}\) and the direct test maintain the type I error rate well. D Power comparison between \({T}_{{MR\_GxE}}\) and the direct test for different main and interaction effect directions. E, F 20 variants were tested when mediation was present or not. The simulation details were described in ”Methods”. E Type I error comparison for \({T}_{{Direct}}\), \({T}_{{MR\_GxE}}\) and two-step procedure. The dash lines represent the 95% confidence interval. F Power comparison for \({T}_{{Direct}}\), \({T}_{{MR\_GxE}}\) and two-step procedure.