How to calculate 95% CI of vaccine with 90% efficacy?                     
A vaccine is reported in the news to have 90% efficacy. I'd like to know how much confidence there is in that efficacy measure.
The protocol for this reports that a vaccine or placebo was administered to 43538 patients. Half received the vaccine, half received a placebo.
Of those who received the vaccine, 94 people were infected. With a 90% efficacy being reported, that implies that of the infected, 86 people received placebo and 8 were given the vaccine.
I can create a 2x2 contingency table and run a risk ratio calculator on that table:
> ct <- cbind(c(21683,21761), c(86,8))
> rownames(ct) <- c("Placebo", "Vaccine")
> colnames(ct) <- c("Not Infected", "Infected")
> library("epitools")
> riskratio(ct)
$data
        Not Infected Infected Total
Placebo        21683       86 21769
Vaccine        21761        8 21769
Total          43444       94 43538

$measure
                        NA
risk ratio with 95% C.I.   estimate      lower     upper
                 Placebo 1.00000000         NA        NA
                 Vaccine 0.09302326 0.04508851 0.1919186

$p.value
         NA
two-sided midp.exact fisher.exact   chi.square
  Placebo         NA           NA           NA
  Vaccine          0 1.153398e-17 8.027243e-16

$correction
[1] FALSE

attr(,"method")
[1] "Unconditional MLE & normal approximation (Wald) CI"

Did I set up the table and analysis correctly, and how does the calculated risk ratio value (and its CI) affect the efficacy? That is, how much range is there around the given efficacy?
 A: One way to do it is to fit a Poisson model (a very close approximation to the binomial with such low rates), and compare the estimated risks:
library("emmeans")

dat <- data.frame(
    group = c("placebo", "vaccine"),
    infected = c(86, 8),
    N = c(86, 8) + c(21683, 21761))

mod <- glm(infected ~ group + offset(log(N)), data = dat, family = "poisson")

Using emmeans::emmeans, we can obtain estimates of the rates per 1000:
risk <- emmeans(mod, "group", at = list(N = 1000), type = "response")
risk
##  group    rate    SE  df asymp.LCL asymp.UCL
##  placebo 3.951 0.426 Inf     3.198     4.880
##  vaccine 0.367 0.130 Inf     0.184     0.735
## 
## Confidence level used: 0.95 
## Intervals are back-transformed from the log scale

These estimates match those we compute manually:
with(dat, 1000*infected / N)
## [1] 3.9505719 0.3674951

Now, just do the paired comparison. With `type = "response", this is converted to a ratio -- the infection risk ratio:
irr <- pairs(risk, reverse = TRUE)
confint(irr)
##  contrast          ratio     SE  df asymp.LCL asymp.UCL
##  vaccine / placebo 0.093 0.0344 Inf    0.0451     0.192
## 
## Confidence level used: 0.95 
## Intervals are back-transformed from the log scale

The efficacy is thus 1 - 0.093 = 90.7%, with a 95% CI of 80.8% to 95.49%.
Created on 2020-11-30 by the reprex package (v0.3.0)
A: Use the online calculator. The relative risk (RR), its standard error and 95% confidence interval are calculated according to Altman, 1991.


