top of page

Example 1
A Trial to Assay the Efficacy of a Vaccine for ZOVID-21

Note. This fictional example was stimulated by the trials that tested vaccines against COVID-19 (SARS-CoV-2). The statistical approach described here is offered as an improvement over the beta-binomial Bayesian methodology used by Pfizer and BioNTech as briefly stated in their formal protocol, FDA Briefing Document, and scientific paper.

By the summer of 2017, ZOVID-17 (ZOgaVIrusDisease; fictitious) had infected over 300 billion people worldwide in the previous nine months. The acute phase of the illness is usually mild and lasts only 2-7 days. but still with no effective treatment options, around 3% were experiencing severe illness that caused long-term organ damage, and, in rare cases, death.

In June 2021, MarWes Pharmaceuticals began conducting randomized clinical trials to test their experimental ZOVID vaccine, VM17W19, versus placebo. The primary incidence event (IE) was lab confirmed ZOVIC infection (ZOVIC+). The formal protocol, vetted by the U.S. Food and Drug Administration (FDA), called for using a Bayesian schema to conjoin a small Phase I/II trial with a subsequent Phase III trial.

 

Phase I/II trial. In order to rapidly acquire a sufficient sample size in the VM17W19 group for comprehensive safety studies (not dealt with here), this protocol called for recruiting subjects from high-risk populations and first randomized in a 2:1 ratio, VM17W19 to placebo. Subjects and almost all researchers were blinded. (The blind was broken on an as-truly-needed basis to evaluate serious adverse events.) After at least two ZOVID+ events occurred over both groups, the randomization ratio was changed 1:1. The trial was planned to end when at least three more ZOVID+ events occurred, totaling five events (2 + 3 = 5) over both groups. However, a sixth ZOVID+ event occurred on the same day (Day 30) as the fifth, so six ZOVID+ events occurred among the 509 VM17W19 and 295 placebo subjects randomized by that time. All six ZOVID+ events were placebo subjects. A basic summary of these results was provided to all subjects, and because no serious safety signals were raised, placebo subjects were offered the VM17W19 vaccine.

​

Phase III trial. Subjects in this huge, multi-center trial were recruited through public announcements and thus had a substantially lower base infection rate than those in the Phase I/II trial. The randomization ratio began at 1:1, but by the 40th ZOVID+ event (not counting the six events in the Phase I/II trial), the efficacy and safety results were so strongly positive that the trial's Data Monitoring Committee changed this to 3:1, VM17W19 to placebo. As per protocol, the dataset was locked for the first analysis when the 60th ZOVID+ event occurred. finish this later. These results were publicly shared, and were so finish this later.

​

Assaying vaccine efficacy. Why does the word "assay" appear in the title above, instead of "test"? When considered fairly, the majority of research questions are not testing hypotheses. In general, statistical plans are better formed as estimating some focal parameter and quantifying the uncertainty about that estimate. This applies even when the research question is a specific hypothesis. Bayesianism enables us customize the statistical approach so that it aligns tightly with posing and answering our research questions. In this case, MarWes sought to both estimate the efficacy of VM17W19 and test whether it exceeded some minimal threshold.

​

The focal parameter here is the incidence rate ratio, IRR = IR.V/IR.P, where IR.V and IR.P are the incidence rates for VM17W19 and placebo. If VM17W19 has no affect at all, positive or negative, then IRR = 1.0. Note that the commonly used parameter, vaccine efficacy, is merely VE = 1 - IRR. The study protocol stated that the primary statistical goal was to infer that VE exceeded 30%, an effect equivalent to IRR being less than 0.70.

 

On frequentism. The common frequentist approach would be to calculate the p-value associated with the point null hypothesis, H0: IRR = 0.70. Two points:

  • The logic behind this rests on the shaky premise that the null hypothesis is true. Thus, if IRR has little or no chance of being exactly 0.70 (or extremely close to it), then the logic falls apart.

  • Testing H0: IRR = 0.70 is equivalent to simultaneously testing two directional null hypotheses, H0': IRR ≥ 0.70 yielding the p-value p', and H0'': IRR ≤ 0.70 yielding p''. The p-value for H0: IRR = 0.70 is p = 2*min(p', p''). But the sole statistical question here is whether IRR is less than 0.70, which aligns with testing H0': IRR ≥ 0.70. Thus, p' is the p-value of interest. This is computed exactly below along with it's exact 95% confidence interval, which has the form [0.00, UCL].

​

The case for Bayesianism. MarWes choose to use the Bayesian approach embodied within IRR.Bayes(), because it offered distinct advantages for "assaying" the efficacy of VM17W19.

  • The exact value of this study's IRR is unknowable, but Bayesianism let them model it as a random variable. Plotting its distribution visually illustrated the overall story. Numerical descriptions were provided by the median (50% quantile), and 2.5% and 97.5% quantiles of this IRR distribution.

  • P-values were avoided. Instead, MarWes was able to directly ask and answer, What are Prob[IRR < 0.70], Prob[IRR < 0.50], and Prob[IRR < 0.20]?

  • Both the Phase I/II and Phase III studies addressed the primary efficacy question using the same focal parameter, IRR. This Bayesian approach allowed the data from those studies to be fused into a single analysis.

  • The data were analyzed under competing explicit, tailored models for what was then known and/or believed about the distribution of IRR when planning the study. Factored into this were issues related to what kinds of inferences the study needed to make.

Forming Tailored Priors

All of us routinely use our current knowledge, beliefs, and goals when processing new information to learn and make decisions. When ordering and interpreting new diagnostic tests, healthcare providers factor in their patient's age, sex, general fitness level, and specific medical history. When defending against a penalty kick in football (i.e., soccer), the well-prepared goalkeeper considers what each opposing player has done in the past.

 

Bayesian inference is formal process in statistical modeling.

All models are wrong. Some are useful.

            - George Box

To be useful, statistical models should be tailored to have a focal parameter that relates directly to each research question. Here, that parameter is IRR. We can never know the "true" value of IRR, so we model it as a random variable. Its prior distribution quantifies what we know and believe when planning the study and what other stakeholders of the research will accept as prudent. It also incorporates the study's role in making scientific and policy decisions. The prior sets the stage for using the data to be collected to construct posterior distributions, which let us infer directly what IRR is more or less likely to be. Thus, forming priors is a critical task that must be done thoughtfully.

​

We take IRR to have a custom distribution we call IRR.beta(a, b | NUSR). We assure that the modeling is well behaved by requiring that a ≥ 1 and b ≥ 1. NUSR,  the number under surveillance ratio, is a "nuisance" parameter, one that is unrelated the research question, but still needs to be part of the model. In this example, the number under surveillance (NUS) relates to the day the ZOVID+ event occurred. On Day 12 of the (fictitious) Phase I/II ZOVID vaccine trial of Example 1, the study was following 230 subjects who had received VM17W19 and 111 who had received placebo, all still unaffected by ZOVID, including this first ZOVID+ case. Then NUSR = 230/111 = 2.072. If IRR = 1, this new ZOVID case had a probability of P = NUSR/(NUSR + 1) = 0.674 of coming from the VM17W19 group. In general, P = NUSR*IRR/(NUSR*IRR + 1), but few analysts need to understand the underlying theory. The IRR.Bayes() algorithm handles all this for us automatically.

​

In Example 2, NUSR relates to the duration of time that ZOVID+ patients are on study before experiencing multiple organ dysfunction syndrome (MODS) or death by any cause.  Again, the IRR.Bayes() algorithm handles all this for us.

​

But analysts must set the initial prior distribution for IRR. This starts by setting a value for its median, IRR0.50. Then one can either specify a Q•100% quantile, IRR0.Q (Q ≠ 0.50), or let IRR.Bayes() find a ≥ 1 and b ≥ 1 such that the IRR prior has near-maximal spread.

 

MarWes considered this issue fully and finally decided to use two distinctly different priors. Both are reasonable; they simply reflect different objectives, objectives that stem from both objective and subjective factors. This is a strength of Bayesianism, not a weakness. As long as the matter is well argued and formally stated in the protocol, no apologies are necessary.

​

A 5-7-5 Haiku:

Priors set the stage.

What is known? What are your goals? 

Subjective? Don't fret!

​

The goal in this study was to present convincing evidence to the U.S. Food and Drug Administration that M17W19 is efficacious and safe.

​

The null-diffuse prior was formed by specifying IRR0.50 = 1.0 (no difference between groups) and directing IRR.Bayes() to find values for a ≥ 1 and b ≥ 1 that create near-maximal spread for IRR. When planning the study, NUSR was set to the randomization ratio, 1.0. The Ex1a analysis fits IRR ~ betaIRR(1.00, 1.00 | NUSR = 2.0), which has median 0.970 and an extremely wide 95% probability (credible) interval of [0.061, 32.7]. Such priors are often said to be "non-informative." They allow the data to quickly dominate the results, setting up Bayesian analyses that obtain posterior medians and probability intervals that are much like frequentist medians and confidence intervals.

​

Assessing the null, diffuse prior:

>   Ex1a <- IRR.Bayes(DFrame=NULL,
+                     GroupNames=c("VM17W19","Placebo"),
+                     IRR0.50=1.00,
+                     FitDiffuse=TRUE,
+                     NUSR=2,
+                     PI.level=c(0.90,0.95,0.99),
+                     IRR.points=c(0.05,0.10,0.25,0.50,0.70,1.00))


Fit of initial prior, IRR ~ betaIRR(1.67, 1.00 | NUSR = 2.00)
*************************************************************
               IRR0.50 (Median)      IRR0.01
As requested:           1.0000       0.0337
      As fit:           0.9695       0.0337
*************************************************************

Medians and Probability Intervals
********************************************
                 Median            LPL-UPL
Level: 0.900      0.970    [0.099, 15.998]
       0.950      0.970    [0.061, 32.666]
       0.990      0.970   [0.022, 166.000]
********************************************

Quantiles of Prior Distribution of IRR
******************************************************************************
           Q:   0.005  0.025  0.050  0.250  0.500  0.750  0.950  0.975   0.995
Quantiles:      0.022  0.061  0.099  0.385  0.970  2.654 15.998 32.666 166.000
******************************************************************************

Prob[IRR < irr] for Prior Distribution of IRR
***************************************************************
                 irr:  0.050  0.100  0.250  0.500  0.700  1.000
Prob[IRR < irr]:       0.018  0.050  0.160  0.315  0.407  0.509
***************************************************************

At the U.S. Food and Drug Administration, the protocol was vetted by the discerning biostatistician, Keenly A. Studt, PhD. Dr. Studt was a philosophy and statistics double major in college and wrote an innovative senior thesis on how understanding John Rawls' Veil of Ignorance helps in applying Bayesian statistical inference to support the Scientific Method.

 

Dr. Studt noted that the stated goal of the trial was to show convincingly that IRR had better than 30% efficacy, i.e. IRR < 0.70. However, with this prior, Prob[IRR < 0.70] = 0.41,  so she asked the MarWes investigators whether they had sufficient evidence already to support believing that VM17W19 had a 41% chance of being this effective. If not, then this "non-informative" prior actually gave MarWes an unfair "head start" towards making the inference that they hoped to make. She asked, "Wouldn't the Scientific Method be better served by starting the study at, say, Prob[IRR < 0.70] = 0.05?"

​A null-skeptical prior. Responding to Dr. Studt's point most positively, MarWes offered to also use a null-skeptical prior formed by requesting that IRR have a prior median of 1.0, but only a 5% chance of being less than 0.70. The Ex1b analysis fits this to be IRR ~ IRRbeta(61.8, 31.1 | NUSR = 2.0), which has a median of 1.0 and a 95% PI of [0.655, 1.56]. They used the PlotIRRdensity() function (supplied with IRR.Bayes) to graphically compare the diffuse and skeptical priors, showing how the skeptical prior packs the density of IRR around 1.0 and thus rigorously challenges the study to collect data that will move the bulk of the posterior IRR distribution below 0.70.

​

Assessing the null-skeptical prior:

>   Ex1b <- IRR.Bayes(DFrame=NULL,
+                     GroupNames=c("VM17W19","Placebo"),
+                     IRR0.50=1.00,
+                     IRR0.Q=0.70,
+                     Q=0.05,
+                     NUSR=2,
+                     PI.level=c(0.90,0.95,0.99),
+                     IRR.points=c(0.05,0.10,0.25,0.50,0.70,1.00))


Fit of initial prior, IRR ~ betaIRR(61.8, 31.1 | NUSR = 2.00)
*************************************************************
              IRR0.50 (Median)      IRR0.05
As requested:           1.0000       0.7000
      As fit:           1.0000       0.7000
*************************************************************

Medians and Probability Intervals
********************************************
                 Median          LPL-UPL
Level: 0.900      1.000   [0.700, 1.450]
       0.950      1.000   [0.655, 1.560]
       0.990      1.000   [0.574, 1.805]
********************************************

Quantiles of Prior Distribution of IRR
******************************************************************************
           Q:   0.005  0.025  0.050  0.250  0.500  0.750  0.950  0.975  0.995
Quantiles:      0.574  0.655  0.700  0.863  1.000  1.162  1.450  1.560  1.805
******************************************************************************

Prob[IRR < irr] for Prior Distribution of IRR
***************************************************************
                 irr:  0.050  0.100  0.250  0.500  0.700  1.000
Prob[IRR < irr]:       0.000  0.000  0.000  0.001  0.050  0.500

***************************************************************

Data Generation (only for those yearning to know)

IRR.GenData() was written to work with IRR.Bayes() and is included in the downloaded file. To be clear, deciphering what IRR.GenData() does in this example, and especially, how it does it, is not needed to learn how to use IRR.Bayes(). However, for those yearning to know, here are the essentials.

On any given day of the trial, $StartDay, IRR.GenData() created independent N.d cases, with N.d distributed as a Poisson variate with a mean recruitment of RecRate, such as 400 per day. These were randomized in a RanRatio:1 ratio, Groups[1] = "VM17W19" to Groups[2] = "Placebo", giving sample sizes for that day of n1.d and n2.d. The randomization ratio was initially 1:1, but changed to 3:1 after the first 50 ZOVID+ events were distributed 5:45, VM17W19 to placebo.

For each subject, two random variables were generated and rounded to the nearest integer.

  • IEDay, the day being confirmed ZOVID+, was modeled as an exponential variate, which has a constant hazard rate. For placebo, this was 12 ZOVID+ cases per 100,000 surveillance days: H.placebo(t) = 0.00012. (In the United States, population 331.5 million, this is almost 40,000 per day.) The true constant hazard ratio was set at H.VM17W19(t)/H.placebo(t) = 0.10, making H.VM17W19(t) = 0.000012. Prob[IEday < 90.50 | placebo]  = 0.01080; and Prob[IEday < 90.50 | M17W19] = 0.00109.

  • Cday, the day of random right (non-informative) censoring, was modeled as an exponential variate with rate 3 per 100,000 surveillance days: CensRate = 0.00003.


The data generation stopped on the day that the total number of confirmed ZOVID infections was at least 70. For this run (Seed = 987651), 14,845 subjects (52.1%) had received VM17W19 and 13,631 subjects had received placebo.
   
IRR.GenData() returns $EventDay and $EventType for each subject based on their IEday, Rday, and Cday values:

  • $EventDay is the minimum of IEday and Cday.

  • Regarding $EventType, if $EventTime = IEday, then $EventType = "ZOVID+". Else, $EventType = "censored".

  • Finally, all subjects with $EventDay > StopDay (here, 70) are reset to have $EventDay = StopDay + 1 (here, 71), and EventType = "censored".


The returned data.frame has the common structure for a two-group time-to-event analysis with right censoring, one row per subject with these variables:
  $Group ... "VM17W19" or "Placebo"
  $StartDay ... day of study (beginning at 0) that subject was first treated
                and thus became under surveillance for ZOVID.
  $EventDay ... day of study that the subject was deemed to be ZOVID+.
  $EventType ... type of event, here "ZOVID+" or "censored".
 

Analysis

A quick look at the data:

​

>     names(data1A)
[1] "Group"     "StartDay"  "EventDay"  "EventType"


>     table(data1A$Group, data1A$EventType)
         
          censored ZOVID+
  Placebo     13631     55
  ZVM17W19    14845      6


>     summary(data1A[,c("StartDay","EventDay")])
   StartDay        EventDay    
Min.   : 0.00   Min.   : 3.00  
1st Qu.:17.00   1st Qu.:71.00  
Median :35.00   Median :71.00  
Mean   :34.94   Mean   :70.92  
3rd Qu.:53.00   3rd Qu.:71.00  
Max.   :70.00   Max.   :71.00

The null, diffuse prior. The code for Ex1c takes in the data1A data.frame and performs the analysis using a prior of median for IRR of 1.0 and giving it nearly maximal spread. The syntax is delineated in the list of arguments.

> Ex1c <- IRR.Bayes(
+   # Dataset
+       DFrame=data1,
+       Group="Group",
+       GroupNames=c("VM17W19","Placebo"),
+       StartTime="StartDay",
+       EventTime="EventDay",
+       Event="EventType",
+       IEvalue="ZOVID+",
+   # Analysis
+       TimeType="EventTime",
+       IRR0.50 = 1,
+       FitDiffuse=TRUE,
+       PI.level=c(0.90,0.95,0.99),
+       IRR.points=c(0.05,0.10, 0.25,0.50,0.70,1.00),
+   # Printing
+       TimeUnit="Day",
+       Print=TRUE,
+       PrintChronology=T,
+       PrintSteps=T)

This being the first analysis, we will review its output in depth.

  First start day: 0
  Last start day: 70
  First day to have incidence event: 3
  Last day to have incidence event: 70
  Study duration: 71 days

  Sample sizes, number of IEs, days under surveillance, and incidence rates
  **************************************************************************
     Group       n     IEs    Days        IR      IRR
  ZVM17W19   14851       6  513610 0.0000117    0.109
  Placebo   13686      55  513378 0.0001071         
  **************************************************************************

The first ZOVID infection occurred on Day 3 of the trial, the final on Day 70. In total, 14,851 subjects were randomized to receive VM17W19 and 13,686 to receive placebo.  In the placebo group, 55 subjects became ZOVID+ over 513,378 surveillance days for an overall incidence rate of 55/513389 = 0.0001071 infections per subject day. This may not seem massive at first glance, but it translates to the U.S. population of 330 million having over 35,000 infections per day and India's population of 1.4 billion having almost 150,000 infections per day. The incidence rate for the VM17W19 group was 6/513610 = 0.0000117, so the estimated incidence rate ratio was (6/513610)/(55/513378) = 0.109. If this had been the way MarWes analyzed the data, their press release might have said that VM17W19 reduced the infection rate by an estimated 89%, and they would have provided an appropriate confidence interval.

Fit of initial prior, IRR ~ betaIRR(1.01, 1.04 | NUSR = 0.96)
*************************************************************
              IRR0.50 (Median)      IRR0.01

As requested:           1.0000       0.0106
      As fit:           1.0027       0.0106
*************************************************************

As explained in the Methods, the prior distribution, IRR0 ~ IRRbeta(a0, b0 | NUSR), is reshaped in order to use the common beta-binomial Bayesian inference model. The resulting fit is usually excellent, but nevertheless imperfect. Here, the requested median for IRR was 1.0, but the median for the reshaped IRR distribution was 1.0027. Be aware that some specifications for IRR050 and IRR0.Q are incompatible with this model. When IRR.Bayes() detects this, it issues an appropriate error message and stops executing.


Chronology of incidence event times
**********************************************************************************
  Time  NUS1  NUS2  NUSR Pri.50        Pri.PI95 r1 r2 Post.50      Post.PI95 s1 s2
     3   803   834 0.963  1.003 [0.027, 35.848]  0  1   0.427 [0.014, 5.362]  0  1
     6  1389  1431 0.971  0.440  [0.015, 5.336]  0  1   0.280 [0.010, 2.494]  0  2
    15  3144  3236 0.972  0.289  [0.012, 2.482]  1  1   0.480 [0.062, 2.565]  1  3
    18  3769  3845 0.980  0.483  [0.063, 2.563]  1  0   0.750 [0.143, 3.489]  2  3

<snip>

    64 12973 13049 0.994  0.114  [0.041, 0.255]  1  1   0.132 [0.052, 0.282]  5 45
    65 13256 13146 1.008  0.132  [0.052, 0.282]  1  1   0.150 [0.063, 0.307]  6 46
    66 13574 13244 1.025  0.150  [0.064, 0.307]  0  3   0.141 [0.060, 0.287]  6 49
    67 13882 13342 1.040  0.141  [0.060, 0.287]  0  2   0.136 [0.058, 0.276]  6 51
    69 14504 13513 1.073  0.136  [0.058, 0.276]  0  1   0.133 [0.057, 0.270]  6 52
    70 14830 13618 1.089  0.133  [0.057, 0.270]  0  3   0.126 [0.054, 0.254]  6 55
**********************************************************************************
  - Key -
    Time: day of incidence event (IE)
    NUS1: number under surveillance, Group 1
    NUS2: number under surveillance, Group 2
    NUSR: NUS1/NUS2
    Pri.50: posterior median
    Pri.PI95: prior 95% probability interval
    r1: number of new IEs in Group 1
    r2: number of new IEs in Group 2
    Post.50: posterior median
    Post.PI95: posterior 95% probability interval
    s1: cumulative number of IEs in Group 1
    s2: cumulative number of IEs in Group 2

The first infection was confirmed on Day 3 of the trial. At that time, 803 VM17W19 subjects and 834 placebo subjects were under surveillance, so NUSR = 803/834 = 0.963. Given this NUSR, the median of the initial fitted prior IRR.beta distribution was 1.003 and the 95% probability interval was [0.027, 35.8]. That first infection was a placebo subject (r1 = 0, r2 = 1),  which dropped the median of the posterior distribution to 0.427 and tightened the 95% PI to [0.014, 5.4].

​

The second ZOVID+ event was confirmed on Day 6. With an NUSR of 0.971 and using the median and another quantile of the posterior IRR.beta distribution of Day 3, the prior distribution for Day 6 had a median of 0.440 and a 95% PI of [0.015, 5.4]. That ZOVID+ event was also a placebo subject, which dropped the posterior IRR median to 0.280 and tightened the 95% PI to [0.010, 2.5].

 

Note what happened on Days 15 and 18. Day 15 had two ZOVID+ events, one in each group. This disappointing news raised the posterior median to 0.480. On Day 18, another VM17W19 subject was confirmed to be ZOVID+, raising the posterior median to 0.750. The 95% PIs shifted upward.

​

However, on Day 64 the 50th ZOVID+ event occurred and the posterior median and 95% PI were 0.132 and [0.052, 0.282]. At that point, the trial's data monitoring committee unanimously agreed that these results strongly indicated that VM17W19 was efficacious. The committee's bioethicist moved to change the randomization to 3:1, a recommendation supported by MarWes's drug safety director who always needs more subjects in the experimental groups. This change was effective the next day.

 

In the next six days, 9 more ZOVID+ cases came from the placebo group versus none from the VM17W19 group. At this point (Day 70) the posterior median and 95% PI were 0.126 and [0.054, 0.254]. In addition, the posterior probability that IRR is less than 0.25 (75% vaccine efficacy) was 97.2%.

Final posterior distribution
************************************************
      IRR ~ IRR.beta(7.76, 54.45 | NUSR=1.089)
defined by
      P ~ beta(7.76, 54.45)
and the random variable transformation
      IRR = P/{(1 - P)*1.089)}
************************************************

Median and probability (credible) intervals, [LPL, UPL]
*******************************************************************
                     ......... Prior ......   ..... Posterior .....
  Level: 0.900       1.003  [0.054, 17.853]   0.126  [0.063, 0.229]
         0.950       1.003  [0.027, 35.848]   0.126  [0.054, 0.254]
         0.990       1.003 [0.005, 173.348]   0.126  [0.040, 0.310]
*******************************************************************

Quantiles of prior and posterior distributions of IRR
******************************************************************************
             Q: 0.005  0.025  0.050  0.250  0.500  0.750  0.950  0.975   0.995
      Prior:    0.005  0.027  0.054  0.339  1.003  2.953 17.853 35.848 173.348
  Posterior:    0.040  0.054  0.063  0.096  0.126  0.163  0.229  0.254   0.310
******************************************************************************

Prob[IRR < irr] for prior and posterior distributions of IRR
************************************************************
              irr:  0.050  0.100  0.250  0.500  0.700  1.000
      Prior:        0.046  0.089  0.197  0.331  0.410  0.499
  Posterior:        0.017  0.282  0.972  1.000  1.000  1.000
************************************************************

The final posterior distribution is IRR ~ IRR.beta(7.76, 54.45 | NUSR = 1.089), which means that a q•100% quantile, IRR.q, can be found by computing the q•100% quantile of the common beta random variable, P ~ beta(7.76, 54.45), P.q = qbeta(q, 7.76, 54.45), and then using IRR.q =

P.q/((1 - P.q)*NUSR. Similarly,

Prob[IRR < irr] = Prob[P < p], where p = NUSR*irr/(NUSR*irr + 1).

​

Using PlotIRRdensity() to display the prior and posterior distributions side by side provides a cogent and compelling macro-level conclusion to share with a wide audience. MIcro-level details are abundant in the tables that IRR.Bayes() produces.

The null-skeptical prior. Ex1d performs the analysis using a prior median for IRR of 1.0 and 5% quantile of 0.70, i.e., Prob[IRR < 0.70] = 0.05.

> Ex1d <- IRR.Bayes(
+   # Dataset
+       DFrame=data1,
+       Group="Group",
+       GroupNames=c("VM17W19","Placebo"),
+       StartTime="StartDay",
+       EventTime="EventDay",
+       Event="EventType",
+       IEvalue="ZOVID+",
+   # Analysis
+         TimeType="EventTime",
+         IRR0.50 = 1,
+         IRR0.Q=0.70, Q=0.05,
+         PI.level=c(0.90,0.95,0.99),
+         IRR.points=c(0.05,0.10, 0.25,0.50,0.70,1.00),
+   # Printing
+         TimeUnit="Day",
+         Print=TRUE,
+         PrintChronology=T
+          )

Fit of initial prior, IRR ~ betaIRR(42.3, 43.9 | NUSR = 0.96)
*************************************************************
              IRR0.50 (Median)      IRR0.05
As requested:           1.0000       0.7000
      As fit:           1.0000       0.7000
*************************************************************

The fit is perfect to four decimal places. The underlying theory of the method reveals that this prior can be interpreted as beginning by instantaneously observing 41.3 ZOVID+ cases from the VM17W19 group and 42.9 cases from the placebo group. Such conservatism is difficult to overcome, but if successful, more strongly supports that VM17W19 is efficacious.

Chronology of incidence event times
**********************************************************************************
Time  NUS1  NUS2  NUSR Pri.50       Pri.PI95 r1 r2 Post.50      Post.PI95 s1 s2
   3   803   834 0.963  1.000 [0.653, 1.529]  0  1   0.978 [0.640, 1.490]  0  1
   6  1389  1431 0.971  0.978 [0.640, 1.490]  0  1   0.956 [0.627, 1.454]  0  2
  15  3144  3236 0.972  0.956 [0.627, 1.454]  1  1   0.958 [0.631, 1.449]  1  3
  18  3769  3845 0.980  0.958 [0.632, 1.449]  1  0   0.980 [0.648, 1.480]  2  3

<snip>

  64 12973 13049 0.994  0.541 [0.376, 0.768]  1  1   0.546 [0.381, 0.773]  5 45
  65 13256 13146 1.008  0.546 [0.382, 0.773]  1  1   0.551 [0.386, 0.778]  6 46
  66 13574 13244 1.025  0.551 [0.386, 0.778]  0  3   0.533 [0.374, 0.750]  6 49
  67 13882 13342 1.040  0.533 [0.374, 0.750]  0  2   0.521 [0.367, 0.733]  6 51
  69 14504 13513 1.073  0.521 [0.367, 0.733]  0  1   0.516 [0.363, 0.724]  6 52
  70 14830 13618 1.089  0.516 [0.363, 0.724]  0  3   0.499 [0.352, 0.699]  6 55
**********************************************************************************

Final posterior distribution
************************************************
      IRR ~ IRR.beta(50.92, 93.42 | NUSR=1.089)
defined by
      P ~ beta(50.92, 93.42)
and the random variable transformation
      IRR = P/{(1 - P)*1.089}
************************************************

Median and probability (credible) intervals, [LPL, UPL]
******************************************************************
                 ......... Prior ......   ..... Posterior .....
Level: 0.900      1.000  [0.700, 1.427]   0.499  [0.373, 0.663]
       0.950      1.000  [0.653, 1.529]   0.499  [0.352, 0.699]
       0.990      1.000  [0.571, 1.749]   0.499  [0.315, 0.776]
******************************************************************

Quantiles of prior and posterior distributions of IRR
******************************************************************************
           Q:   0.005  0.025  0.050  0.250  0.500  0.750  0.950  0.975  0.995
    Prior:      0.571  0.653  0.700  0.864  1.000  1.157  1.427  1.529  1.749
Posterior:      0.315  0.352  0.373  0.443  0.499  0.561  0.663  0.699  0.776
******************************************************************************

Prob[IRR < irr] for prior and posterior distributions of IRR
************************************************************
           irr:  0.050  0.100  0.250  0.500  0.700  1.000
    Prior:       0.000  0.000  0.000  0.001  0.050  0.500
Posterior:       0.000  0.000  0.000  0.505  0.975  1.000
************************************************************

With a posterior 95% PI of  [0.352, 0.699] and Prob[IRR < 0.70] = 0.975, these data strongly challenge the skeptical prior view that IRR is likely around 1.0 with only a 0.05 chance of being less than 0.05. The densities plot makes the same point even more clearly.

 

However, these results are markedly at odds with the ordinary estimate of 0.109, indicating that if the trial had procured more ZOVID+ events, the results would likely have been stronger.

​

For example, suppose when the randomization was changed from 1:1 to 3:1, the recruitment rate was increased by 50% to

600/day, and the trial had continued until at least 500 ZOVID+ events occurred. The null-skeptical analysis gives a posterior median of 0.169 and a 95% PI of [0.125, 0.185], which are much closer to, but still above, the frequentist estimate of 0.094. As expected, the null-diffuse prior gives frequentist-like posterior results: median of 0.0.095 and 95% PI of [0.074, 0.120]. 

To reiterate, both of these priors rigorously support the Scientific Method. The null-diffuse prior allows the data to dominate the story, as per using frequentist estimation and confidence intervals. The null-skeptical prior challenges the study to yield data that will directly and convincingly "refute" the hypothesis that IRR is not substantively different from 1.0.

​

Importantly, at least for this problem, both methods offer clear advantages—and, in my opinion, no disadvantages—over frequentist null hypothesis testing using p-values.

bottom of page