This function samples from the posterior distribution of a given control allele frequency, for different genotype configurations lor_f sample from log(or) posterior distribution given an allele frequency.

lor_f(f0, n, target.or, target.prob, n.steps)

Arguments

f0

a scalar - allele frequency in cases to simulate

n

a scalar - number of individuals sampled

target.or

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

target.prob

a scalar - a probability that a sampled variant will exceed target.or

n.steps

an integer - length of search grid to employ - larger gives a more accurate integral estimate

Value

a list object

  1. 00 - mean lor for reference hom

  2. 01 - mean lor for het

  3. 11 - mean lor for alternative hom

  4. quant00 - quantiles for posterior distribution of allele frequency in cases for ref hom

  5. quant01 - quantiles for posterior distribution of allele frequency in cases for het

  6. quant11 - quantiles for posterior distribution of allele frequency in cases for alt hom