Inferences On The Difference Of Two Proportions: A .

6d ago
391.19 KB
16 Pages

Open Journal of Statistics, 2017, 7, 1-15 Online: 2161-7198ISSN Print: 2161-718XInferences on the Difference of TwoProportions: A Bayesian ApproachThu Pham-Gia1, Nguyen Van Thin2, Phan Phuc Doan2Department of Mathematics and Statistics, Université de Moncton, New Brunswick, CanadaFaculty of Mathematics and Computer Science, Hochiminh University of Science, Ho Chi Minh, Vietnam12How to cite this paper: Pham-Gia, T.,Thin, N.V. and Doan, P.P. (2017) Inferenceson the Difference of Two Proportions: ABayesian Approach. Open Journal of Statistics, 7, d: July 13, 2016Accepted: February 6, 2017Published: February 9, 2017Copyright 2017 by authors andScientific Research Publishing Inc.This work is licensed under the CreativeCommons Attribution InternationalLicense (CC BY stractLet π π 1 π 2 be the difference of two independent proportions related totwo populations. We study the test H 0 : π 0 against different alternatives,in the Bayesian context. The various Bayesian approaches use standard betadistributions, and are simple to derive and compute. But the more general testH 0 : π η , with η 0 , requires more advanced mathematical tools to carryout the computations. These tools, which include the density of the differenceof two general beta variables, are presented in the article, with numerical examples for illustrations to facilitate comprehension of results.KeywordsProportion, Convolution, Normal, Beta, Bayesian, Critical Value,Appell’s FunctionOpen Access1. IntroductionFor two independent proportions π 1 and π 2 , their difference is frequently encountered in the frequentist statistical literature, where tests, or confidence intervals, for π 1 π 2 are well accepted notions in theory and in practice, althoughmost frequently, the case under study is the equality, or inequality of these proportions. For the Bayesian approach, Pham-Gia and Turkkan ([1] and [2]) haveconsidered 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 H 0 : π 1 π 2 η , with ηbeing a positive constant value, which is much less frequently dealt with. InSection 2 we recall the unconditional approaches to testing H 0 based on themaximum 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 reDOI: 10.4236/ojs.2017.71001February 9, 2017

T. Pham-Gia et al.called here, for comparison purpose. The Bayesian approach to testing the equalityof two proportions and the computation of credible intervals are given in Section 3. The Bayesian approach using the general beta distributions is given inSection 4. All related problems are completely solved, thanks to some closedform formulas that we have established in earlier papers.2. Testing the Equality of Two Proportions2.1. Test Using Normal ApproximationAs stated before, taking η 0 we have a test for equality between two proportions. 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 thehypergeometric distribution. It is used when the sample size is small. Pearson’sChi-square test using Yates correction is usually used for intermediary samplesize while Pearson’s Chi-square is used for large samples. Their appropriatenessis discussed in D’Agostino et al. [4]. Normal approximation methods are basedon formulas using estimated values of the mean and the variance of the twopopulations. For example, we haveX 1 n1 X 2 n2, and the pooled versionT1 12 ( X 1 n1 )(1 X 1 n1 ) n1 ( X 2 n2 )(1 X 2 n2 ) n2 X 1 n1 X 2 n2T2 , both being12 ( X 1 X 2 ) ( n1 n2 ) (1 ( X 1 X 2 ) ) ( n1 n2 ) (1 n1 1 n2 ) ()approximately N ( 0,1) under H 0 : π 1 π 2 . Cressie [5] gives conditions underwhich T2 is better than T1 , in terms of power. Previously, Eberhardt and Fligner[6] studied the same problem for a bilateral test.Numerical Example 1To investigate its proportions of customers in two separate geographic areas ofthe country, a company picks a random sample of 25 shoppers in area A, inwhich 17 are found to be its customers. A similar random sample of 20 shoppersin area B gives 8 customers. We wish to test the hypothesis that H 0 : π 1 π 2against H1 : π 1 π 2 .We have here the observed value of T1 1.9459 and of T2 1.8783 whichlead, in both cases, to the rejection of H 0 at significance level 5% (the criticalvalue is 1.64) for H1 : π 1 π 2 .2.2. Fisher’s Exact TestUnder H 0 the number of successes coming from population 1 has theHyp ( n1 n2 , t x1 x2 , n1 , x ) distribution. The argument is that, in the combinedsample of size n1 n2 , with x1 successes from population 1 out of the total number of successes t x1 x2 , the number of x successes coming from population1 is a hypergeometric variable.To compute the significance of the observation we have to compute severaltables corresponding to more extreme results than the observed table. It is knownthat the conditional test is less powerful than the unconditional one.2

T. Pham-Gia et al.Numerical Example 2We use the same data as in numerical example 1 to test H 0 : π A π B vsH1 : π A π B i.e. the proportion of customers in area A is significantly higherthan the one in area B. We have Table 1:the observed data( xB 8) , and also cases more extreme, which meansxB 0,1, 2, , 7 . The p-value of the test is hence 25 20 25 xB xB 0.0542 .p -value 45 xB 0 25 8Although technically not significant at the 5% level, this result shows that theproportion of customers in area B can practically be considered as lower thanthe one in area A, in agreement with the frequentist test.REMARK: The problem is often associated with a 2 2 table where there arethree possibilities: constant column sums and row sums, one set constant theother 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 thecredible intervals for several of these measures.3. The Bayesian ApproachIn the estimation of the difference of two proportions the Bayesian approachcertainly plays an important role. Agresti and Coull [9] provide some interestingremarks on various approaches.Again, let π π 1 π 2 . Using the Bayesian approach will certainly encountersome 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 sometime ago and is recalled below.3.1. Bayesian Test on the Equality of Two ProportionsLet us recall first the following theorem:Theorem 1: Let π i beta (α i , βi ) , for i 1, 2 be two independent beta dis-tributed random variables with parameters(α1 , β1 )(α 2 , β 2 ) , respectively.( 1,1) as follows:andThen the difference π π 1 π 2 has density defined on B (α 2 , β1 ) x β1 β2 1 (1 x )α 2 β1 1 F β , α α β β 2,1 α ; β α ; (1 x ) ,1 x 2A, 0 x 1111212112 pπ ( x ) B (α1 α 2 1; β1 β 2 1) A, x 0, if α1 α 2 1, β1 β 2 1(1) β1 β 2 1α1 β 2 1(1 x ) B (α1 , β 2 )( x ) F1 β 2 ,1 α 2 ,1 α 2 ; α1 α 2 β1 β 2 2, α1 β 2 ;1 x 2 ,1 x A, 1 x 0 ((()))A B (α1 , β1 ) B (α 2 , β 2 )3

T. Pham-Gia et al.F1 (.) is Appell’s first hypergeometric function, which is defined asiji j a [ ] b[ ] b [ ] x i x jF1 ( a, b1 , b2 ; c; x1 , x2 ) [i j ] 1 2 1 2i! j! i 0 j 0 c(2)]a ( a 1) ( a b 1) . This infinite series is convergent for x1 1where a[ band x2 1 , where, as shown by Euler, it can also be expressed as a convergentintegral:1Γ (c)c a 1 b bu a 1 (1 u )(1 ux1 ) 1 (1 ux2 ) 2 du Γ (a) Γ (c a) 0(3)which converges for c a 0 , a 0 . In fact, Pham-Gia and Turkkan [1] established the expression of the density of the difference using (3) directly andnot 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 F1 (.) .Here, we denote the above density (1) by π ψ (α1 , β1 , α 2 , β 2 ) .Proof: See Pham-Gia and Turkkan [1].The prior distribution of π is hence ψ (α1 , β1 , α 2 , β 2 ) , obtained from the twobeta priors. Various approaches in Bayesian testing are given below.Bayesian Testing Using a Significance LevelWhile frequentist statistics frequently does not test H 0 : π η vs. H1 : π η ,for η 0 and limits itself to the case η 0 , Bayesian statistics can easily do it.a) One-sided test:Proposition 1: To perform the above test at the 0.05 significance level, usingthe two independent samples { X 1,i }i 1 and { X 2,i }i 1 , we compute pπ1 π 2 π 1 π 2 α1 , β1 , α 2 β 2 , where α α i xi and βi βi ni xi , i 1, 2 .iThis expression of the posterior density of π , obtained by the conjugacy of bin2n1()nomial sampling with the beta prior, will allow us to compute P (π η ) andcompare it with the significance level α .For example, as in the frequentist example of Section 2.1, we considern1 25 , x1 17 , n2 20 , x2 8 and use two non-informative beta priors,that is, Beta ( 0.5, 0.5 ) .We note first that πˆ1 17 25 0.68, πˆ 2 8 20 0.40 , giving πˆ 0.28 .We obtain the prior and posterior distributions of π 1 and π 2 (Figure 1).We wish to test:H 0 : π 0.35 vs H1 : π 0.35(4)We have α 17.5, β 8.5, α 8.5, β 12.5 : H1 has posterior proba 1bility Pr (π 0.35 ) 11 2 2;17.5,8.5,8.5,12.5 )dx ψ ( x 0.2855 , and we fail to reject0.35H 0 at the 0.05% level. This means that data combined with our judgment is notenough to make us accept that the difference of these proportions exceeds 0.35.Naturally, different informative, or non-informative, priors can be consideredfor π 1 and π 2 separately, and the test can be carried out in the same way.b) Point-null hypothesis:The point null hypothesis H 0 : π η vs. H1 : π η to be tested at the significance level α in Bayesian statistics has been a subject of study and discussion4

5T. Pham-Gia et al.3012Density4PosteriorPrior0. 15(a)3012Density4PosteriorPrior0. 2(a)Figure 1. (a) Prior Beta ( 0.5,0.5 ) and posterior Beta (17.5,8.5 ) ofπ 1 and (b) Prior Beta ( 0.5,0.5 ) and posterior Beta ( 8.5,12.5 ) ofπ2 .in the literature. Several difficulties still remain concerning this case, especiallyon the prior probability assigned to the value η (see Berger [10]). We use hereLindley’s compromise (Lee [11]), which consists of computing the (1 α )100%highest posterior density interval and accept or reject H 0 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 acceptH 0 (see Figure 2), al5

T. Pham-Gia et al.though the lower bound of the hpd interval can be considered as zero and wecan practically reject H 0 .We can see that the above conclusions on π are consistent with each other.3.2. Bayesian Testing Using the Bayes FactorBayesian 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 alternativeone, when data is taken into consideration. This factor is defined as the ratio ofthe 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 factorassociated with the difference of two proportions. We consider two cases:a) Simple hypothesis: H 0 : π a vs H1 : π b . Then B pπ (π a )pπ (π b ), whichcorresponds to the value of the posterior density of π at a , divided by the value of posterior density of π at b . As an application, let us consider the following hypotheses (different from the previous numerical example):H 0 : π 0.35 vs. H1 : π 0.25 , where we have uniform priors for both π 1 andπ 2 , and where we consider the sampling results from Table 1. We obtain theposterior parameters α1 18, β1 9, α 2 9, β 2 13 . Using the density of thedifference (1), we calculate the Bayes factor,ψ 0.35 α1 , β1 , α 2 , β 2 B 0.8416 . This value indicates that the data slightlyψ 0.25 α1 , β1 , α 2 , β 2 (())3.0favor H1 over H 0 , which is a logical conclusion since πˆ 0.28 0- 1 2Figure 2. Prior ψ ( 0.5,0.5,0.5,0.5 ) and posterior ψ (17.5,8.5,8.5,12.5 )distributions of π . The red dashed lines correspond to the bounds of theposterior 95%-hpd interval.6

T. Pham-Gia et al.Table 1. Data on customers in area A and B.AreaResponseABCombined ResponseYes17825No81220Totals252045b) Composite hypothesis: As an application, let us consider the hypotheses(4), that is, H 0 : π 0.35 vs. H1 : π 0.35 .In general, H 0 : π Θ0 vs. H1 : π Θ1 , where Θ0 Θ1 R . We have p0 Pr (π Θ0 posterior ) and p1 Pr (π Θ1 posterior ) (or p1 1 p0 ) asposterior probabilities. Consequently, we define the posterior odds on H 0against H1 as p0 p1 . Similarly, we have the prior odds on H 0 against H1 ,pzwhich we define here as z0 z1 . The Bayes factor is B 0 1 . Again, we use thep1 z0sampling results from Table 1, yielding the prior and posterior distributionspresented in Figure 1 with Beta ( 0.5, 0.5 ) prior separately for both proportions.()Now, using (4), π ψ α1 , β1 , α 2 , β 2 , we can determine the required priorand posterior probabilities. For example, p0 0.35 ψ ( t α1 , β1 , α 2 , β 2 )dt gives 1p0 0.7145 .