# 2x2 答案

Posted on Feb 24, 2010 by Chung-hong Chan

π = P(O=1|E,τ)
= [P(E|O=1)P(O=1)]/P(E)
= [P(E|O=1)(τ)]/ [P(E|O=1)(τ) + P(E|O=0)( 1- τ)]

τ 是 P(O=1) ，用文字形容，此為 Population fraction of incident cases （母體的新發生個案數比率），根本難以估測，一般的 Population prevalence study 得出的數字也不等於此值，但可以作 Background risk 參考。所謂的 Rare outcome 假設，就是當 τ 近零， OR 就差不多等於 RR 。但這個假設未必對，由其是在高危高傳染性的病。

 O=1 O=0 E=1 510 412368 E=0 1601 162527

π (E=1) = [ 510/(510+1610) * (τ)]/ [510/(510+1610) (τ) + 412368/(412368+162527) * ( 1- τ)]
= 0.25 τ / ( 0.25 τ + [0.72 (1 - τ )])
= 0.25 τ / (0.25 τ + 0.72 - 0.72 τ)
= 0.25 τ / (0.72 - 0.47 τ )
= τ / (2.88 - 1.88 τ)

π (E=0) = [ 1610/(510+1610) * (τ)]/ [1610/(510+1610) (τ) + 162527/(412368+162527) * ( 1- τ)]
= 0.76 τ / ( 0.76 τ + [0.28 (1 - τ )])
= 0.76 τ / (0.76 τ + 0.28 - 0.28 τ)
= 0.76 τ / (0.28 + 0.48 τ )
= τ / (0.37 + 0.63 τ)

π (E=1) = 0.01 / (2.88 - 1.88 * 0.01)
= 0.003495037
π (E=0) = 0.01 / (0.37 + 0.63 * 0.01)
= 0.02657454

π (E=1) = 0.99 / (2.88 - 1.88 * 0.99)
= 0.9717314
π (E=0) = 0.99 / (0.37 + 0.63 * 0.99)
= 0.9962765

# Ignore this: < - for Wordpress to chew.
sim.tau <- c(runif(9500, min = 0.0004, max = 0.317),runif(250, min = 0, max = 0.0004),runif(250, min = 0.317, max = 1))
sim.rr <- (sim.tau / (2.88 - 1.88 * sim.tau))/(sim.tau / (0.37 + 0.63 * sim.tau))
quantile(sim.rr,c(0.025,0.975))


King G, Zeng L. Stat Med 2002; 21: 1409-27