Section 13.5 Test of Hypothesis for Population Proportion

Section 13.5 Test of Hypothesis for Population Proportion  As discussed in Section 11.4-11.5, inference about the probability of success in independe...
Author: Hollie Skinner
7 downloads 0 Views 125KB Size
Section 13.5 Test of Hypothesis for Population Proportion  As discussed in Section 11.4-11.5, inference about the probability of success in independent Bernoulli trials is same as the mean of independent observations on binary outcomes.  If we assume that random variable X i for the ith unit in the population is Binary valued {0,1} [coded values for (H,T), (S,F) (Buy, not Buy) etc.] with P  X i  1   . Then, E ( X i )   , Var ( X i )   (1   ).

 The difference from a general mean problem is that the population variance depends on the mean (proportion).  We wish to test the null hypothesis H0:    0 about the probability of success   from a RS of size n Bernoulli trials, against simple alternatives or composite hypotheses (i )    0 , or (ii )    0 or (iii )    0 .

 In this experiment, the sufficient statistic is X   X i = # of Successes out of n trials. It has a Binomial distribution b( x; n, ) [Appendix B.2]  For this problem, Exercise 12.12(Assigned problem in HW #5) gave a test for simple against simple alternative is a onetailed test based on X.  For composite alternatives, the LR test gives the   level critical regions as follows:

 Reject H0 if (i ) x  k , where k is the smallest integer for which (ii ) x  k , where k is the largest integer for which

n

 b( y; n.

y  k k

 b( y; n. y 0

0

0

)  .

)  .

(iii ) x  k /2 or x  k /2 respectively.

 Example:13.56, 13.57, 13.58, 13.60 – Show how to find Pvalue  Binomial Probability Tables for n  1, , 20, given in the Text.  Tables are available for n up to 100. Excel and Statistical software packages can also be used to obtain these values.  For any n, one can find the P-value for the one-tailed or two tailed test for any  0 .  The   level test rejects the null hypothesis, if P-value <  .  However, for large n, i.e., when [ n0  5 and n(1   0 )  5 ] one can use the CLT to approximate the P-value.  For n large, CLT implies that X 

1  X i is approximately n

normally distributed with E ( X )   , Var ( X )   (1   ) / n.  Under H0: Z

X  0

 0 (1   0 ) / n



X  n 0 n 0 (1   0 )

 N (0,1)

 The test based on Z-statistic is the same as the test for normal mean discussed in Section 13.2.

 Therefore,   level tests for these hypotheses are given by:  Reject H0 if (i ) z  z , (ii ) x   z and (iii ) z  z /2 or z   z /2 respectively.

 Examples: 13.63, 13.66  Note: A better CLT approximation can be obtained by using the continuity correction introduced in Chapter 6, Example 6.5.  But we will not discuss this improvement here, since the test outcome rarely changes, unless the observed value is very close to the cut-off point.  In that case, we may want to obtain more information (larger n) anyway.  The remaining sections in this Chapter are devoted to one of the twenty important scientific breakthroughs of the 20th Century, according to the journal Science: the development of the chi-square statistical test.

 It is applicable to a large class of tests of hypotheses.  In each case, the distribution of the statistic under the null hypothesis, for large samples, can be approximated by the  v2 distribution.

Its d.f.  ( k  1  t ) depends on the dimension (k) of the data summary, and # of free parameters (t) estimated from the data.

 It compares the observed data summaries fi with the expected summaries under the null model ei. If the observed summary vector ( f1 , f 2 , , f k ) is not close to the expected summary vector (e1 , e2 , , ek ) , the chi-squared statistic  2   i 1 k

( fi  ei ) 2 is large, and the level  test is of the form: ei

Reject the Null if  2  2 ; .

 Section 13.6 -Tests for Two or More Proportions  Example:  2 or more (say, k) suppliers of same components  ith producer’s probability of producing acceptable quality components: i  Take a random sample of size n from ith population. i Let Xi = # of successes out of ni Bernoulli Trials.  X i , i  1, 2, , k , mutually independent random variables ~Bin(ni ,i )  Want to test the hypothesis that all suppliers provide same quality product, i.e.,  H 0 : 1   2     k = 0 (known) H 0 : Not all  's are equal to  0  If sample sizes (ni’s) are sufficiently large, CLT allows us to approximate the distribution of X i , i  1, 2, , k , by normal distributions, as discussed in previous section.  Standardize these to independent N (0,1) random variables Zi 

X i  nii , i  1, 2, , k . nii (1  i )

 From Theorem 8.8, we know that the sum of squares of k k independent N (0,1) random variables,  i 1 Z i2 , has a chi  squared distribution with k d.f. , i.e.,  2   i 1 Z i2   k2 . k

 Under the null hypothesis, all i  0 , therefore,  2   i 1 Z i2 , where, Z i  k

X i  ni 0 , i  1, 2, , k . ni 0 (1   0 )

 If one of i ' s is not equal to 0 , then this statistic is expected to be large.  Thus, a level- test is:  Reject H0, if  2  2 ,k .  However, this test is not used much, since in most practical problems, the common value  of these proportions is unknown (not a specified value 0 ). It must be estimated from the data.  Under H0, Xi’s are independent samples from Binomial with unknown parameter  : common prob. of success.  Then the sufficient statistic

k

X i 1

i

 k   Bin   ni ;   i 1 

 The mvue (mle), so called the pooled estimate of  is ˆ  

Xi

 ni



 n ˆ . n i i i

 Now, the chi-squared statistic is modified: Replace  0 by ˆ. ( X  n ˆ) 2    i 1 i i  niˆ(1  ˆ) 2

k

 n (ˆ  ˆ) i

i

i

ˆ(1  ˆ)

2

,

 Its distribution is chi-squared with (k-1) d.f.  The modified chi-squared statistics contains only (k-1) independent random quantities, since

 n (ˆ  ˆ)  0. i

i

 Example: Exercises 13.70, 13.71, page 429

 Connection to estimating the difference of two

proportions.  Under H0, the statistic for estimating the difference of two proportions becomes z 

(ˆ1  ˆ2 ) 1 1 ˆ(1  ˆ)  n1 n2

 For k=2, the two terms in  2  statistics involve    (ˆ1  ˆ) 

n2 n1 (ˆ1  ˆ2 ), (ˆ2  ˆ)   (ˆ1  ˆ2 ). n1  n2 n1  n2

 Now, simple algebra shows that 

2

n (ˆ  ˆ)   i

i

i

ˆ(1  ˆ)

2

 z2

 Chi-squared (or z2) test is for two-sided alternatives. The test based on z can be used for one-sided alternatives.  Chi-squared statistic via a k  2 Table listing observed number of failures and successes.  Another version applicable to a large variety of tests of different hypotheses: k

2

  2   i 1 j 1

( f ij  eij ) 2 eij

, where

fij : observed frequency in cell(i, j ), eij : expected frequency in cell(i, j ) under H 0 .

 Example: Exercise 13.71, and the common version.

 Section 13.7 Test of Hypotheses for

r c

Tables

 Same general procedure is applicable to  (i) Problems involving samples of a fixed size from each of the r populations  Each response has c (c>2) categories.  (Xi: Multinomial based on ni independent trials, with probability vector θi  (i1 ,i 2 , ,ic ); i  1, 2, , r. ).  Hypothesis: The r populations have same underlying probability vector  H 0 : θ1  θ2    θr against the alternative H1 : at least one probability vector is different from others.

 Example: Detergent Preferences, page 418  (ii) Problems involving a large sample of size N from one population.  Categorize each individual according to two attributes, with r and c categories respectively. Let



  ij  P(observation falls in cell(i,j)),  c   i.  P(observation falls in row i)   ij j 1  r  . j  P(observation falls in column j)   ij i 1 

 Null hypothesis is that the two attributes are independent, i.e., H 0 : ij  i.. j for all (i,j).  Example: Exercise 13.77  Both types of problems use the same Chi-squared test procedure:

r

c

    2

i 1 j 1



( f ij  eij ) 2 eij

, where

fij : observed frequency in cell(i, j ), eij : expected frequency in cell(i, j ) under H 0 .

 The degrees of freedom for the chi-squared statistics is   (r  1)(c  1).  The conclusion of the level  test is: Reject the Null if  2  2 ; .

 Case (i): The common probability vector under H0, say, θ  (1 , 2 , , c ) , is estimated by ˆ j  f. j / f ; j  1, , c, where f  total # obs.

 Since the ith row was based on a sample size ni, it follows that fi.  ni , and the expected count in cell (i, j) is equal to eij  ni ˆj  fi. f. j / f .  Overall, there are r(c-1) ij ' s, and we estimated (c-1) parameters in the common probability vector.  So d.f. = # free parameters - # estimated parameters = r(c-1) - (c-1) = (r-1)(c-1) =  If at least one probability vector was different from others, the observed chi-squared will be large. The level  test rejects null if  2  2 ; .  Case(ii): The marginal row and column probabilities for multinomial are estimated by: ˆi.  f i. / f , i  1, 2, , r ; and ˆ. j  f. j / f , j  1, 2, , c.

 Now, under H 0 : ij  i.. j  ˆij  ˆi.ˆ. j .

 Hence, the expected count in cell (i,j) is given by eij  f ˆij  f ˆi.ˆ. j  f i. f. j / f

 Expected counts are same as in case (i).  Now, the d.f. = # free parameters - # estimated parameters = (rc-1) – (r-1) - (c-1)= (r-1)(c-1) =  If the two attributes are not independent, the conditions ij  i.. j would be violated in at least two cells, and the chi-squared statistic would be large. The level  test rejects null if  2  2 ; .

Note that the two test procedures are testing different hypothesis, and the Chi-squared statistics and its degrees of freedom are same, even though they follow very different logic to arrive at the final solution.

 Section 13.8 Testing Goodness of Fit  Given a data set of size n (large).  We wish to test the null hypothesis that the data is a random sample from the distribution p( x, ).  If the parameter  is known, the null distribution p ( x, ) is uniquely specified.  If it is unknown, we will need to find an estimate ˆ assuming that the data is a random sample from the model p( x, ) . Now act as if the distribution under the null is p  p( x,ˆ).  Now assume the values of the random variable X can be partitioned into m disjoint subsets (bins) A1 , A2 , , Am . Let, 

fi  Observed counts in the bin Ai ; pi  P{ X  Ai | p}, and ei  n pi denote the expected counts in bin Ai .

 The chi-squared statistic for testing the fit of the data to the specified model is given by   2   i 1 m

( f i  ei ) 2 . ei

 If the observed frequencies are not close to the expected frequencies in some bins, the chisquared statistic will be large.  The level  test rejects the null if  2  2 ;mt 1 , where m = # of bins and t = # of independent parameters estimated from the data.

 Example: Exercise 13.80 - The null hypothesis is that the 160 tosses of 4 coins follow a Bin(4;.5)  Example: Exercise 13.81 - The null hypothesis is that the data follows a Poisson distribution  Example: Exercise 13.83 - The null hypothesis is that the data follows a Normal distribution Finally, a CAUTIONARY NOTE: “The conclusion not to reject the NULL Hypothesis does not mean that the NULL is true.” See, e.g., http://www.science-projects.com/Chi2.htm We simply start with the assumption that the null is correct, and see if there is ample evidence against the null based on the data. If not, we stay with our assumption. But it could still be untrue. Future evidence might still discover that the null hypothesis is not true. Note: Next few lectures will be devoted to Non-parametric statistics, which does not assume a parametric model for the data.

Suggest Documents