Truth of $H_A$
We have $FPRP=P(H_0=TRUE|T>z_\alpha)= \alpha(1-\pi)/[\alpha(1-\pi)+(1-\beta)\pi]=\{1+\pi/(1-\pi)][(1-\beta)/\alpha]\}^{-1}$ and similarly $FNRP=\{1+[(1-\alpha)/\beta][(1-\pi)/\pi]\}^{-1}$.
## Not run:
# # Example by Laure El ghormli & Sholom Wacholder on 25-Feb-2004
# # Step 1 - Pre-set an FPRP-level criterion for noteworthiness
#
# T <- 0.2
#
# # Step 2 - Enter values for the prior that there is an association
#
# pi0 <- c(0.25,0.1,0.01,0.001,0.0001,0.00001)
#
# # Step 3 - Enter values of odds ratios (OR) that are most likely, assuming that
# # there is a non-null association
#
# ORlist <- c(1.2,1.5,2.0)
#
# # Step 4 - Enter OR estimate and 95
#
# OR <- 1.316
# ORlo <- 1.08
# ORhi <- 1.60
#
# logOR <- log(OR)
# selogOR <- abs(logOR-log(ORhi))/1.96
# p <- ifelse(logOR>0,2*(1-pnorm(logOR/selogOR)),2*pnorm(logOR/selogOR))
# p
# q <- qnorm(1-p/2)
# POWER <- ifelse(log(ORlist)>0,1-pnorm(q-log(ORlist)/selogOR),
# pnorm(-q-log(ORlist)/selogOR))
# POWER
# FPRPex <- t(p*(1-pi0)/(p*(1-pi0)+POWER%o%pi0))
# row.names(FPRPex) <- pi0
# colnames(FPRPex) <- ORlist
# FPRPex
# FPRPex>T
#
# ## now turn to FPRP
# OR <- 1.316
# ORhi <- 1.60
# ORlist <- c(1.2,1.5,2.0)
# pi0 <- c(0.25,0.1,0.01,0.001,0.0001,0.00001)
# z <- FPRP(OR,ORhi,pi0,ORlist,logscale=FALSE)
# z
# ## End(Not run)
Run the code above in your browser using DataLab