Next Article in Journal
Two-Dimensional Compact-Finite-Difference Schemes for Solving the bi-Laplacian Operator with Homogeneous Wall-Normal Derivatives
Previous Article in Journal
Energy Based Calculation of the Second-Order Levitation in Magnetic Fluid
Previous Article in Special Issue
Incorporating a New Summary Statistic into the Min–Max Approach: A Min–Max–Median, Min–Max–IQR Combination of Biomarkers for Maximising the Youden Index
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Communication

Formulas, Algorithms and Examples for Binomial Distributed Data Confidence Interval Calculation: Excess Risk, Relative Risk and Odds Ratio

by
Lorentz Jäntschi
1,2
1
Department of Physics and Chemistry, Technical University of Cluj-Napoca, 400641 Cluj, Romania
2
Chemical Doctoral School, Babes-Bolyai University, 400028 Cluj-Napoca, Romania
Submission received: 22 July 2021 / Revised: 29 September 2021 / Accepted: 4 October 2021 / Published: 7 October 2021
(This article belongs to the Special Issue Applied Medical Statistics: Theory, Computation, Applicability)

Abstract

:
Medical studies often involve a comparison between two outcomes, each collected from a sample. The probability associated with, and confidence in the result of the study is of most importance, since one may argue that having been wrong with a percent could be what killed a patient. Sampling is usually done from a finite and discrete population and it follows a Bernoulli trial, leading to a contingency of two binomially distributed samples (better known as 2 × 2 contingency table). Current guidelines recommend reporting relative measures of association (such as the relative risk and odds ratio) in conjunction with absolute measures of association (which include risk difference or excess risk). Because the distribution is discrete, the evaluation of the exact confidence interval for either of those measures of association is a mathematical challenge. Some alternate scenarios were analyzed (continuous vs. discrete; hypergeometric vs. binomial), and in the main case—bivariate binomial experiment—a strategy for providing exact p-values and confidence intervals is proposed. Algorithms implementing the strategy are given.

1. Introduction

Evaluation of the odds and the risks associated with diseases becomes more actual than never in the recent context of COVID-19 [1,2]. The proper evaluation of these parameters as well as their confidence intervals have a great impact [3]. The term odds denotes the probability that an event will occur divided by the probability that an event will not occur while the ‘Risk’ is the probability that an outcome will occur, expressed as the number of positive outcomes divided by the total number of outcomes; relative risk and odds ratios are simply the risk or odds, respectively, of an outcome in one group (exposed group, case group) divided by the risk or odds of the outcome in another group (control group, reference group). Current guidelines recommend reporting relative measures of association (such as the relative risk and odds ratio) in conjunction with absolute measures of association (which include risk difference or excess risk) [4]; Table 4 in [4] should be consulted for a detailed comparison between them.
There are no interpretations of these concepts that are at once simple, intuitive, correct, and foolproof; correct use and interpretation of these statistics requires an attention to detail which seems to tax the patience of working scientists [5]. A recent study noted that assessment of intervention effects in systematic reviews with meta-analysis deserves greater rigor with respect to insufficiently demonstrated traditional 95% confidence intervals and p-values [6] suggesting that the primary step of reporting the 95% confidence interval, and/or the p-value should be continued with other four steps (investigating statistical and clinical heterogeneity; dealing with problems of multiplicity due to multiple outcomes; trial sequential analysis; and Bayes factor analysis). In addition, to avoid erroneous interpretations, researchers should account for the potential impact of systematic errors (bias; on the meta-analysis results and publication bias due to statistical significance and clinical significance. The assessment of the clinical significance of an intervention effect should only be assessed if statistical significance has been obtained, but on the other hand, if statistical significance has been reached, then clinical significance must be assessed [6]. There is no doubt that in research practice and in training of researchers, we must engage appropriate methods including calculation of the confidence intervals within individual studies, and meta-analysis in the integration of multiple studies, in order to produce final conclusions [7].
Even if providing an accurately calculated confidence interval (CI) might strongly support the conclusions of a study, people are still reticent to use exact methods of calculating the CIs. Furthermore, some reputed statisticians suggest that “approximate is better than exact” [8]. To follow the same route, one could say “this concludes the needed proof”.
The aforementioned reticence is in the majority of cases due to the complexity of the calculation. For example, deciphering how Casella ([9] refining a previous work [10]) calculated the famous BSC interval for the binomial proportion is a challenge for someone not quite familiarized with mathematics, statistics and informatics. To briefly exemplify, one should assume that, generally, the people developing a method and the people meant to use it are not the same, and worse yet, may not have the same background.
New findings showed that the bias associated with the usual estimator of odds ratio and the relative risk may be substantial for rare events [11]. Further developments are expected from machine learning enabling the development of algorithms with minimal dependence or parametric assumptions [12].

2. Research Aim

When dealing with sampling, usually from a finite and discrete population, Value–Probability and Interval–Confidence facets for the 2 × 2 contingency measures of association require a much better explanation in order to be thoroughly understood, and “at key solutions” need to be provided. Here, it is proposed that starting from the study design (Figure 1), first, to calculate the probability mass functions associated with the two binomial samples, second, to calculate the probability mass function of the case vs. control bivariate binomial experiment, and finally, to extract the parameters of interest (please note that most of the studies require calculation of at least two parameters). Cumulative distribution function and confidence intervals and/or p-values are calculated in a succession of two more steps (Figure 1); later, algorithms are given (Algorithms 1–5).
Algorithm 1: Probability mass function (PMF) for binomial distribution, Equation (9).
Input:z, o    //z←x or y, o←m or n
    procedure PMF_B(z, o, &r)
    If( z ( o z ) = 0)
       for( w o ; w 0 ; w ) r [ w ] 0 ; if( x = 0 ) r [ 0 ] 1.0 else r [ o ] 1.0 ; exit
    EndIf
     r [ z ] z LOG ( z / o ) + ( o z ) LOG ( 1 z / o )
    If( z < o / 2 )
       for( w z ; w > 0 ; w ) r [ z ] r [ z ] + LOG ( o z + w ) LOG ( w )
    Else
       for( w o z ; w > 0 ; w ) r [ z ] r [ z ] + LOG ( z + w ) LOG ( w )
    EndIf
     r [ z ] EXP ( r [ z ] )
    for( w z 1 ; w 0 ; w ) r [ w ] r [ w + 1 ] ( o z ) ( w + 1 ) / z / ( o w )
    for( w z + 1 ; w m ; w + + ) r [ w ] r [ w 1 ] x ( o w + 1 ) / w / ( o z )
    end procedure
Output:r    // r f BS ( 0 ; x , m ) , , f BS ( m ; x , m ) or f BS ( 0 ; y , n ) , , f BS ( n ; y , n )
Algorithm 2: Expression for ER, OR, RR (Equations (10)–(12)) as irreducible fraction.
Input: x , m , y , n    //x←x, m←m,y←y, n←n
    procedure FR(a, b, &c, &d)
        c a ; d b ;
       If( d = 0 ) if( c = 1 ) d = 1 ; c = 1 ; exit EndIf
       if( c = 0 ) d 1 ; if( d < 2 ) exit; if( a < 0 ) a a
       For(; b > 0 ;)
           t b ; b a % b ; a t    //% is the modulo operator
       EndFor    //a is the greatest common divisor
        c c / a ; d d / a    // c / d is irreducible fraction
    end procedure
    procedure ER(x, y, m, n, &c, &d)    //excess risk, ER
       FR(x*n - y*m, m*n, c, d)
    end procedure   // c / d ER (Equation (10))
    procedure OR(x, y, m, n, &c, &d)    //odds ratio, OR
       FR(x*(n-y), y*(m-x), c, d)
    end procedure   // c / d OR (Equation (11))
    procedure RR(x, y, m, n, &c, &d)    //relative risk, RR
       FR(x*n, y*m, c, d)
    end procedure   // c / d RR (Equation (12))
Output: c , d    // c d is a irreducible fraction
Algorithm 3: Bivariate binomial experiment, Equation (14).
Input:x, y, m, n, F    //x←x, y←y, m←m, n←n, F  ER, OR or RR
    procedure B2F(x, y, m, n, F, &p, &g, &h)
    PMF_B( x , m , r 1 ); PMF_B( y , n , r 2 ); p [ ] ; g [ ] ; h [ ]
    For( u m ; u 0 ; u ) For( v n ; u 0 ; v )
        p [ ] r 1 [ u ] r 2 [ v ] ; F ( x , y , m , n , c , d ) ; g [ ] c ; h [ ] d
    EndFor EndFor
    end procedure
Output: p , g , h    // p [ ] probabilities; g [ ] numerators; h [ ] denominators
Algorithm 4: PMF for bivariate binomial expressions (B2E), Equation (15).
Input:k, p, g, h    //k←k, p←p, g←g, h←h
    procedure PMF_B2E(&k, &p, &g, &h)
       procedure S0FR(l,r)
         i l ; j r ; t DIV ( l + r , 2 )
        For(; i > j ;)
          for(; g [ i ] / h [ i ] < g [ t ] / h [ t ] ; i + + ); for(; g [ t ] / h [ t ] < g [ j ] / h [ j ] ; j );
          If( i j )
             y g [ i ] ; g [ i ] g [ j ] ; g [ j ] y ; y h [ i ] ; h [ i ] h [ j ] ; h [ j ] y
             y p [ i ] ; p [ i ] p [ j ] ; p [ j ] y ; i i + 1 ; j j 1
          EndIf
         EndFor
      if( l < j ) S0FR ( l , j ) ; if( i < r ) S0FR ( i , r )
    end procedure
    S0FR ( 0 , k 1 ) ; p 1 [ ] ; g 1 [ ] ; h 1 [ ] ; k 1 0
   For( i 0 ; i < k ;)
       s g [ i ]
      For( j i + 1 ; j < k ;)
         if( g [ j ] g [ i ] ) BREAK ; if( h [ j ] h [ i ] ) BREAK ; s s + p [ j ]
      EndFor
       p 1 [ ] s ; g 1 [ ] g [ i ] ; h 1 [ ] h [ i ] ; i j ; k 1 k 1 + 1
   EndFor
    k k 1 ; p p 1 ; g g 1 ; h h 1
end procedure
Output: k , p , g , h    //k→k, p→p, g→g, h→h
Algorithm 5: CIs in increasing coverage for B2E.
Input: n u , d e , k, p, g, h    // n u nu, de←de, k←mn, p←p, g←g, h←h
    function CC(&g, &h, k, i, j)
     a [ ; b ]
    If( k > 0 ) if( i > 0 ) i ; a ( endif; if( j < k ) j + + ; b ) endif EndIf
     u CONCATENATE ( g [ i ] , / , h [ i ] ) ; if( h [ i ] = 1 ) u g [ 0 ] ; if( h [ i ] = 0 ) u 0
     v CONCATENATE ( g [ j ] , / , h [ j ] ) ; if( h [ j ] = 1 ) v g [ 0 ] ; if( h [ j ] = 0 ) v 0
     w CONCATENATE ( a , u , , , v , b ) ; RETURN ( w )
    end function
    procedure CI_B2E(nu, de, &k, &p, &g, &h, &ci)
     i 0 1 ; for( i k 1 ; i 0 ; i ) if(( n u = g [ i ] ) AND ( d e = h [ i ] )) i 0 i
     i t 0 ; i 1 i 0 ; i 2 i 0 ; i q 0 ; r p [ i 0 ] ; q 1.0 p [ i 0 ]
    For(; ;)
       if( r < 0.5 ) q 1 r else r 1 q ; c 0 C C ( g , h , 0 , i 1 , i 2 ) ; c 1 C C ( g , h , k , i 1 , i 2 )
        c i [ i t ] ARRAY ( c 0 , c 1 , r , q ) ; i t i t + 1 ; if(( i 1 = 0 ) AND ( i 2 = k )) BREAK
       if( i 1 = 0 ) i 2 i 2 + 1 ; r r + p [ i 2 ] ; q q p [ i 2 ] ; CONTINUE endif
       if( i 2 = k ) i 1 i 1 1 ; r r + p [ i 2 ] ; q q p [ i 2 ] ; CONTINUE endif
       If( p [ i 1 1 ] = p [ i 2 + 1 ] )
           i 1 i 1 1 ; i 2 i 2 + 1 ; r r + p [ i 1 ] + p [ i 2 ] ; q q p [ i 1 ] p [ i 2 ] ; CONTINUE
       EndIf
       if( p [ i 1 1 ] > p [ i 2 + 1 ] ) i 1 i 1 1 ; r r + p [ i 1 ] ; q q p [ i 1 ] ; CONTINUE endif
       if( p [ i 1 1 ] < p [ i 2 + 1 ] ) i 2 i 2 + 1 ; r r + p [ i 2 ] ; q q p [ i 2 ] ; CONTINUE endif
    EndFor
     k i t
    end procedure
Output: c i    // c i [ i ] array (ci_min, ci_max, coverage, 1-coverage)

3. Background

Since ratio scale statistics are widely known, those shall be used for comparison. A long time ago [13], Carl Friedrich Gauss wrote the formula for the distribution of the population statistic known presently as “Normal”-Gauss distribution. Some readers may believe that Gauss was the first to address this issue, which is not quite true. With a reasonable confidence, one should say that Newton’s foundational work [14] has inspired many people. Drawing from this, Bernoulli [15] put forward a piece of proof for the expansion formula of the Newton binomial; thus, the Binomial distribution was invented ( f B , Equation (1), where Γ ( o + 1 ) = o ! ).
1 = ( p + 1 p ) n = k = 0 n n k p k ( 1 p ) n k = k = 0 n f B ( k ; n , p ) , f B ( k ; n , p ) = Γ ( n + 1 ) Γ ( k + 1 ) Γ ( n k + 1 ) p k ( 1 p ) n k
The first to look for asymptotic formulas to be used for the approximation of Binomial distribution was De Moivre [16]. Merely approximately 100 years later, Gauss [13] looked over the Gaussian function in an ampler manner ( f G , Equation (2); where a = σ 1 ( 2 π ) 1 / 2 , b = μ , c = σ for Normal distribution, f N in Equation (3)).
f G ( x ; a , b , c ) = a · exp ( x b ) 2 2 c 2
f N ( x ; μ , σ ) = 1 σ ( 2 π ) 1 / 2 exp ( x μ ) 2 2 σ 2 , f N ( x ; μ , σ ) d x = 1
Occurring in most of the natural phenomena, the Gauss distribution is used to model observed data collected on a ratio scale. To elaborate, it is a continuous distribution, which means that it starts from the assumption that there is an infinite diversity in the population of the data, and in between any two distinct values, one more (distinct value) still exists. Anyone should recognize that it is a very strong requirement, since most of the instrumentation is normally trained to collect the data with no more than four significant digits (leading to a universe build up from populations of only thousands of distinct individuals). Nevertheless, sampling (in which the limited instrumentation filters the collected data with a limited number of digits) generally operates on small-sized drawings (even smaller than thousands) from the population. Consequently, the population distribution is actually never reconstituted from any number of repeated samples. In other words, by sampling, Normal distribution is never resampled. In fact, through sampling one sees the population distribution differently (than the one which actually exists). In summary, this is the sampling distribution. For the Gauss distribution, the first to propose its sampling distribution was Gosset [17], and that is Student’s t distribution (Equation (4)).
f t ( x ; ν ) = Γ ( ν + 1 2 ) ( ν π ) 1 / 2 Γ ( ν 2 ) 1 + x 2 ν ν + 1 2
In a universe overwhelmed by its infinity, Gauss distribution is also what a proportion will follow (see Equation (5); see Figure 2—Student’s t and Binomial against Normal).
f N ( x ; 0 , 1 ) f t ( x ; ν ) ν 0 , f N ( x ; n p , n p ( 1 p ) ) f B ( x ; n , p ) n 0
The same problem—asymptotic formulas for very large populations—was addressed in Physics and Chemistry as well, when important progress was being made to the Maxwell–Boltzmann [18,19,20], Bose–Einstein [21,22,23] and Fermi–Dirac [23,24,25] distributions (all discrete, all with “continuity correction”—to borrow the binomial related language—approximations intended to work only for large numbers [26])—but those were very lucky cases, since the population of atoms and molecules is indeed enormous ( N A , about 6 · 10 23 molecules exist in normal conditions in a relatively small amount of one mol of substance; N A —Avogadro’s [27] number). Still, it is very useful to learn how physicists arrived to the continuous case. Thus, extracting relevant equations from [20], the following is a short route:
  • For a closed system with indistinguishable particles and K energy states, the event to observe a certain configuration ( n 1 , , n K ) is a multinomial distribution ([28]; Equation (6)):
    f M ( n 1 , , n K ; p 1 , , p K ) = i = 1 K p i n i i = 1 K n i ! i = 1 K n i !
  • A closed system with no chemical changes [29] is under two constrains, N = i = 1 K n i and E = i = 1 K e i n i ; by maximizing the likelihood [30], according to Lagrange multiplier’s method [31]: ψ ( n i + 1 ) = ln ( p i ) α β e i (where ψ is the digamma function);
  • If n i 1 (see [32]) then ψ ( n i + 1 ) ln ( n i ) n i γ (Euler’s gamma constant [33]) and the discrete Maxwell–Boltzmann distribution of particles by energies is obtained ( p i in Equation (7); where j = 1 K e β e j is the partition function (introducing the entropy [34]).
  • For an ideal gas, the value of a speed component (for instance x) takes (hypothetically) any value from ( , ) , so ( Σ ) continuous Maxwell–Boltzmann distribution of particles by speed components is obtained, which is a Gaussian ( f GMB in Equation (7));
  • Ultimately, for a speed s constituted from J components, the formula for continuous Maxwell–Boltzmann distribution becomes ( f M B J in Equation (7); Equation (29) in [20]):
    p i = n i N e β e i j = 1 K e β e j , f MBG ( x ) = a e b x 2 , f MBJ ( s ; a , J ) = π J / 2 2 J 1 Γ ( J / 2 ) s J 1 a J e π a 2 s 2
However, since at least the sample sizes are finite (if not the populations too), one needs to address the sample size here as well.
To cite Alan Agresti—the (U.S.) Statistician of year 2003—who recommends “using confidence methods for proportions, for the difference between proportions, and for odd ratios in three situations: when a lower bound on a coverage probability (CP) is desired, when an actual CP near the nominal level is desired, and when teaching in a classroom.” Following [35], one could say “this is considered true with ’a certain level of confidence”.
Calling for the use of the exact method for the calculation of the CI at the difference of two binomial proportions, the authors of [36] made progress in a series of studies [37,38,39,40,41], but again, in most of the cases, the inverse problem is needed to find the probability associated with a certain difference or ratio of two proportions [42,43,44,45,46,47].

4. Material and Method

Independently of the fact that the difference of the proportions was expressed in percentages or absolute values, its limits are to be derived from the model of the research question in case. Taking into consideration the case of one proportion, there are three distinct cases (where α is the risk of being in error):
  • Continuous asymptotic (normal) case, when CI is given by the inverse of the cumulative distribution function also called the percent-point function or quantile function: ± σ · z ( α ) (where σ 2 is the variance); for the occurrence of the proportion in a sample of size n, CI is ± σ · z ( α ) / n ;
  • Continuous non-asymptotic (student) case, proportion coming from a measurement through sampling of size m, when CI is given with Student t-value instead of the z-value: ± σ · t ( α , m ) ; for the incidence in a sample of size n, CI is ± σ · t ( α , m ) / n ;
  • Discrete case, when a proportion comes from a sample in a (no matter how large) population, one needs to know the value of the binomial variable (x) and the sample size (m) in order to express its CI; it always becomes suitable to use the binomial distributed CI in the calculation; one of the first proposed CI is in [48] ( I n v C D F β ( 1 α / 2 , r + 1 , m r ) , where f β ( x ; α 1 , α 2 ) = Γ ( α 1 + α 2 ) · Γ ( α 1 ) 1 · Γ ( α 2 ) 1 · x α 1 1 · ( 1 x ) α 2 1 ), and I n v C D F β is its inverse—providing a CI at least as large as it is supposed to be and being most of the time too large; since the discreteness transforms the matter of integration (back) into a matter of summation and the calculation of each CI is a problem of combinatorics; there is no unique solution. One alternative is given in [9] and another one in [49], both of those alternatives have no analytical formula, only recipes (algorithms) leading to the solution.
Thus, when a difference of two proportions is done, it is actually a full factorial design of the cases given above, each of the two proportions possibly falling in one of the three categories given above.
  • At least one continuous asymptotic (normal) case. When comparing two true values in a (very) large population (of an unknown size), then both proportions fall into the asymptotic continuous case; it may be suitable to use the z-value in the calculation (for studies involving z-value, z-statistics, z-test, see [50,51,52,53]);
  • At least one continuous non-asymptotic (student) case. When comparing two true values obtained from a large number of repeated samplings (of known size) in a (very) large population, then both proportions fall into the continuous but not asymptotic case; it is much more suitable (than the call for the previous case) to use the Student t-value (for some typical cases, see [54,55,56,57]);
  • 2 × 2 discrete asymptotic case. When comparing with a true value in a (very) large population (of an known or unknown size), it is a typical case of involving an asymptotic method (see the methods given in [58,59,60]);
  • 2 × 2 discrete case. In most of the cases, the results compared are coming from two samples (of necessary known sizes), when actually a bidimensional binomial distribution is involved and the probability for the difference is to be calculated from it [36]. This case is detailed in the next paragraph and in the remainder of the paper.
Under different arrangements (see a different arrangement in [61]), a contingency table ([62,63]; a confusion matrix in [64]; an error matrix in [65]) collects observed frequencies at the contingency of two multinomial distributed variables. The simplest case, 2 × 2 contingency, is for two dichotomies (fourfold table in [63]; 2 × 2 table in [66]).
The 2 × 2 contingencies are used in at least two different contexts (see Figure 3).
Any repeated draw u from the population in respect to the sample S1 (see Equation (1); see Figure 3) has a probability of occurrence f S 1 , and f S 2 for v in respect to S2 (Equation (8)).
f BS ( w ; z , o ) = o ! z ! ( o z ) ! z o w 1 z o o w , f S 1 f BS ( u ; x , m ) , f S 2 = f BS ( v ; y , n )
A replica ( u / m , v / n ) of the binomial experiment ( x / m , y / n ) will be produced with a probability (which is the bivariate binomial, with a probability given by the product of the two binomial probabilities f S 1 and f S 2 ), Equation (9):
f B 2 E ( u , v ; x , y , m , n ) = m ! u ! ( m u ) ! x m u 1 x m m u n ! v ! ( n v ) ! y n v 1 y n n v
Equation (9) can be perceived by some as slightly intimidating, but it actually expresses a state of facts: any event involving u and v as possible outcomes has a conditional probability of the already observed (x and y) outcomes.
Excess risk (ER, Equation (10)), Odds ratio (OR, Equation (11)) and Relative risk (RR, Equation (12)) are algebraic expressions of the two proportions ( x / m and y / n ) followed up in the study (Figure 3):
E R = E R ( x , y ; m , n ) = x m y n ,
O R = O R ( x , y ; m , n ) = x ( n y ) y ( m x ) ,
R R = R R ( x , y ; m , n ) = x n y m
Since the samples are independent draws from the population, with no further means to provide estimates of the characteristics of interest in the population (the x / m and y / n proportions, are of positive outcomes, and are the characteristics of interest), each of the two proportions ( x / m and y / n ) comes from typically binomial distributed variables (outcome x having as domain { 0 , 1 , , m } and outcome y having as domain { 0 , 1 , , n } ) and, thus, each follows a binomial distribution while together they generate a bidimensional (or bivariate) binomial distribution.
There are essential differences between the concepts. The absolute risk reduction reflects the probability of getting a disease in the first place, for instance, while reporting only relative risk reduction, one would run into the risk that readers exaggerate the effectiveness of a treatment [67].

5. Results and Discussion

As given in the Research design schema (Figure 1), the solution to the confidence interval and/or p-value problem should always follow a series of steps.
Calculation of the CI for the discrete case is a problem of combinatorics. Therefore, a paramount issue is to have an efficient (in terms of the execution time) and accurate (in terms of the calculation errors) algorithm for the calculation of the probability from a bivariate binomial distribution (Equation (10)). Several variants were tried and several strategies were tested. Below are given some acquired tips:
  • It is not efficient to directly evaluate Equation (10); the complexity of the evaluation is O ( m 2 n 2 ) and, for large values of the samples sizes (m and n), one will never see the result of the direct evaluation of Equation (10) (if for m = n = 100 the evaluation takes 4 s, then for m = n = 10,000, it takes 40,000 s, which is over 11 h);
  • It is not advisable to blindly use a recursion formula either (see, for example, the recursion formulas below, Equation (13)); for instance, for m = n = 300, x = 15 and y = 30, by using a recursion formula starting from f B 2 E ( m , n ; x , y , m , n ) and going to f B 2 E ( 0 , 0 ; x , y , m , n ) by using a series of recursion formulas (such as the ones in Equation (13)), one will evaluate everything to 0 in a double (8 bytes, 64 bits) floating point precision for the simple reason that f B 2 E ( m , n ; x , y , m , n ) is already lower ( 4.9 · 10 691 ) than the lowest absolute value on the scale ( 4.9 · 10 324 ) and is evaluated to 0 on any platform operating on IEEE 754 double-storage format;
  • It is inefficient to use the general formula Equation (10) for the evaluation since for each u (or v) the same half-part f BS ( u ; x , m ) (or f BS ( v ; y , n ) , respectively) of it is used m (or n, respectively) times, thus inducing an inflation of the calculations by m (or n, respectively) times; it is much more convenient to evaluate (and store) the f BS ( u ; x , m ) and f BS ( v ; y , n ) probabilities first, and later to simply multiply them ( f B 2 E ( u , v ; x , y , m , n ) f BS ( u ; x , m ) · f BS ( v ; y , n ) ).
A major observation is that f B 2 E ( u , v ; x , y , m , n ) is at maximum when u = x and v = y and this maximum is still a subunitary number. Thus, independently of the magnitude of the sample sizes, the probability will be concentrated around the point of the coordinates ( x , y ) located in the { 0 , 1 , , m } × { 0 , 1 , , n } grid. Therefore, an iterative evaluation (of f BS ( u ; x , m ) and f BS ( v ; y , n ) probabilities, see above) beginning from ( x , y ) and iterating (descending) to ( 0 , 0 ) and (ascending to) (m, n) will propagate through repeated multiplications and divisions the smallest amount of error in the most significant part of the probability (see Figure 4). Thus, both of the following recurrences are used (Equation (13)):
f BS ( u ; x , m ) = f BS ( u 1 ; x , m ) x ( m u + 1 ) u ( m x ) , f BS ( u ; x , m ) = f BS ( u + 1 ; x , m ) ( m x ) ( u + 1 ) x ( m u ) f BS ( v ; y , n ) = f BS ( v 1 ; y , n ) y ( n v + 1 ) v ( n y ) , f BS ( v ; y , n ) = f BS ( v + 1 ; y , n ) ( n y ) ( v + 1 ) y ( n v )

5.1. The Expressions of Two Binomials and Their CIs

Following up the notation from Figure 3, x defines the number of successes occurring in a number of m successive draws from a population, while y defines the number of successes occurring in a number of n successive draws. The bridge between the two is the population, supposedly being the same, each of the two experiments following a different characteristic of interest. Therefore, each sample comes from a binomial experiment, while together they form a bidimensional or bivariate binomial experiment.
A draw in the sample S1 (or in any of its replica; following up one characteristic in the population) is independent from a draw in the sample S2 (or in any of its replica; following up (the) other characteristic in the population). Thus, if ( u , v , m , n ) is a replica of the ( x , y , m , n ) experiment, then it is safely decomposed in two binomial ones, ( u , m ) as replica of ( x , m ) (having m + 1 possible outcomes, from u = 0 to u = m ), and ( v , n ) as replica of ( y , n ) (having n + 1 possible outcomes, from u = 0 to u = m ), each event having associated a probability (see Table 1).
One should know that following the design of Table 1, the CI will be provided for the sampled (the one collected in the 2 × 2 contingency, see Figure 3) with no assumption of the expected value in the population, or, more importantly, if the population is finite or infinite (usually an assumption leading to ’asymptotic CIs’). Turning back to the Gauss vs. Student challenge from the beginning of this paper (Equation (3) vs. Equation (4)), one could say that what is proposed in this case is a Student-type correction (for a finite repeated resampling) against an infinite (size) Gauss sampling.
An example will be provided and continued below. For x = 2 , y = 1 , m = 6 and n = 4 as a particular case of a bivariate binomial experiment, the probability mass functions are given in Table 2.
Probability mass functions for expressions of two proportions. If B 2 E ( x , y , m , n ) is the bivariate binomial experiment, then it has ( m + 1 ) × ( n + 1 ) possible outcomes (not necessarily seen distinctly through an evaluation function as the ones given in Equations (10)–(12) but necessary), each controlled by a probability given by f B 2 E ( u , v ; x , y , m , n ) . A list of ( m + 1 ) × ( n + 1 ) paired values should be collected at this stage. By using a simplified notation: f 1 , 2 ( u , v ) = f B 2 E ( u , v ; x , y , m , n ) and h 1 , 2 ( x , y ) = F 2 ( x , y , m , n ) , where F 2 ( x , y , m , n ) is a generic notation for any expression involving two binomial proportions (including the ones given in Equations (10)–(12)), the result of the pairing is as given below (Equation (14)):
{ ( h 1 , 2 ( 0 , 0 ) , f 1 , 2 ( 0 , 0 ) , , ( h 1 , 2 ( 0 , v ) , f 1 , 2 ( 0 , v ) ) , , ( h 1 , 2 ( 0 , n ) , f 1 , 2 ( 0 , n ) ) , ( h 1 , 2 ( u , 0 ) , f 1 , 2 ( u , 0 ) ) , . , ( h 1 , 2 ( u , v ) , f 1 , 2 ( u , v ) ) , , ( h 1 , 2 ( u , n ) , f 1 , 2 ( u , n ) ) , ( h 1 , 2 ( m , 0 ) , f 1 , 2 ( m , 0 ) ) , , ( h 1 , 2 ( m , v ) , f 1 , 2 ( m , v ) ) , , ( h 1 , 2 ( m , n ) , f 1 , 2 ( m , n ) ) }
Following up the example in Table 2, the Appendix Table A1 gives the ER and their associated probabilities while Table A2 and Table A3 do the same for OR and RR.
It may be stated (as a Theorem) that, in the previously given list, for any equation from (10) to (12), there is always a duplicate but the proof is immediate if one checks that E R ( 0 , 0 , m , n ) = 0 = E R ( m , n , m , n ) (for ER), O R ( 0 , v , m , n ) = 0 = O R ( u , n , m , n ) (for OR, for any u , v 0 ), and R R ( 0 , v , m , n ) = 0 (for RR, for any v 0 ). Undoubtedly, the number of the duplicates is favored by the common factors in the values of the sample sizes. It can be effortlessly proved that in the same list above there are at least 2 · max ( m , n ) values (and the minimum is reached when m = n ). This fact supports the necessity of grouping (of the above given pairs) by the value of calculated expression ( h 1 , 2 function above) when the probabilities ( f 1 , 2 function above) are summed. To ease up the grouping process, but also as is needed later, the resulted list of pairs is sorted (ascending) by the values of the calculated expression. At this point, it is no longer relevant which values of the freshly sampled binomial variates (u and v) produced the outcomes; thus, the values in this new list are labeled by their position (from 1 to k, k being the number of h 1 , 2 ( u , v ) distinct values), Equation (15):
{ ( h 1 , f 1 ) , , ( h k , f k ) }
The grouping and sorting for the example case is illustrated in Table A4 for ER, in Table A5 for OR and Table A6 for RR (to be found in the Appendix A).
Cumulative distribution functions and CIs. Equation (15) (illustrated for the selected case in Table A4, Table A5 and Table A6) is the cornerstone for any CI evaluation associated with any expression of two binomial proportions (including Equations (10)–(12)). Thus,
  • If one wants a CI of α (say, 5%) risk of being in error, then it may start from the pair cumulating the probability for u = x and v = y (it will always be a unique entry for it in ( h i , f i ) , i = 1 , , k list, the one for which h i is the irreducible fraction of the expression subjected to analysis). Let’s label that index with i 0 (for instance i 0 = 13 in Table A4 since ER( 2 , 6 , 1 , 4 ) = 1 12 , i 0 = 10 in Table A5 since OR( 2 , 1 , 6 , 4 ) = 3 2 , and i 0 = 12 in Table A6 since RR( 2 , 1 , 6 , 4 ) = 4 3 ). Let us use a variable to cumulate the probability, p i 1 , i 2 ( p i 1 , i 2 0 ). The open interval ( h i 0 1 , h i 0 + 1 ) contains exactly one possibility (when u = x and v = y ) and has the probability to appear f i 0 ; thus, p i 1 , i 2 p i 1 , i 2 + f i 0 . By using two pointers ( i 1 i 0 and i 2 i 0 ) to move down ( i 1 i 1 1 ) and up ( i 2 i 2 + 1 ) the CI ( h i 1 , h i 2 ) is expanded (when i 1 i 1 1 also p i 1 , i 2 p i 1 , i 2 + f i 1 , and when i 2 i 2 + 1 also p i 1 , i 2 p i 1 , i 2 + f i 2 ) until (and no further than) 1 p i 1 , i 2 < α . Regarding the data given in Table A4, Table A5 and Table A6 as example, the 1 α CI is to be obtained (in each case) by summing the f i values for a block delimited by two boundaries; all the work is exemplified in the (next) series of three tables (Table 3 and Table A8).
  • In order to gain a better understanding, another case is added here: the list of the successive expanding of the CI along with its CP. This is essentially the previous case with no stop limit and it is a more convenient arrangement of the data from Equation (15). Reviewing the described algorithm (Equation (16)):
    f L i 1 L i 0 1 f i 1 , f U i 2 i 0 + 1 U f i 2 , C I L , U [ h L , h U ] , p L , U f L + f i 0 + f U
    The example case listed in Table A4 (excess risk) is continued with the result of the above given recipe in Table 3. Examining entry 14 in Table 3, any interval between [ 7 12 , 1 2 ] and ( 2 3 , 7 12 ) will produce the closest to (and greater than) the 95% (probability) coverage (which is about 95.40%, see entry 14 in Table 3); similarly, if one wants a 2% risk of being in error (a 98% CI), one should look to the entry 16 in Table 3; if 1% is the accepted level of risk of being in error, then the answer is on line 18 in Table 3 and, finally, for 1‰the answer is in line 21 in Table 3.
    Moving on to the example cases listed in the appendix in Table A5 (OR) and in Table A6 (RR), the results of the above given recipe are listed in Table A7 and Table A8, respectively (in the appendix too). For both (OR and RR of (x = 2, y = 1, m = 6, n = 4) configuration), the CI at no more than 5% risk of being in error is identical with the ones at 2%, 1% and 1‱ covering all possible cases, [ 0 , ] (see entries 15 and 16 in Table A7 and 16 and 17 in Table A8).
  • If someone wants to assess the probability of a no excess risk (ER, Equation (10), data arranged as in Equation (15)), that is the probability to pass through 0 trying to express the confidence; that is, in a much common language, the probability to be different from 0; then, the results given in the form of Equation (16) must be inspected. If ER ( x n y m m n ) is positive, then any positive h i ( u n v m m n ) will satisfy the requirement and the associated probability is h i > 0 f i and if ER < 0, then any h i < 0 will satisfy the requirement and the probability is h i < 0 f i . Inspecting Table 3, the last interval not containing 0 is at entry (iteration) 4, and its CP is 44.07%; the first interval containing 0 is at entry 5 in Table 3 and its CP is 51.47%; since the case of being 0 is the undesired, one should be excluded and, thus, the probability (for the excess risk, calculated at 1 12 , to be different from 0 for (x = 2, y = 1, m = 6, n = 4) configuration) is the one given at entry 4 in Table 3, 44.07%.
  • Similarly, if someone wants to assess the probability of different odds (OR, Equation (11), data arranged as in Equation (15)), then again the results given in the form of Equation (16) must be inspected. If OR > 1, then any h i > 1 will satisfy the requirement and the associated probability is h i > 1 f i and if OR < 1, then any h i < 1 will satisfy the requirement and the probability is h i < 1 f i . Inspecting Table A7, the last interval not containing 1 is at entry (iteration) 0, and its CP is 13.89%, thus giving a probability (for the OR, calculated at 3 2 , to be greater than 1 for (x = 2, y = 1, m = 6, n = 4) configuration) of 13.89%.
  • The same is for a non-equal risk (RR, Equation (12), data arranged as in Equation (15)), the results given in Equation (16) providing the answer. If RR > 1, then any h i > 1 will satisfy the requirement and the probability is h i > 1 f i and if RR < 1, then any h i < 1 will satisfy the requirement and the probability is h i < 1 f i . Inspecting Table A8, for the RR calculated at 4 3 , the last interval not containing 1 is at entry (iteration) 1, thus giving a probability (for RR > 1 for the (x = 2, y = 1, m = 6, n = 4) configuration) of 15.98%.

5.2. The Needed Algorithms for CIs of the Expressions of Two Proportions

Each step leading to the CIs for the expressions of two proportions is rigorously controlled by an algorithm. In this section, the five algorithms (Algorithms 1–5) are discussed and used to provide the results for x = 2, y = 1, m = 6 and n = 4 example. Thus,
  • Algorithm 1 calculates the binomial probability mass function; the results of B ( 2 , 6 , b 1 ) and B ( 1 , 4 , b 2 ) (B ( z , o , r ) in Algorithm 1) are in Table 2;
  • Algorithm 2 calculates the ER (Equation (10), E R ( x , y , m , n , c , d ) ), (OR (Equation (11), with O R ( x , y , m , n , c , d ) ), and RR (Equation (12), with R R ( x , y , m , n , c , d ) ) as irreducible fractions (with F R ( a , b , c , d ) ) used in Algorithm 3 and later in succession with Algorithm 5; E R ( 2 , 1 , 6 , 4 , c , d ) evaluates the ER with c d at c = 1 and d = 12 ; O R ( 2 , 1 , 6 , 4 , c , d ) evaluates the OR with c d at c = 3 and d = 2 ; R R ( 2 , 1 , 6 , 4 , c , d ) evaluates the RR with c d at c = 4 and d = 3 ;
  • Algorithm 3 collects all possible drawings from the bivariate binomial distribution and pairs the probabilities with one (at the time) defined function operating on binomial proportion; the output of B 2 F ( x , y , m , n , F , p , g , h ) is a ( m + 1 ) × ( n + 1 ) entries list (Equation (14)); the output of B 2 F ( 2 , 1 , 6 , 4 , F , p , g , h ) for F ← ER is listed in Table A1, F ← OR in Table A2, and F ← RR in Table A3;
  • Algorithm 4 with PMF_B2E(k,p,g,h) sorts and groups values and their associated probabilities; an output of it is formally given in Equation (15). Through it, data from Table A1 become the data in Table A4, from Table A2 to Table A5, and from Table A3 to Table A6;
  • Algorithm 5 constructs CIs in increasing coverage and its output is formally given as Equation (16); the result of the evaluation of C I _ B 2 E ( n u , d e , k , p , g , h ) of the data in Table A4 (with n u = 1 , d e = 12 ) is listed in Table 3, of the data in Table A5 (with n u = 3 , d e = 2 ) in Table A7 and of the data in Table A6 (with n u = 4 , d e = 3 ) in Table A8.
In order to provide the desired output, the algorithms need to be chained together properly. Thus,
  • So as to evaluate the ER (Equation (10)) for a certain ( x , y , m , n ) contingency (Figure 3), one should follow the sequence: B 2 F ( x , y , m , n , E R , p , g , h ) ; m n ( m + 1 ) · ( n + 1 ) ; P M F _ B 2 E ( m n , p , g , h ) ; E R ( x , y , m , n , r 1 , r 2 ) ; C I _ B 2 E ( r 1 , r 2 , m n , p , g , h , c i ) having then as output ( c i ) all the information required to construct Table 3;
  • Similarly, in order to evaluate the OR (Equation (11)) for ( x , y , m , n ) contingency, one should follow the sequence: B 2 F ( x , y , m , n , O R , p , g , h ) ; m n ( m + 1 ) · ( n + 1 ) ; P M F _ B 2 E ( m n , p , g , h ) ; O R ( x , y , m , n , r 1 , r 2 ) ; C I _ B 2 E ( r 1 , r 2 , m n , p , g , h , c i ) having then as output ( c i ) all the information required to construct Table A7;
  • Finally, in order to evaluate the RR (Equation (11)) for ( x , y , m , n ) the observed configuration, one should successively: B 2 F ( x , y , m , n , R R , p , g , h ) ; m n ( m + 1 ) · ( n + 1 ) ; P M F _ B 2 E ( m n , p , g , h ) ; R R ( x , y , m , n , r 1 , r 2 ) ; C I _ B 2 E ( r 1 , r 2 , m n , p , g , h , c i ) , when the output ( c i ) is all the information required to construct Table A8.

5.3. Properties of the CIs

Some common beliefs about the CIs are that they should be larger in the middle (largest for values of x and y in the middle of { 0 , , m } and { 0 , , n } , respectively), shorter at the ends (shortest for x = 0 , m and y = 0 , n ). In addition, they become shorter with the increase of the sample size (true if divided by the sample size), and their ends to be monotonic (slightly more complicated to keep the score here). As expected, most of the beliefs are true, but, even more so, some special properties were identified for the CIs. Thus, if C I ER , α ( x , y , m , n ) = [ C I L ER , α ( x , y , m , n ) , C I U ER , α ( x , y , m , n ) ] (here the property is stated for the minimal CI, MinCI in Table 3 but is as well as true for the maximal one, MaxCI in Table 3), then C I L ER , α ( x , y , m , n ) + C I U ER , α ( m x , n y , m , n ) = 0 and C I U ER , α ( x , y , m , n ) + C I L ER , α ( m x , n y , m , n ) = 0 such that one could say that it is an odd function (in (m, n) modulo for (x, y)) and possessing in the middle some sort of antisymmetry too (see (3, 2) cell in Figure 5). This is an expected property since the excess risk itself possesses the same property ( ER ( x , y , m , n ) + ER ( m x , n y , m , n ) = 0) and the construction of the CI (see the iteration for p [ i 1 1 ] = p [ i 2 + 1 ] in Algorithm 5) gives the same chance to the bounds to be expanded.
A similar property possesses OR too (see Figure 6) but not RR (see Figure 7).
For the OR (see Figure 6) if [ C I L 0 OR , α ( x , y , m , n ) C I L 1 OR , α ( x , y , m , n ) , C I U 0 OR , α ( x , y , m , n ) C I U 1 OR , α ( x , y , m , n ) ] is the (minimal, see Table A7; the same applies for the maximal) CI for the OR in the ( x , y , m , n ) bivariate binomial experiment, then C I L 0 OR , α ( x , y , m , n ) = C I U 1 OR , α ( m x , m y , m , n ) and C I L 1 OR , α ( x , y , m , n ) = C I U 0 OR , α ( m x , m y , m , n ) as well as C I U 0 OR , α ( x , y , m , n ) = C I L 1 OR , α ( m x , n y , m , n ) and C I U 1 OR , α ( x , y , m , n ) = C I L 0 OR , α ( m x , n y , m , n ) such that the multiplication between C I L 0 OR , α ( x , y , m , n ) C I L 1 OR , α ( x , y , m , n ) and C I U 0 OR , α ( m x , n y , m , n ) C I U 1 OR , α ( m x , n y , m , n ) is formally 1 (and as well for C I U 0 OR , α ( x , y , m , n ) C I U 1 OR , α ( x , y , m , n ) and C I L 0 OR , α ( m x , n y , m , n ) C I L 1 OR , α ( m x , n y , m , n ) ). A simple check shows that this property is consistent with the property of OR: OR( x , y , m , n ) · OR( m x , n y , m , n ) = 1.
For small sample sizes (such as n = 4 and m = 6 from the selected example), the difference between the imposed level ( α ) of being in error and the actual level of being in error can be big (see Figure 8, Figure 9 and Figure 10; but also cannot be bigger than the imposed level).
Figure 8, Figure 9 and Figure 10 show the real (actual) risks of being in error in constructing the CIs of ER (Figure 8), OR (Figure 9) and RR (Figure 10) for the selected example (CIs in Figure 5, Figure 6 and Figure 7). Since the process of constructing the CI is completely controlled (Algorithm 5), selecting the CI is easily set such that the actual error is the closest and smaller choice to the imposed level (see entry 14 in Table 3, entry 16 in Table A7 and entry 17 in Table A8). The difference between the imposed and actual level of being in error is dramatically diminished with the increase of the samples sizes. For comparison (with Figure 8), the next figure is given (Figure 11) in which it is visible that big departures (equal with the imposed level) occur only in the corners ( x = 0 , m and y = 0 , n ) while the vast majority of the actual errors is in the [4.5%, 5.0%] range.
To be more precise, over 87% of the cases in the x , y , m = 60 , n = 50 group of binomial experiment configurations depicted in Figure 11 have actual non-coverage probabilities in the [4.5%, 5.0%] range and about 95% of the cases have actual non-coverage probabilities in the [4.0%, 5.0%] range (2955 out of 3111 to be exact, the blue bullets in Figure 11).
There is no significant change in the shape of the actual coverage when changing from ER (Figure 11) to OR (Figure 12) and RR (Figure 13). For the ORs of x , y , m = 60 , n = 50 group of binomial experiments depicted in Figure 12, the actual non-CPs fall in the [4.5%, 5.0%] range for 2775 cases (out of 3111, about 89%) and 2883 (over 92%) fall in the [4.0%, 5.0%] range (the blue bullets in Figure 12) while for the RRs (depicted in Figure 13), 2505 cases (about 80%) fall in the [4.5%, 5.0%] range and 2834 cases (about 91%) fall in the [4.0%, 5.0%] range (the blue bullets in Figure 13).
Considering that 220 cases from the x , y , m = 60 , n = 50 group of binomial experiments have either x or y at the limits (0 or m and n, respectively) for which the non-coverage is very poor (only in 4 cases, CI at the limits for OR is in the [4.0%, 5.0%] range and in 62 for RR), for the rest of the cases ( x { 1 , , m } , y { 1 , , n } ), the accuracy is very good.

5.4. General Discussion

When dealing with finite populations, sampling strategy is foundational. Essentially, after extracting an individual (case) from a population, one can choose to put it back in the population (having a non-null likelihood to be extracted again in the future), or to throw it out. When the individual is returned to the population, a sampling with replacement is conducted, while when it is not returned to the population, a sampling without replacement is conducted.
Sampling with replacement is the one leading to the binomial distribution (by following a Bernoulli trial, counting successes vs. failures; given in Equation (1)). The alternative, sampling without replacement, leads to the hypergeometric distribution (Equation (17)).
f H ( k ; n , K , N ) K k N K n k N n
When sampling without replacement (Equation (17)) the population (of size N in Equation (17)) is constantly diminished, so its size as well as the number of successes in the population (K) matters for the sample too (n—size; k—successes). Fisher has shown [68] that under sampling without replacement, the bivariate binomial experiment is transformed into a hypergeometric one; population is the union of the two samples. One alternative is to engage the sampling without replacement to extract from the population ( N m + n ) the first sample ( K m ) when sampling brings out from the total number of successes ( n x + y ) the successes from the (first) sample k x , when the probability (Fisher, f F ) to observe ( x , y , m , n ) experimental configuration is given in Equation (18).
f F ( x ; y , m , n ) f H ( x ; x + y , m , m + n ) = ( x + y ) ! ( m + n x y ) ! m ! n ! x ! ( m x ) ! y ! ( n y ) ! ( m + n ) !
It must be noted that Equation (18) is symmetrical in a = x , b = y , c = m x , d = n y , which means that there exists an alternative way of engaging the sampling without replacement to extract from the population ( N m + n ) the same number (x) of successes. Sampling without replacement introduces a supplementary constraint to the experiment, such that dimensionality is reduced to 1 (Equation (19), Fisher Exact) and u ranges from 0 to min ( m , n , x + y , m + n x y ) :
f F E ( u ; x , y , m , n ) ( x + y ) ! ( m + n x y ) ! m ! n ! u ! ( m u ) ! ( x + y u ) ! ( n + u x y ) ! ( m + n ) !
One should notice that by substituting x with u and y with v in Equation (18), the right expression in Equation (18) becomes: ( u + v ) ! ( m + n u v ) ! m ! n ! u ! ( m u ) ! v ! ( n v ) ! ( m + n ) ! and up to this point, two constrains have been used: the number of trials (draws) in the first experiment is m, and the number of trials (draws) in the second experiment is n; the supplementary constraint mentioned before is x + y = u + v , which when used leads to Equation (19). Fisher was the first to notice that the significance level is build up from the cases where the arrangement is as extreme as the observed arrangement, or more so. Some authors suggest that, when changing from evaluation of ER to OR or RR, to also change (see §1 in [61]) the study design and its associated statistical analysis (for Fisher Exact, see [69]) while others keep the bivariate binomial assumption even when some data are missing (see §2 in [70]). It is possible to argue that changing from m and n to m + n does not change the nature of the phenomena (successions of Bernoulli trials) nor the independence between the samples; thus, Equation (9) is slightly changed replacing n and m with m + n everywhere, but the increase of the cases leads to the increase in density of the points inside of the domain of the evaluated function and has as effect the increase of the CIs accuracy as well (for instance, for the case depicted in Figure 11, the increase is from 2995 to 3072 cases out of 3111 falling in the [4%, 5%] range).
Drawing with or without replacement from an infinite population should produce the same effect.
The proposed methodology (see Section 2, Section 5.1 and Section 5.2) is not significantly changed when the distribution is changed. Independent of the distribution, the methodology is:
  • To collect all possible drawings and their associated probabilities (by using a possibly modified form of B 2 F ( x , y , m , n , F , p , g , h ) from Algorithm 3) for one (at the time) defined function F (ER, Equation (10), E R ( x , y , m , n , c , d ) ; OR, Equation (11), O R ( x , y , m , n , c , d ) ; RR, Equation (12), R R ( x , y , m , n , c , d ) –all defined in Algorithm 2); the result is formally defined by Equation (14);
  • Sort and group values and their associated probabilities (construct the probability mass function with PMF_B2E(k,p,g,h) from Algorithm 4); the result is formally defined by Equation (15);
  • Construct the cumulative distribution function from which the CIs in increasing coverage (with n u and d e from the evaluation of the selected (one of ER, OR, and RR) defined function (with C I _ B 2 E ( n u , d e , k , p , g , h ) from Algorithm 5); the result is formally defined by Equation (16).
In order to showcase the invariance of the strategy when the distribution is changed and to illustrate the alternating behavior of the actual non-CP, teeth-like plots, preferred by some authors (see Figure 4 in [8]), the actual non-CP calculated for the m = 9 and n = 11 group of experiment configurations (x from 0 to m and y from 0 to n) is depicted for three scenarios (Figure 14, Figure 15 and Figure 16) as function of the excess risk ( x / m y / n ) when the imposed level of the non-CP was set to 5%.
Inspecting the Figure 14, Figure 15 and Figure 16, it is noticeable that the symmetry is kept in Figure 14 and Figure 16. Additionally, since the coverage and non-coverage probabilities are cumulative from different number of cases, the accuracy of the coverage is different and it is improved by the number of draws (about 4.2% for the data in Figure 15, 52,920 = 10 · 12 · 21 2 draws; about 3.66% for the data in Figure 14, 14,400 = 10 2 · 12 2 draws; about 2.02% for the data in Figure 16, 1200 = 10 · 12 · 10 draws).
The calculation of the exact CIs is of interest for other expressions of two proportions as well [71]. For a recent review of expressions involving two binomial proportions, one should consult [72], and when stratification is involved [73].

6. Conclusions

A strategy for providing exact confidence intervals for expressions of binomial proportions is elaborated (Figure 1). Algorithms for calculating the confidence intervals and/or p-values in the case of excess risk, odds ratio and relative risk are given (Algorithms 1–5) and exemplified. Extension of the findings for other distributions (continuous: Student t, Gaussian Normal; discrete: hypergeometric, joined samples binomial) is discussed.

Funding

This research has received funding for open access publishing from the author’s employer, Technical University of Cluj-Napoca.

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

Not applicable.

Acknowledgments

To Alan Gilbert Agresti for making the statistical analysis of binomial distributed proportions and their contingency more interesting than ever.

Conflicts of Interest

The author declares no conflict of interest. The funder had no role in the design of the study; in the collection, analyses, or interpretation of data; in the writing of the manuscript, or in the decision to publish the results.

Sample Availability

Not applicable.

Appendix A

In Table A1, Table A2, Table A3, Table A4, Table A5 and Table A6, the probabilities are given with three significant figures. However, the calculations and the actual values must be done with machine-like precision.
In Table A1, ERs ( h 1 , 2 ) are given as raw (non-evaluated) data (Equation (10)) to better reflect each distinct possibility; distinct values of the ERs are about two thirds (see Table A4). It must be noted that, for instance, 0 6 2 4 = 3 6 4 4 = 1 2 . In Table A2, ORs ( h 1 , 2 ) are given as raw (non-evaluated) data (Equation (11)) to better reflect each distinct possibility; distinct values of the ORs are about half (see Table A5). In Table A3, the RRs ( h 1 , 2 ) are given as raw (non-evaluated) data (Equation (12)) to better reflect each distinct possibility; distinct values of the RRs are about half (see Table A6).
In Table A4, ERs, in Table A5, ORs and in Table A6, the h j columns are given as irreducible fractions while associated probabilities (the f j columns) are the sums of the probabilities given in Table A1, Table A2 and Table A3 for each Table A4, Table A5 and Table A6 group member.
For instance, in Table A4, f 6 ( 1.94 · 10 2 ) is the sum of 8.57 · 10 4 (in the cell for u = 3 and v = 4 in Table A1) and 1.85 · 10 2 (in the cell for u = 0 and v = 2 in Table A1).
In Table A7 and Table A8, i is Iteration, M i n C I is the smallest possible CI for the given CP and is always closed, M a x C I is the largest possible CI for the given CP and is open whenever is possible, and p C I is CP. The probabilities are given with four significant figures but however, the calculations and the actual values must be done with machine-like precision. The CI boundaries are given as irreducible fractions, and also for convenience, the integer fraction is reduced.
Table A1. Pairs of possible ERs and their associated probabilities ( h 1 , 2 , f 1 , 2 ) for the data in Table 2.
Table A1. Pairs of possible ERs and their associated probabilities ( h 1 , 2 , f 1 , 2 ) for the data in Table 2.
u vs. v01234
0( 0 6 0 4 , 2.78 · 10 2 )( 0 6 1 4 , 3.70 · 10 2 )( 0 6 2 4 , 1.85 · 10 2 )( 0 6 3 4 , 4.12 · 10 3 )( 0 6 4 4 , 3.43 · 10 4 )
1( 1 6 0 4 , 8.33 · 10 2 )( 1 6 1 4 , 1.11 · 10 1 )( 1 6 2 4 , 5.56 · 10 2 )( 1 6 3 4 , 1.23 · 10 2 )( 1 6 4 4 , 1.03 · 10 3 )
2( 2 6 0 4 , 1.04 · 10 1 )( 2 6 1 4 , 1.39 · 10 1 )( 2 6 2 4 , 6.94 · 10 2 )( 2 6 3 4 , 1.54 · 10 2 )( 2 6 4 4 , 1.29 · 10 3 )
3( 3 6 0 4 , 6.94 · 10 2 )( 3 6 1 4 , 9.26 · 10 2 )( 3 6 2 4 , 4.63 · 10 2 )( 3 6 3 4 , 1.03 · 10 2 )( 3 6 4 4 , 8.57 · 10 4 )
4( 4 6 0 4 , 2.60 · 10 2 )( 4 6 1 4 , 3.47 · 10 2 )( 4 6 2 4 , 1.74 · 10 2 )( 4 6 3 4 , 3.86 · 10 3 )( 4 6 4 4 , 3.22 · 10 4 )
5( 5 6 0 4 , 5.21 · 10 3 )( 5 6 1 4 , 6.94 · 10 3 )( 5 6 2 4 , 3.47 · 10 3 )( 5 6 3 4 , 7.72 · 10 4 )( 5 6 4 4 , 6.43 · 10 5 )
6( 6 6 0 4 , 4.34 · 10 4 )( 6 6 1 4 , 5.79 · 10 4 )( 6 6 2 4 , 2.89 · 10 4 )( 6 6 3 4 , 6.43 · 10 5 )( 6 6 4 4 , 5.36 · 10 6 )
Table A2. Pairs of possible ORs and their associated probabilities ( h 1 , 2 , f 1 , 2 ) for the data in Table 2.
Table A2. Pairs of possible ORs and their associated probabilities ( h 1 , 2 , f 1 , 2 ) for the data in Table 2.
u vs. v01234
0( 0 4 0 6 , 2.78 · 10 2 )( 0 3 1 6 , 3.70 · 10 2 )( 0 2 2 6 , 1.85 · 10 2 )( 0 1 3 6 , 4.12 · 10 3 )( 0 0 4 6 , 3.43 · 10 4 )
1( 1 4 0 5 , 8.33 · 10 2 )( 1 3 1 5 , 1.11 · 10 1 )( 1 2 2 5 , 5.56 · 10 2 )( 1 1 3 5 , 1.23 · 10 2 )( 1 0 4 5 , 1.03 · 10 3 )
2( 2 4 0 4 , 1.04 · 10 1 )( 2 3 1 4 , 1.39 · 10 1 )( 2 2 2 4 , 6.94 · 10 2 )( 2 1 3 4 , 1.54 · 10 2 )( 2 0 4 4 , 1.29 · 10 3 )
3( 3 4 0 3 , 6.94 · 10 2 )( 3 3 1 3 , 9.26 · 10 2 )( 3 2 2 3 , 4.63 · 10 2 )( 3 1 3 3 , 1.03 · 10 2 )( 3 0 4 3 , 8.57 · 10 4 )
4( 4 4 0 2 , 2.60 · 10 2 )( 4 3 1 2 , 3.47 · 10 2 )( 4 2 2 2 , 1.74 · 10 2 )( 4 1 3 2 , 3.86 · 10 3 )( 4 0 4 2 , 3.22 · 10 4 )
5( 5 4 0 1 , 5.21 · 10 3 )( 5 3 1 1 , 6.94 · 10 3 )( 5 2 2 1 , 3.47 · 10 3 )( 5 1 3 1 , 7.72 · 10 4 )( 5 0 4 1 , 6.43 · 10 5 )
6( 6 4 0 0 , 4.34 · 10 4 )( 6 3 1 0 , 5.79 · 10 4 )( 6 2 2 0 , 2.89 · 10 4 )( 6 1 3 0 , 6.43 · 10 5 )( 6 0 4 0 , 5.36 · 10 6 )
Table A3. Pairs of possible RRs and their associated probabilities ( h 1 , 2 , f 1 , 2 ) for the data in Table 2.
Table A3. Pairs of possible RRs and their associated probabilities ( h 1 , 2 , f 1 , 2 ) for the data in Table 2.
u vs. v01234
0( 0 4 0 6 , 2.78 · 10 2 )( 0 4 1 6 , 3.70 · 10 2 )( 0 4 2 6 , 1.85 · 10 2 )( 0 4 3 6 , 4.12 · 10 3 )( 0 4 4 6 , 3.43 · 10 4 )
1( 1 4 0 6 , 8.33 · 10 2 )( 1 4 1 6 , 1.11 · 10 1 )( 1 4 2 6 , 5.56 · 10 2 )( 1 4 3 6 , 1.23 · 10 2 )( 1 4 4 6 , 1.03 · 10 3 )
2( 2 4 0 6 , 1.04 · 10 1 )( 2 4 1 6 , 1.39 · 10 1 )( 2 4 2 6 , 6.94 · 10 2 )( 2 4 3 6 , 1.54 · 10 2 )( 2 4 4 6 , 1.29 · 10 3 )
3( 3 4 0 6 , 6.94 · 10 2 )( 3 4 1 6 , 9.26 · 10 2 )( 3 4 2 6 , 4.63 · 10 2 )( 3 4 3 6 , 1.03 · 10 2 )( 3 4 4 6 , 8.57 · 10 4 )
4( 4 4 0 6 , 2.60 · 10 2 )( 4 4 1 6 , 3.47 · 10 2 )( 4 4 2 6 , 1.74 · 10 2 )( 4 4 3 6 , 3.86 · 10 3 )( 4 4 4 6 , 3.22 · 10 4 )
5( 5 4 0 6 , 5.21 · 10 3 )( 5 4 1 6 , 6.94 · 10 3 )( 5 4 2 6 , 3.47 · 10 3 )( 5 4 3 6 , 7.72 · 10 4 )( 5 4 4 6 , 6.43 · 10 5 )
6( 6 4 0 6 , 4.34 · 10 4 )( 6 4 1 6 , 5.79 · 10 4 )( 6 4 2 6 , 2.89 · 10 4 )( 6 4 3 6 , 6.43 · 10 5 )( 6 4 4 6 , 5.36 · 10 6 )
Table A4. Sorted and grouped ERs ( h j ) and their associated probabilities ( f j ) for the data in Table A1.
Table A4. Sorted and grouped ERs ( h j ) and their associated probabilities ( f j ) for the data in Table A1.
j h j f j Group jj h j f j Group jj h j f j Group j
1 1 1 3.43 · 10 4 { 0 6 4 4 }9 1 4 4.73 · 10 2 { 3 6 3 4 , 0 6 1 4 }17 5 12 3.47 · 10 2 { 4 6 1 4 }
2 5 6 1.03 · 10 3 { 1 6 4 4 }10 1 6 6.95 · 10 2 { 5 6 4 4 , 2 6 2 4 }18 1 2 6.97 · 10 2 { 6 6 2 4 , 3 6 0 4 }
3 3 4 4.12 · 10 3 { 0 6 3 4 }11 1 12 1.15 · 10 1 { 4 6 3 4 , 1 6 1 4 }19 7 12 6.94 · 10 3 { 5 6 1 4 }
4 2 3 1.29 · 10 3 { 2 6 4 4 }12 0 1 7.41 · 10 2 { 6 6 4 4 , 0 6 0 4 , 3 6 2 4 }20 2 3 2.60 · 10 2 { 4 6 0 4 }
5 7 12 1.23 · 10 2 { 1 6 3 4 }13 1 12 1.40 · 10 1 { 5 6 3 4 , 2 6 1 4 }21 3 4 5.79 · 10 4 { 6 6 1 4 }
6 1 2 1.94 · 10 2 { 3 6 4 4 , 0 6 2 4 }14 1 6 1.01 · 10 1 { 4 6 2 4 , 1 6 0 4 }22 5 6 5.21 · 10 3 { 5 6 0 4 }
7 5 12 1.54 · 10 2 { 2 6 3 4 }15 1 4 9.27 · 10 2 { 6 6 3 4 , 3 6 1 4 }23 1 1 4.34 · 10 4 { 6 6 0 4 }
8 1 3 5.59 · 10 2 { 4 6 4 4 , 1 6 2 4 }16 1 3 1.08 · 10 1 { 5 6 2 4 , 2 6 0 4 }
Table A5. Sorted and grouped ORs ( h j ) and their associated probabilities ( f j ) for the data in Table A2.
Table A5. Sorted and grouped ORs ( h j ) and their associated probabilities ( f j ) for the data in Table A2.
j h j f j Group jj h j f j Group jj h j f j Group j
1 0 1 6.36 · 10 2 Group 07 3 5 1.11 · 10 1 { 1 3 1 5 }13 3 1 9.26 · 10 2 { 3 3 1 3 }
2 1 15 1.23 · 10 2 { 1 1 3 5 }8 2 3 3.86 · 10 3 { 4 1 3 2 }14 5 1 3.47 · 10 3 { 5 2 2 1 }
3 1 6 1.54 · 10 2 { 2 1 3 4 }9 1 1 7.41 · 10 2 { 6 0 4 0 , 0 4 0 6 , 3 2 2 3 }15 6 1 3.47 · 10 2 { 4 3 1 2 }
4 1 5 5.56 · 10 2 { 1 2 2 5 }10 3 2 1.39 · 10 1 { 2 3 1 4 }16 15 1 6.94 · 10 3 { 5 3 1 1 }
5 1 3 1.03 · 10 2 { 3 1 3 3 }11 5 3 7.72 · 10 4 { 5 1 3 1 }17 1 0 2.90 · 10 1 Group 17
6 1 2 6.94 · 10 2 { 2 2 2 4 }12 2 1 1.74 · 10 2 { 4 2 2 2 }
Group 0 is { 5 0 4 1 , 4 0 4 2 , 0 0 4 6 , 3 0 4 3 , 1 0 4 5 , 2 0 4 4 , 0 1 3 6 , 0 2 2 6 , 0 3 1 6 }. Group 17 is { 6 1 3 0 , 6 2 2 0 , 6 4 0 0 , 6 3 1 0 , 5 4 0 1 , 4 4 0 2 , 3 4 0 3 , 1 4 0 5 , 2 4 0 4 }.
Table A6. Sorted and grouped relative risks ( h j ) and their associated probabilities ( f j ) for the data in Table A3.
Table A6. Sorted and grouped relative risks ( h j ) and their associated probabilities ( f j ) for the data in Table A3.
j h j f j Group jj h j f j Group jj h j f j Group j
1 0 1 6.00 · 10 2 { 0 4 4 6 , 0 4 3 6 , 0 4 2 6 , 0 4 1 6 }7 2 3 1.91 · 10 1 { 4 4 4 6 , 3 4 3 6 , 2 4 2 6 , 1 4 1 6 }13 5 3 3.47 · 10 3 { 5 4 2 6 }
2 1 6 1.03 · 10 3 { 1 4 4 6 }8 5 6 6.43 · 10 5 { 5 4 4 6 }14 2 1 9.29 · 10 2 { 6 4 2 6 , 3 4 1 6 }
3 2 9 1.23 · 10 2 { 1 4 3 6 }9 8 9 3.86 · 10 3 { 4 4 3 6 }15 8 3 3.47 · 10 2 { 4 4 1 6 }
4 1 3 5.68 · 10 2 { 2 4 4 6 , 1 4 2 6 }10 1 1 7.41 · 10 2 { 6 4 4 6 , 0 4 0 6 , 3 4 2 6 }16 10 3 6.94 · 10 3 { 5 4 1 6 }
5 4 9 1.54 · 10 2 { 2 4 3 6 }11 10 9 7.72 · 10 4 { 5 4 3 6 }17 4 1 5.79 · 10 4 { 6 4 1 6 }
6 1 2 8.57 · 10 4 { 3 4 4 6 }12 4 3 1.56 · 10 1 { 6 4 3 6 , 4 4 2 6 , 2 4 1 6 }18 1 0 2.89 · 10 1 { 6 4 0 6 , 5 4 0 6 , 4 4 0 6 , 3 4 0 6 , 1 4 0 6 , 2 4 0 6 }
Table A7. Confidence intervals in increasing coverage for OR (data from Table A5).
Table A7. Confidence intervals in increasing coverage for OR (data from Table A5).
iMinCIMaxCI p CI 1 p CI iMinCIMaxCI p CI 1 p CI iMinCIMaxCI p CI 1 p CI
0 [ 3 2 , 3 2 ] ( 1 , 5 3 ) 0.13890.86116 [ 1 5 , 3 2 ] ( 1 6 , 5 3 ) 0.46320.536812 [ 0 , 1 ] [ 0 , 1 ) 0.66530.3347
1 [ 1 , 3 2 ] ( 2 3 , 5 3 ) 0.21300.78707 [ 1 6 , 3 2 ] ( 1 15 , 5 3 ) 0.47870.521313 [ 0 , 1 ] [ 0 , 1 ) 0.66880.3312
2 [ 2 3 , 3 2 ] ( 3 5 , 5 3 ) 0.21680.78328 [ 1 15 , 3 2 ] ( 0 , 5 3 ) 0.49100.509014 [ 0 , 1 ] [ 0 , 1 ) 0.70350.2965
3 [ 3 5 , 3 2 ] ( 1 2 , 5 3 ) 0.32790.67219 [ 0 , 3 2 ] [ 0 , 5 3 ) 0.55460.445415 [ 0 , 1 ] [ 0 , 1 0 ) 0.71040.2896
4 [ 1 2 , 3 2 ] ( 1 3 , 5 3 ) 0.39740.602610 [ 0 , 5 3 ] [ 0 , 1 ) 0.55530.444716 [ 0 , 1 0 ] [ 0 , 1 0 ] 1.00000.0000
5 [ 1 3 , 3 2 ] ( 1 5 , 5 3 ) 0.40770.592311 [ 0 , 1 ] [ 0 , 1 ) 0.57270.4273
Table A8. Confidence intervals in increasing coverage for RR (data from Table A6).
Table A8. Confidence intervals in increasing coverage for RR (data from Table A6).
iMinCIMaxCI p CI 1 p CI iMinCIMaxCI p CI 1 p CI iMinCIMaxCI p CI 1 p CI
0 [ 4 3 , 4 3 ] ( 10 9 , 5 3 ) 0.15630.84376 [ 1 , 10 3 ] ( 8 9 , 1 ) 0.36920.630812 [ 1 2 , 1 0 ] ( 4 9 , 1 0 ] 0.85430.1457
1 [ 4 3 , 5 3 ] ( 10 9 , 1 ) 0.15980.84027 [ 8 9 , 10 3 ] ( 5 6 , 1 ) 0.37300.627013 [ 4 9 , 1 0 ] ( 1 3 , 1 0 ] 0.86980.1302
2 [ 4 3 , 1 ] ( 10 9 , 8 3 ) 0.25270.74738 [ 8 9 , 1 ] ( 5 6 , 1 0 ) 0.37360.626414 [ 1 3 , 1 0 ] ( 2 9 , 1 0 ] 0.92660.0734
3 [ 4 3 , 8 3 ] ( 10 9 , 10 3 ) 0.28740.71269 [ 8 9 , 1 0 ] ( 5 6 , 1 0 ] 0.66230.337715 [ 2 9 , 1 0 ] ( 1 6 , 1 0 ] 0.93900.0610
4 [ 4 3 , 10 3 ] ( 10 9 , 1 ) 0.29430.705710 [ 5 6 , 1 0 ] ( 2 3 , 1 0 ] 0.66230.337716 [ 1 6 , 1 0 ] ( 0 , 1 0 ] 0.94000.0600
5 [ 10 9 , 10 3 ] ( 1 , 1 ) 0.29510.704911 [ 2 3 , 1 0 ] ( 1 2 , 1 0 ] 0.85350.146517 [ 0 , 1 0 ] [ 0 , 1 0 ] 1.00000.0000

References

  1. Johnson, S.S.; Jackson, K.C.; Mietchen, M.S.; Sbai, S.; Schwartz, E.J.; Lofgren, E.T. Excess Risk of COVID-19 to University Populations Resulting from In-Person Sporting Events. Int. J. Environ. Res. Public Health 2021, 18, 8260. [Google Scholar] [CrossRef] [PubMed]
  2. Sovicova, M.; Zibolenova, J.; Svihrova, V.; Hudeckova, H. Odds Ratio Estimation of Medical Students’ Attitudes towards COVID-19 Vaccination. Int. J. Environ. Res. Public Health 2021, 18, 6815. [Google Scholar] [CrossRef] [PubMed]
  3. Montoya, F.J.; Margolis, M.L. Impact of 95% confidence intervals on pulmonary function test interpretations. Chest 1996, 110, 195S. [Google Scholar] [CrossRef]
  4. Monaghan, T.F.; Rahman, S.N.; Agudelo, C.W.; Wein, A.J.; Lazar, J.M.; Everaert, K.; Dmochowski, R.R. Foundational Statistical Principles in Medical Research: A Tutorial on Odds Ratios, Relative Risk, Absolute Risk, and Number Needed to Treat. Int. J. Environ. Res. Public Health 2021, 18, 5669. [Google Scholar] [CrossRef] [PubMed]
  5. Greenland, S.; Senn, S.J.; Rothman, K.J.; Carlin, B.J.; Poole, C.; Goodman, S.N.; Altman, D.G. Statistical tests, P values, confidence intervals, and power: A guide to misinterpretations. Eur. J. Epidemiol. 2016, 31, 337. [Google Scholar] [CrossRef] [PubMed] [Green Version]
  6. Jakobsen, J.C.; Wetterslev, J.; Winkel, P.; Lange, T.; Gluud, C. Thresholds for statistical and clinical significance in systematic reviews with meta-analytic methods. BMC Med. Res. Methodol. 2014, 14, 120. [Google Scholar] [CrossRef] [PubMed] [Green Version]
  7. Schmidt, F.; Hunter, J.E. The impact of data-analysis methods on cumulative research knowledge: Statistical significance testing, confidence intervals, and meta-analysis. Eval. Health Prof. 1995, 18, 408. [Google Scholar] [CrossRef]
  8. Agresti, A.; Coull, B.-A. Approximate is Better than “Exact” for Interval Estimation of Binomial Proportions. Am. Stat. 1998, 52, 119–126. [Google Scholar] [CrossRef]
  9. Casella, G. Refining binomial confidence intervals. Can. J. Stat. 1986, 14, 113. [Google Scholar] [CrossRef] [Green Version]
  10. Blyth, C.R.; Still, H.A. Binomial Confidence Intervals. J. Am. Stat. Assoc. 1983, 78, 108. [Google Scholar] [CrossRef]
  11. Pang, G.; Alemayehu, D.; de la Peña, V.; Klass, M.J. On the bias and variance of odds ratio, relative risk and false discovery proportion. Commun. Stat.-Theory Methods 2021. Online first. [Google Scholar] [CrossRef]
  12. De la Peña, V.H. From decoupling and self-normalization to machine learning. Not. Am. Math. Soc. 2019, 66, 1641. [Google Scholar] [CrossRef]
  13. Gauss, C.F.J. Theoria combinations observationum erroribus minnimis obnoxiae. Comm. Soc. Reg. Scient. Got. Rec. Bd. V 1823, IV, 1–53. [Google Scholar]
  14. Newton, I. PhilosophiæNaturalis Principia Mathematica; Pepys: Londini, UK, 1687; pp. 1–411. [Google Scholar]
  15. Bernoulli, J. Ars Conjectandi; Thurnistorum: Basileæ, Switzerland, 1713; pp. 1–358. [Google Scholar]
  16. De Moivre, A. A method of approximating the sum of the terms of the binomial (a + b)n expanded to a series from whence are deduced some practical rules to estimate the degree of assent which is to be given to experiments. In The Doctrine of Chances, or, a Method of Calculating the Probability of Events in Play, 2nd ed.; Woodfall: London, UK, 1738; pp. 1–258. [Google Scholar]
  17. Gosset, W.S. The probable error of a mean. Biometrika 1908, 6, 1. [Google Scholar] [CrossRef]
  18. Maxwell, J.C. Illustrations of the dynamical theory of gases. Part I. On the motions and collisions of perfectly elastic spheres. Dublin Phil. Mag. J. Sci. Ser. 4 1860, 19, 19. [Google Scholar] [CrossRef]
  19. Boltzmann, L. Studien über das Gleichgewicht der lebendigen Kraft zwischen bewegten materiellen Punkten. Wien. Berichte 1868, 58, 517. [Google Scholar] [CrossRef]
  20. Fodor, M.-P.; Bolboacă, S.-D.; Jäntschi, L. Distribution of Molecules by Kinetic Energy Revisited. Bull. UASVM Hortic. 2013, 70, 10. [Google Scholar]
  21. Bose, S.N. Plancks Gesetz und Lichtquantenhypothese. Z. Phys. 1924, 26, 178. [Google Scholar] [CrossRef]
  22. Einstein, A. Quantentheorie des einatomigen idealen Gases. Sitzungsberichte Preuss. Akad. Wiss. 1924, XXII, 261. [Google Scholar]
  23. Hăşmăşanu, M.-G.; Bolboacă, S.-D.; Jäntschi, L. Bose-Einstein and Fermi-Dirac distributions and their use in biological sciences. BUASVMCN. Vet. Med. 2014, 71, 114. [Google Scholar]
  24. Fermi, E. Sulla quantizzazione del gas perfetto monoatomico. Rend. Lincei 1926, 3, 145. [Google Scholar]
  25. Dirac, P.A.M. On the Theory of Quantum Mechanics. Proc. Roy. Soc. Ser. A 1926, 112, 661. [Google Scholar] [CrossRef] [Green Version]
  26. Stirling, J. Methodus Differentialis: Sive Tractatus de Summatione et Interpolatione Serierum Infinitarum; Bowyer: Londini, UK, 1730; pp. 1–167. [Google Scholar]
  27. Avogadro, A. Fisica De’ Corpi Ponderabili. Trattato Della Costituzione Generale De’ Corpi. Tomo 1; Reale: Torino, Italy, 1837; pp. 1–910. [Google Scholar]
  28. Pearson, K. On the general theory of multiple contingency with special reference to partial contingency. Biometrika 1916, 11, 145. [Google Scholar] [CrossRef]
  29. Jäntschi, L.; Bolboacă, S.-D. First order derivatives of thermodynamic functions under assumption of no chemical changes revisited. J. Comput. Sci. 2014, 5, 597. [Google Scholar] [CrossRef]
  30. Fisher, R.A. On an Absolute Criterion for Fitting Frequency Curves. Messenger Math. 1912, 41, 155. [Google Scholar]
  31. Lagrange, J.L. Mécanique Analytique; Nouvele Édition. Revue et Augmentée Par L’auteur. Tome Premier; Mme Ve Courcier: Paris, France, 1811; pp. 1–428. [Google Scholar]
  32. Muqattash, I.; Yahdi, M. Infinite family of approximations of the Digamma function. Math. Comput. Model. 2006, 43, 1329. [Google Scholar] [CrossRef]
  33. Euler, L. Institutiones Calculi Differentialis Cum Eius vsu in Analysi Finitorum ac Doctrina Serierum; Academiæ Imperialis Scientiarum Petropolitanæ: St. Petersburg, Russia, 1755; pp. 1–899. [Google Scholar]
  34. Planck, M. Vorlesungen über die Theorie der Wärmestrahlung; Johann Ambrosius-Barth: Leipzig, Germany, 1906; pp. 1–222. [Google Scholar]
  35. Agresti, A. Dealing with discreteness: Making ‘exact’ confidence intervals for proportions, differences of proportions, and odds ratios more exact. Stat. Methods Med. Res. 2003, 12, 3. [Google Scholar] [CrossRef] [PubMed]
  36. Jäntschi, L.; Bolboacă, S.-D. Exact Probabilities and Confidence Limits for Binomial Samples: Applied to the Difference between Two Proportions. Sci. World J. 2010, 10, 865. [Google Scholar] [CrossRef] [Green Version]
  37. Hăşmăşanu, M.-G.; Bolboacă, S.-D.; Drugan, T.-C.; Matyas, M.; Zaharie, G.-C. Parental factors associated with intrauterine growth restriction. Srp. Ark. Celok. Lek. 2015, 143, 701. [Google Scholar] [CrossRef]
  38. Juncar, M.; Bran, S.; Juncar, R.I.; Băciuţ, M.F.; Băciuţ, G.; Onisor-Gligor, F. Odontogenic cervical necrotizing fasciitis, etiological aspects. Niger. J. Clin. Pract. 2016, 19, 391. [Google Scholar] [CrossRef]
  39. Cordos, A.-A.; Bolboacă, S.-D.; Drugan, C. Social Media Usage for Patients and Healthcare Consumers: A Literature Review. Publications 2017, 5, 9. [Google Scholar] [CrossRef] [Green Version]
  40. Bolboacă, S.-D.; Buhai, D.-V.; Aluaş, M.; Bulboacă, A.-E. Post retraction citations among manuscripts reporting a radiology-imaging diagnostic method. PLoS ONE 2019, 14, e0217918. [Google Scholar] [CrossRef] [Green Version]
  41. Bulboacă, A.-E.; Stănescu, I.-C.; Bolboacă, S.-D.; Bulboacă, A.-C.; Bodizs, G.-I.; Nicula, C.-A. Retinal Nerve Fiber Layer Thickness and Oxidative Stress Parameters in Migraine Patients without Aura: A Pilot Study. Antioxidants 2020, 9, 494. [Google Scholar] [CrossRef]
  42. Gherman, C.-D.; Mironiuc, A.-I. Evaluation of Serum Adipokines in Peripheral Arterial Occlusive Disease. Mediat. Inflamm. 2012, 2012, 257808. [Google Scholar] [CrossRef] [PubMed] [Green Version]
  43. Maniu, A.; Cosgarea, M. Mastoid Obliteration with Concha Cartilage Graft and Temporal Muscle Fascia. J. Otolaryngol-Head Neck Surg. 2012, 74, 141. [Google Scholar] [CrossRef] [PubMed]
  44. Micu, M.-C.; Alcalde, M.; Sáenz, J.-I.; Crespo, M.; Collado, P.; Bolboacă, S.-D.; Naredo, E. Impact of Musculoskeletal Ultrasound in an Outpatient Rheumatology Clinic. Arthritis Care Res. 2013, 65, 615. [Google Scholar] [CrossRef] [PubMed]
  45. Marina, M.E.; Botar Jid, C.; Bolboacă, S.-D.; Bocşa, C.; Mihu, C.-M.; Tătaru, A.-D. High-frequency sonography in the evaluation of nail psoriasis. Med. Ultrason. 2016, 18, 312. [Google Scholar] [CrossRef] [PubMed] [Green Version]
  46. Bulboacă, A.E.; Bolboacă, S.-D.; Bulboacă, A.C.; Prodan, C.I. Association between low thyroid-stimulating hormone, posterior cortical atrophy and nitro-oxidative stress in elderly patients with cognitive dysfunction. Arch. Med. Sci. 2017, 13, 1160. [Google Scholar] [CrossRef]
  47. Capraş, R.-D.; Bulboacă, A.-E.; Bolboacă, S.-D. Evidence-based medicine self-assessment, knowledge, and integration into daily practice: A survey among Romanian physicians and comparison between trainees and specialists. BMC Med. Educ. 2020, 20, 19. [Google Scholar] [CrossRef] [Green Version]
  48. Clopper, C.; Pearson, E.-S. The use of confidence or fiducial limits illustrated in the case of the binomial. Biometrika 1934, 26, 404. [Google Scholar] [CrossRef]
  49. Bolboacă, S.-D.; Jäntschi, L. Optimized confidence intervals for binomial distributed samples. Int. J. Pure App. Math. 2008, 47, 1. [Google Scholar]
  50. Micu, C.-M.; Micu, R.; Surd, S.; Gîrlovanu, M.; Bolboacă, S.-D.; Ostensen, M. TNF-a inhibitors do not impair sperm quality in males with ankylosing spondylitis after short-term or long-term treatment. Rheumatology 2014, 53, 1250. [Google Scholar] [CrossRef] [Green Version]
  51. Chirilă, M.; Bolboacă, S.-D. Clinical efficiency of quadrivalent HPV (types 6/11/16/18) vaccine in patients with recurrent respiratory papillomatosis. Eur. Arch. Oto-Rhino-Laryn. 2014, 271, 1135. [Google Scholar] [CrossRef]
  52. Mihu, D.; Ciortea, R.; Malutan, A.; Mihu, C.-M. Evaluation of maternal systemic inflammatory response in preeclampsia. Taiwan J. Obstet. Gynecol. 2015, 54, 160. [Google Scholar] [CrossRef] [Green Version]
  53. Botar-Jid, C.-M.; Cosgarea, R.; Bolboacă, S.-D.; Senilă, S.-C.; Lenghel, L.-M.; Rogojan, L.; Dudea, S.-M. Assessment of Cutaneous Melanoma by Use of Very- High-Frequency Ultrasound and Real-Time Elastography. Am. J. Roentgenol. 2016, 206, 699. [Google Scholar] [CrossRef]
  54. Bolboacă, S.-D.; Jäntschi, L. Predictivity Approach for Quantitative Structure–Property Models. Application for Blood–Brain Barrier Permeation of Diverse Drug–Like Compounds. Int. J. Mol. Sci. 2011, 12, 4348. [Google Scholar] [CrossRef] [PubMed] [Green Version]
  55. Pocol, C.-B.; Bolboacă, S.-D. Trends of honey consumption in North–West Romania. Int. J. Consum. Stud. 2013, 37, 642. [Google Scholar] [CrossRef]
  56. Juncar, M.; Popa, A.-R.; Băciuţ, M.-F.; Juncar, R.-I.; Onişor-Gligor, F.; Bran, S.; Băciuţ, G. Evolution assessment of head and neck infections in diabetic patients—A case control study. J. Cranio-MaxilloFac. Surg. 2014, 42, 498. [Google Scholar] [CrossRef] [PubMed]
  57. Hăşmăşanu, M.-G.; Bolboacă, S.-D.; Baizat, M.-I.; Drugan, T.-C.; Zaharie, G.-C. Neonatal short–term outcomes in infants with intrauterine growth restriction. Saudi Med. J. 2015, 36, 947. [Google Scholar] [CrossRef] [PubMed]
  58. Bolboacă, S.-D.; Achimaş-Cadariu, B.-A. Binomial Distribution Sample Confidence Intervals Estimation 5. Odds Ratio. Leonardo J. Sci. 2004, 4, 26. [Google Scholar]
  59. Bolboacă, S.-D.; Achimaş-Cadariu, B.-A. Binomial Distribution Sample Confidence Intervals Estimation 6. Excess Risk. Leonardo Electron. J. Pract. Technol. 2004, 4, 1. [Google Scholar]
  60. Bolboacă, S.-D.; Jäntschi, L. Binomial distribution sample confidence intervals estimation for positive and negative likelihood ratio medical key parameters. AMIA Annu. Symp. Proc. 2005, 2005, 66. [Google Scholar]
  61. Newcombe, R.-G. Interval estimation for the difference between independent proportions: Comparison of eleven methods. Stat. Med. 1988, 17, 873. [Google Scholar] [CrossRef]
  62. Pearson, K. Mathematical Contributions to the Theory of Evolution; On the Theory of Contingency and Its Relation to Association and Normal Correlation, pp. 1–34; Dulau & Co.: London, UK, 1904; pp. 1–228. [Google Scholar]
  63. Fisher, R.A. On the Interpretation of χ2 from Contingency Tables, and the Calculation of P. J. Roy. Stat. Soc. 1922, 85, 87. [Google Scholar] [CrossRef]
  64. Flanagan, J.L.; House, A.S. Development and Testing of a Formant-Coding Speech Compression System. J. Acoust. Soc. Am. 1956, 28, 1099. [Google Scholar] [CrossRef]
  65. Congalton, R.G.; Oderwald, R.G.; Mead, R.A. Assessing Landsat classification accuracy using discrete multivariate analysis statistical techniques. Photogrumm. Eng. Remote Sens. 1983, 49, 1671. [Google Scholar]
  66. Yates, F. Contingency Tables Involving Small Numbers and the χ2 Test. Supp. J. R. Stat. Soc. 1934, 1, 217. [Google Scholar] [CrossRef]
  67. Stegenga, J. Measuring Effectiveness. Stud. Hist. Philos. Sci. Part C-Stud. Hist. Philos. Biol. Biomed. Sci. 2015, 54, 62. [Google Scholar] [CrossRef]
  68. Fisher, R.A. Statistical Methods for Research Workers, 5th ed.; §21.02. The Exact Treatment of 2 × 2 tables, pp. 99–101; Oliver and Boyd: Edinburgh, UK, 1934; pp. 1–320. [Google Scholar]
  69. Botar-Jid, C.-M.; Bolboacă, S.-D.; Cosgarea, R.; Senilă, S.-C.; Rogojan, L.; Lenghel, L.-M.; Vasilescu, D.; Dudea, S.-M. Doppler ultrasound and strain elastography in the assessment of cutaneous melanoma: Preliminary results. Med. Ultrason. 2015, 17, 509. [Google Scholar] [CrossRef] [Green Version]
  70. Tian, G.-L.; Zhang, C.; Jiang, X. Valid statistical inference methods for a case–control study with missing data. Stat. Methods Med. Res. 2018, 27, 1001. [Google Scholar] [CrossRef]
  71. Drugan, T.-C.; Bolboacă, S.-D.; Jäntschi, L.; Achimaş-Cadariu, B.-A. Binomial distribution sample confidence intervals estimation 1. Sampling and medical key parameters calculation. Leonardo Electron. J. Pract. Technol. 2003, 3, 45. [Google Scholar]
  72. Tharwat, A. Classification assessment methods. Appl. Comput. Inform. 2021, 17, 168. [Google Scholar] [CrossRef]
  73. Sui, J.; Jiao, J.; Sun, Y.; Liu, J.; Bastero, R.; Koch, G. Evaluation of alternative confidence intervals to address non-inferiority through the stratified difference between proportions. Pharmaceut. Stat. 2021, 20, 146. [Google Scholar] [CrossRef] [PubMed]
Figure 1. Research design.
Figure 1. Research design.
Mathematics 09 02506 g001
Figure 2. Normal approximations for Student’s t (left, ν = 10) and Binomial (right, n = 10) distributions.
Figure 2. Normal approximations for Student’s t (left, ν = 10) and Binomial (right, n = 10) distributions.
Mathematics 09 02506 g002
Figure 3. The 2 × 2 contingency in two contexts (Actual vs. Predicted & Comparing outcomes).
Figure 3. The 2 × 2 contingency in two contexts (Actual vs. Predicted & Comparing outcomes).
Mathematics 09 02506 g003
Figure 4. f B 2 E ( x , y , 3 , 4 , 10 , 10 ) probability mass function.
Figure 4. f B 2 E ( x , y , 3 , 4 , 10 , 10 ) probability mass function.
Mathematics 09 02506 g004
Figure 5. C I ER , 5 % (0..6, 0..4, 6, 4).
Figure 5. C I ER , 5 % (0..6, 0..4, 6, 4).
Mathematics 09 02506 g005
Figure 6. C I OR , 5 % (0..6, 0..4, 6, 4).
Figure 6. C I OR , 5 % (0..6, 0..4, 6, 4).
Mathematics 09 02506 g006
Figure 7. C I RR , 5 % (0..6, 0..4, 6, 4).
Figure 7. C I RR , 5 % (0..6, 0..4, 6, 4).
Mathematics 09 02506 g007
Figure 8. Non-CP for C I ER , 5 % (0..6, 0..4, 6, 4).
Figure 8. Non-CP for C I ER , 5 % (0..6, 0..4, 6, 4).
Mathematics 09 02506 g008
Figure 9. Non-CP for C I OR , 5 % (0..6, 0..4, 6, 4).
Figure 9. Non-CP for C I OR , 5 % (0..6, 0..4, 6, 4).
Mathematics 09 02506 g009
Figure 10. Non-CP for C I RR , 5 % (0..6, 0..4, 6, 4).
Figure 10. Non-CP for C I RR , 5 % (0..6, 0..4, 6, 4).
Mathematics 09 02506 g010
Figure 11. Non-CP for C I ER , 5 % (0..60, 0..50, 60, 50).
Figure 11. Non-CP for C I ER , 5 % (0..60, 0..50, 60, 50).
Mathematics 09 02506 g011
Figure 12. Non-CP for C I ER , 5 % (0..60, 0..50, 60, 50).
Figure 12. Non-CP for C I ER , 5 % (0..60, 0..50, 60, 50).
Mathematics 09 02506 g012
Figure 13. Non-CP for C I ER , 5 % (0..60, 0..50, 60, 50).
Figure 13. Non-CP for C I ER , 5 % (0..60, 0..50, 60, 50).
Mathematics 09 02506 g013
Figure 14. C I ER , 5 % (0..9, 0..11, 9, 11) non-CP for sampling with replacement.
Figure 14. C I ER , 5 % (0..9, 0..11, 9, 11) non-CP for sampling with replacement.
Mathematics 09 02506 g014
Figure 15. C I ER , 5 % (0..9, 0..11, 9, 11) non-CP for m + n as common constraint as suggested in [61].
Figure 15. C I ER , 5 % (0..9, 0..11, 9, 11) non-CP for m + n as common constraint as suggested in [61].
Mathematics 09 02506 g015
Figure 16. C I ER , 5 % (0..9, 0..11, 9, 11) non-CP for sampling without replacement.
Figure 16. C I ER , 5 % (0..9, 0..11, 9, 11) non-CP for sampling without replacement.
Mathematics 09 02506 g016
Table 1. Probability mass functions for the replica ( u , v , m , n ) of the 2 × 2 contingency ( x , y , m , n ).
Table 1. Probability mass functions for the replica ( u , v , m , n ) of the 2 × 2 contingency ( x , y , m , n ).
EventsProbability Mass Function
( u , m ) replica of ( x , m ) { f BS ( 0 ; x , m ) , f BS ( 1 ; x , m ) , …, f BS ( u ; x , m ) , …, f BS ( m ; x , m ) }
( v , n ) replica of ( y , n ) { f BS ( 0 ; y , n ) , f BS ( 1 ; y , n ) , …, f BS ( v ; y , n ) , …, f BS ( n ; y , n ) }
For the expressions of f BS ( u ; x , m ) and f BS ( v ; y , n ) , see Equation (8). The probability for ( u , v , m , n ) as replica of ( x , y , m , n ) is, again, f B 2 E ( u , v ; x , y , m , n ) from Equation (9).
Table 2. Example: probability mass functions for x = 2, y = 1 , m = 6 and n = 4 bivariate binomial experiment case.
Table 2. Example: probability mass functions for x = 2, y = 1 , m = 6 and n = 4 bivariate binomial experiment case.
f BS 0123456
f BS ( u ; 2 , 6 ) 8.78 · 10 2 2.63 · 10 1 3.29 · 10 1 2.19 · 10 1 8.23 · 10 2 1.65 · 10 2 1.37 · 10 3
f BS ( v ; 1 , 4 ) 3.16 · 10 1 4.22 · 10 1 2.11 · 10 1 4.69 · 10 2 3.91 · 10 3
The numeric values are given with three significant figures. However, the calculations and the actual values must be done with machine-like precision. BS( u ; 2 , 6 ) has seven possible outcomes ( u { 0 , 1 , 2 , 3 , 4 , 5 , 6 } ) while BS( v ; 1 , 4 ) has five ( v { 0 , 1 , 2 , 3 , 4 } ).
Table 3. CIs in increasing coverage for ER (data from Table A4).
Table 3. CIs in increasing coverage for ER (data from Table A4).
iMinCIMaxCIpCI1 − pCIiMinCIMaxCIpCI1 − pCI
0 [ 1 12 , 1 12 ] ( 0 , 1 6 ) 0.13970.860312 [ 1 2 , 1 2 ] ( 7 12 , 7 12 ) 0.94170.0583
1 [ 1 12 , 1 6 ] ( 0 , 1 4 ) 0.24040.759613 [ 7 12 , 1 2 ] ( 2 3 , 7 12 ) 0.95400.0460
2 [ 1 12 , 1 4 ] ( 0 , 1 3 ) 0.33300.667014 [ 7 12 , 7 12 ] ( 2 3 , 2 3 ) 0.96100.0390
3 [ 1 12 , 1 3 ] ( 0 , 5 12 ) 0.44070.559315 [ 7 12 , 2 3 ] ( 2 3 , 3 4 ) 0.98700.0130
4 [ 0 , 1 3 ] ( 1 12 , 5 12 ) 0.51470.485316 [ 2 3 , 2 3 ] ( 3 4 , 3 4 ) 0.98830.0117
5 [ 1 12 , 1 3 ] ( 1 6 , 5 12 ) 0.62970.370317 [ 3 4 , 2 3 ] ( 5 6 , 3 4 ) 0.99240.0076
6 [ 1 6 , 1 3 ] ( 1 4 , 5 12 ) 0.69920.300818 [ 5 6 , 2 3 ] ( 1 , 3 4 ) 0.99340.0066
7 [ 1 4 , 1 3 ] ( 1 3 , 5 12 ) 0.74650.253519 [ 5 6 , 3 4 ] ( 1 , 5 6 ) 0.99400.0060
8 [ 1 3 , 1 3 ] ( 5 12 , 5 12 ) 0.80240.197620 [ 5 6 , 5 6 ] ( 1 , 1 ) 0.99920.0008
9 [ 1 3 , 5 12 ] ( 5 12 , 1 2 ) 0.83710.162921 [ 5 6 , 1 ] ( 1 , 1 ] 0.99970.0003
10 [ 1 3 , 1 2 ] ( 5 12 , 7 12 ) 0.90690.093122 [ 1 , 1 ] [ 1 , 1 ] 1.00000.0000
11 [ 5 12 , 1 2 ] ( 1 2 , 7 12 ) 0.92230.0777
i is the iteration, MinCI is the smallest possible CI for the given CP and is always closed, MaxCI is the largest possible CI for the given CP and is open whenever is possible, and pCI is the CP. The probabilities are given with four significant figures, however, the calculations and the actual values must be done with machine-like precision. The CI boundaries are given as irreducible fractions, and also for convenience, the integer fraction is reduced.
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Share and Cite

MDPI and ACS Style

Jäntschi, L. Formulas, Algorithms and Examples for Binomial Distributed Data Confidence Interval Calculation: Excess Risk, Relative Risk and Odds Ratio. Mathematics 2021, 9, 2506. https://0-doi-org.brum.beds.ac.uk/10.3390/math9192506

AMA Style

Jäntschi L. Formulas, Algorithms and Examples for Binomial Distributed Data Confidence Interval Calculation: Excess Risk, Relative Risk and Odds Ratio. Mathematics. 2021; 9(19):2506. https://0-doi-org.brum.beds.ac.uk/10.3390/math9192506

Chicago/Turabian Style

Jäntschi, Lorentz. 2021. "Formulas, Algorithms and Examples for Binomial Distributed Data Confidence Interval Calculation: Excess Risk, Relative Risk and Odds Ratio" Mathematics 9, no. 19: 2506. https://0-doi-org.brum.beds.ac.uk/10.3390/math9192506

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop