require(binom);
R = 10; n = 30;#cohort 1
binom.confint(R, n);#nothing matches
## method x n mean lower upper
## 1 agresti-coull 10 30 0.333 0.191 0.513
## 2 asymptotic 10 30 0.333 0.165 0.502
## 3 bayes 10 30 0.339 0.180 0.504
## 4 cloglog 10 30 0.333 0.175 0.500
## 5 exact 10 30 0.333 0.173 0.528
## 6 logit 10 30 0.333 0.190 0.516
## 7 probit 10 30 0.333 0.185 0.513
## 8 profile 10 30 0.333 0.183 0.511
## 9 lrt 10 30 0.333 0.183 0.511
## 10 prop.test 10 30 0.333 0.179 0.529
## 11 wilson 10 30 0.333 0.192 0.512
#assuming typo should be 51 instead of 31,
#they used a t-test instead (counter to protocol)
(R/n) + qt(c(0.5,0.025,0.975),df=n-1)*sqrt((R/n)*(1-R/n)/(n-1));
## [1] 0.333 0.154 0.512
R = 8; n = 31;#cohort 2
binom.confint(R, n);#nothing matches
## method x n mean lower upper
## 1 agresti-coull 8 31 0.258 0.135 0.435
## 2 asymptotic 8 31 0.258 0.104 0.412
## 3 bayes 8 31 0.266 0.122 0.418
## 4 cloglog 8 31 0.258 0.122 0.418
## 5 exact 8 31 0.258 0.119 0.446
## 6 logit 8 31 0.258 0.135 0.437
## 7 probit 8 31 0.258 0.130 0.431
## 8 profile 8 31 0.258 0.127 0.427
## 9 lrt 8 31 0.258 0.127 0.427
## 10 prop.test 8 31 0.258 0.125 0.449
## 11 wilson 8 31 0.258 0.137 0.432
(R/n) + qt(c(0.5,0.025,0.975),df=n-1)*sqrt((R/n)*(1-R/n)/(n-1));
## [1] 0.2581 0.0949 0.4212
#pvalue for p0 = 0.10 matches table to 2 sig dig
2*pt(((R/n) - 0.10)/sqrt((R/n)*(1-R/n)/(n-1)), df = n-1, lower = F);
## [1] 0.0571