This function computes a probability for a given configuration of beta distribution shape parameters estimate the P(OR > target.or). lor_constraint estimate the P(OR > target.or) given shape parameters for case and control allele frequency

lor_constraint(a1, a0, b0, p0, target.or, nsim)

Arguments

a1

a scalar - beta distribution alpha shape parameter for prior on allele frequency in cases

a0

a scalar - beta distribution alpha shape parameter for prior on allele frequency in controls

b0

a scalar - beta distribution beta shape parameter for prior on allele frequency in controls

p0

a vector - a set of samples from beta(a0,b0)

target.or

a scalar - an odds ratio threshold to compute P(sim.or > target.or)

nsim

a scalar - number of log odds ratios to simulate from the posterior distribution

Value

scalar - P(sim.or>target.or)