p = 10
b = 0.5
gamma.true = runif(p, 0.34, 1.1)
x.se = runif(p, 0.06, 0.1)
y.se = runif(p, 0.015, 0.11)
x.b = rnorm(p, gamma.true, x.se)
y.b = rnorm(p, b*gamma.true, y.se)
b0 = 0.4
MR_het_test(x.b, y.b, x.se, y.se, b0)
Run the code above in your browser using DataLab