20/03/31 08:54:47.69 2llZ2I8j.net
>>76
54119人という値になった。
計算プログラムは以下の通り。
# width of 99% confidence interval when 1000 subjects are examined
p2w <- function(
prevalence,
subjects=1000,
sensitivity=0.6,
specificity=0.9,
conf.level=0.99){
# prevalence -> width of 99% confidence interval
n=subjects
p=prevalence*sensitivity+(1-prevalence)*(1-specificity) # positive rate=prev*TP+(1-prev)*FP
q=1-p
2*qnorm(1-(1-conf.level))*sqrt(p*q/n) # width of 99%CI
}
p2w=Vectorize(p2w)
prevalence=seq