20 likes | 160 Views
Y is binary (0/1), prob Y=1 depends on genotype, g prob = odds / (1+odds) odds = prob / (1-prob). Prob(g). Genotype, g. Odds(Y|g). Prob(Y|g). OR=3. (1-p) 2. AA. 1/4. 1/5. 2p(1-p). Aa. 3/4. 3/7. p 2. aa. OR=20. 5. 5/6. y=rbinom(n, 1, prob.y).
E N D
Y is binary (0/1), prob Y=1 depends on genotype, g • prob = odds / (1+odds) • odds = prob / (1-prob) Prob(g) Genotype, g Odds(Y|g) Prob(Y|g) OR=3 (1-p)2 AA 1/4 1/5 2p(1-p) Aa 3/4 3/7 p2 aa OR=20 5 5/6 y=rbinom(n, 1, prob.y) • Knowing p (and n) lets us generate g • Odds(Y|AA), the two log-ORs, and g tells us how to generate data g=rbinom(n, 2, p)
Basic outline • Write function to generate data • Write function(s) to fit add/dom/recc models, and return p-values • Use both LOTS of times, and see how often p<0.05; this proportion is the power • Finally, repeat for different p, Odds(Y|AA) and log ORs. Record the power each time