Inferences on the Difference of Two Proportions : A Bayesian Approach

Let 1 2 π π π = − be the difference of two independent proportions related to two populations. We study the test 0 : 0 H π ≥ against different alternatives, in the Bayesian context. The various Bayesian approaches use standard beta distributions, and are simple to derive and compute. But the more general test 0 : , H π η ≥ with 0 η > , requires more advanced mathematical tools to carry out the computations. These tools, which include the density of the difference of two general beta variables, are presented in the article, with numerical examples for illustrations to facilitate comprehension of results.


Introduction
For two independent proportions 1 π and 2 π , their difference is frequently en- countered in the frequentist statistical literature, where tests, or confidence intervals, for 1 2 π π − are well accepted notions in theory and in practice, although most frequently, the case under study is the equality, or inequality of these proportions.For the Bayesian approach, Pham-Gia and Turkkan ( [1] and [2]) have considered the case of independent, and dependent proportions for inferences, and also in the context of sample size determination [3].
But testing 1 2 π π = is only a special case of testing 0 1 2

:
H π π η − ≤ , with η being a positive constant value, which is much less frequently dealt with.In Section 2 we recall the unconditional approaches to testing 0 H based on the maximum likelihood estimators of the two proportions and normal approximations.A new exact approach not using normal approximation has been developed by our group and will be presented elsewhere.Fisher's exact test is also re-called here, for comparison purpose.The Bayesian approach to testing the equality of two proportions and the computation of credible intervals are given in Section 3. The Bayesian approach using the general beta distributions is given in Section 4. All related problems are completely solved, thanks to some closed form formulas that we have established in earlier papers.

Test Using Normal Approximation
As stated before, taking 0 η = we have a test for equality between two propor- tions.Several well-known methods are presented in the literature.For example, the conditional test is usually called Fisher's exact test, and is based on the hypergeometric distribution.It is used when the sample size is small.Pearson's Chi-square test using Yates correction is usually used for intermediary sample size while Pearson's Chi-square is used for large samples.Their appropriateness is discussed in D'Agostino et al. [4].Normal approximation methods are based on formulas using estimated values of the mean and the variance of the two populations.For example, we have [5] gives conditions under which 2 T is better than 1 T , in terms of power.Previously, Eberhardt and Fligner   [6] studied the same problem for a bilateral test.

Numerical Example 1
To investigate its proportions of customers in two separate geographic areas of the country, a company picks a random sample of 25 shoppers in area A, in which 17 are found to be its customers.A similar random sample of 20 shoppers in area B gives 8 customers.We wish to test the hypothesis that 0 1 2 : We have here the observed value of 1 1.9459 T = and of 2 1.8783 T = which lead, in both cases, to the rejection of 0 H at significance level 5% (the critical value is 1.64) for

Fisher's Exact Test
Under 0 H the number of successes coming from population 1 has the ( ) Hyp , , , n n t x x n x + = + distribution.The argument is that, in the combined sample of size 1 2 n n + , with 1 x successes from population 1 out of the total num- ber of successes x = , and also cases more extreme, which means 0,1, 2, , 7 Although technically not significant at the 5% level, this result shows that the proportion of customers in area B can practically be considered as lower than the one in area A, in agreement with the frequentist test.
REMARK: The problem is often associated with a 2 × 2 table where there are three possibilities: constant column sums and row sums, one set constant the other variable and both variables.Other measures can then be introduced (e.g. Santner and Snell [7]).A Bayesian approach has been carried out by several authors, e.g.Howard [8] and also Pham Gia and Turkkan [2], who computed the credible intervals for several of these measures.

The Bayesian Approach
In the estimation of the difference of two proportions the Bayesian approach certainly plays an important role.Agresti and Coull [9] provide some interesting remarks on various approaches.
Again, let π π π = − .Using the Bayesian approach will certainly encounter some serious computational difficulties if we do not have a closed form expression for the density of the difference of two independently beta distributed random variables.Such an expression has been obtained by the first author some time ago and is recalled below.

Bayesian Test on the Equality of Two Proportions
Let us recall first the following theorem: , , α β , respectively.
Then the difference has density defined on ( ) ( ) F is Appell's first hypergeometric function, which is defined as where [ ] ( ) ( ) . This infinite series is convergent for 1 1 x < and 2 1 x < , where, as shown by Euler, it can also be expressed as a convergent integral: In fact, Pham-Gia and Turkkan [1] established the expression of the density of the difference using (3) directly and not the series.Hence, the infinite series ( 5) can be extended outside the two circles of convergence, by analytic continuation, where it is also denoted by ( ) Here, we denote the above density (1) by ( ) Proof: See Pham-Gia and Turkkan [1].
The prior distribution of π is hence ( ) , , , ψ α β α β , obtained from the two beta priors.Various approaches in Bayesian testing are given below.

Bayesian Testing Using a Significance Level
While frequentist statistics frequently does not test This expression of the posterior density of π , obtained by the conjugacy of bi- nomial sampling with the beta prior, will allow us to compute ( ) > and compare it with the significance level α .
For example, as in the frequentist example of Section 2.1, we consider x = and use two non-informative beta priors, that is, ( ) Beta 0.5, 0.5 .
We wish to test: We have ∫ , and we fail to reject 0 H at the 0.05% level.This means that data combined with our judgment is not enough to make us accept that the difference of these proportions exceeds 0.35.Naturally, different informative, or non-informative, priors can be considered for 1 π and 2 π separately, and the test can be carried out in the same way.
b) Point-null hypothesis: The point null hypothesis  in the literature.Several difficulties still remain concerning this case, especially on the prior probability assigned to the value η (see Berger [10]).We use here Lindley's compromise (Lee [11]), which consists of computing the ( ) We can see that the above conclusions on π are consistent with each other.

Bayesian Testing Using the Bayes Factor
Bayesian hypothesis testing can also be carried out using the Bayes factor B, which would give the relative weight of the null hypothesis w.r.t. the alternative one, when data is taken into consideration.This factor is defined as the ratio of the posterior odds over the prior odds.With the above expression of the difference of two betas given by ( 1) we can now accurately compute the Bayes factor associated with the difference of two proportions.We consider two cases: , where we have uniform priors for both 1 π and 2 π , and where we consider the sampling results from Table 1.We obtain the posterior parameters 1    : against 1 H as 0 1 p p .Similarly, we have the prior odds on 0 H against 1 H , which we define here as 0 1 z z .The Bayes factor is . Again, we use the sampling results from Table 1, yielding the prior and posterior distributions presented in Figure 1 with ( ) Beta 0.5, 0.5 prior separately for both propor- tions.

Prior and Posterior Densities of π η −
The testing above can be seen to be quite straightforward, and is limited to some numerical values of the function

( )
. ψ that can be numerically computed.But to make an in-depth study of the Bayesian approach to the difference ( ) π η π π η − = − + , we need to consider the analytic expressions of the prior and posterior distributions of this variable, which can be obtained only from the general beta distribution.Naturally, the related mathematical formulas become more complicated.But Pham-Gia and Turkkan [13] have also established the expression of the density of 1 2

X X +
, where both have general beta distributions.

The Difference of Two General Betas
The general beta (or GB), defined on a finite interval, say (c, d), has a density: ; , ; , , , , 0, and is denoted by Proof: , , , , , , Pham-Gia and Turkkan [13] gave the expression of the density of 1 2 X X + , where 1 X and 2 X are independent general beta variables.The density of 1 2 X X − , which is only mentioned there, is explicitly given below.
Theorem 3: Let 1 X and 2 X be two independent general betas with their supports satisfying (6).Then Y X X = − has its density defined as follows: ; , ; , and for , c e y d e − ≤ ≤ − ( ; , F is Appell's first hypergeometric function already discussed. Proof: The argument uses first part 2) of Theorem 1 to obtain that Turkkan [14]). Q.E.D.
To study the density of ( ) π η π π η − = − + , a particular case that will be used in our study here is the difference between ( ) ~, ; 0,1 ~, ; 0,1 ~, ; , 1 X GB α β η η + be two independent general beta distributed random variables.Then the density of and we denote this distribution by ( ) Proof: This is a special case of Theorem 3.
Q.E.D.An equivalent form using Theorem 4 leads to a slightly different expression, which gives however, the same numerical values for the density of π η − (see Theorem 4a in Appendix 1).
Binomial sampling affects these 2 distributions in different ways.For the first, the posterior is ( ) Figure 4 shows the above density.

Conclusion
The Bayesian approach to testing the difference of two independent proportions leads to interesting results which agree with frequentist results when non-informative priors are considered.Undoubtedly, all preceding results can be    Q.E. D.

End
Submit or recommend next manuscript to SCIRP and we will provide best service for you: Accepting pre-submission inquiries through Email, Facebook, LinkedIn, Twitter, etc.A wide selection of journals (inclusive of 9 subjects, more than 200 journals) Providing 24-hour high-quality service User-friendly online submission system Fair and swift peer-review system Efficient typesetting and proofreading procedure Display of the result of downloads and visits, as well as the number of cited articles Maximum dissemination of your research work Submit your manuscript at: http://papersubmission.scirp.org/Or contact ojs@scirp.org

Proposition 1 :
limits itself to the case 0 η = , Bayesian statistics can easily do it.a) One-sided test: To perform the above test at the 0.05 significance level, using the two independent samples { }1   1, 1 to be tested at the significance level α in Bayesian statistics has been a subject of study and discussion Figure 1.(a) Prior density interval and accept or reject 0 H depending on whether η belongs or not to that interval.Here, for the same example, if 0.35 η =, using Pham-Gia and Turkkan's algorithm[12], the 95% hpd interval for π is ( ) 0.0079; 0.5381 − , which leads us to technically accept 0 H (see Figure2), al- bound of the hpd interval can be considered as zero and we can practically reject 0 H .
to the value of the posterior density of π at a , divided by the val- ue of posterior density of π at b .As an application, let us consider the fol- lowing hypotheses (different from the previous numerical example):
posterior probabilities.Consequently, we define the posterior odds on 0 H

.
It reduces to the standard beta above when 0 c = and 1 d = .Conversely a standard beta can be transformed into a general beta by addition of, or/and, multiplication with a constant.
are two different cases to consider, de- pending on the relative values of c e − and d f − , since 1 c f c e d f d e − ≤ − ≤ − ≤ − Then, it uses the exact expression of the density of the sum of two general betas (see Theorem 2 in the article of T. Pham-Gia & N.

+
This is the p.d.f. of ( ) . the proportion of customers in area A is significantly higher than the one in area B. We have Table1: the observed data ( )

Table 1 .
Data on customers in area A and B.