Takes a range of OR_sz values, and ranges of rsq_ys and rsq_xs values. Then, for a given proportion of the population being sampled, provides the expected X-Y association for each of the parameter combinations. Enumerates over all combinations so can be slow

plot_simulate_y_structure(
  prop,
  b_xy_thresh,
  or_sz_range = c(1, 100),
  b_xy = 0,
  rsq_xs_range = c(0, 1),
  rsq_ys_range = c(0, 1),
  gran = 30
)

Arguments

prop

Proportion of population included in sample

b_xy_thresh

Target b_xy association - e.g. what value of b_xy are you suspicious could be due to ascertainment on a collider

or_sz_range

Range of OR_sz values to enumerate over. Default = c(1,100)

b_xy

Suspected true X-Y effect. Default = 0

rsq_xs_range

Range of rsq_xs values to enumerate over. Default = c(0,1)

rsq_ys_range

Range of rsq_ys values to enumerate over. Default = c(0,1)

gran

Granularity of ranges. Default = 30

Value

ggplot of simulations