Chapter 11 Comparisons Involving Proportions and A Test of Independence 1 Chapter Outline Goodness of Fit test Test of Independence 2 Goodness of Fit Test Hypothesis test for proportions of a multinomial population It compares the observed and expected frequencies in each category to test either that all categories contain the same proportion of values or that each category contains a user-specified proportion of values. 3 Goodness of Fit Test Procedure 1. Set up the null and alternative hypotheses; 2. Select a random sample and record the observed frequency, fi, for each of the k categories; 3. Assuming H0 is true, compute the expected frequency, ei, in each category by multiplying the category probability by the sample size. 4 Goodness of Fit Test Procedure 4. Compute the value of the test statistic: 2 ( f e ) 2 i i ei i 1 k where: fi = observed frequency for category i ei = expected frequency for category i k = number of categories Note: The test statistic has a chi-square distribution with k – 1 degrees of freedom provided that the expected frequencies are 5 or more for all categories. 5 Goodness of Fit Test Procedure 5. Rejection rule: p-value approach: Reject H0 if p-value < 2 2 Reject H if Critical value approach: 0 where is the significance level and there are k - 1 degrees of freedom 6 Goodness of Fit Test Example: Market Share In the Scott Market Research example in the textbook, after company C introduced a new product to the market, a survey was conducted on 200 customers to study if there is any change in the market shares. Out of the 200 customers, 48 prefer company A’s product, 98 prefer company B’s, and 54 prefer company’s C’s. Before the introduction of the new product by company C, the market shares of the three companies were: p A 0.3, pB 0.5, pC 0.2 7 Goodness of Fit Test Example: Market Share Hypotheses H0: pA = .3; pB = .5; pC = .2 Ha: The population proportions are not pA = .3; pB = .5; pC = .2 where: pA = the population market share of company A; pB = the population market share of company B; pC = the population market share of company C. 8 Goodness of Fit Test Example: Market Share Rejection rule Reject H0 if p-value < .05 or 2 > 5.99. With = .05 and k-1=3-1=2 degrees of freedom Do Not Reject H0 Reject H0 5.99 2 9 Goodness of Fit Test Example: Market Share Expected Frequencies eA=.3(200)=60; eB=.5(200)=100; eC=.2(200)=40 Observed Frequencies fA = 48; fB = 98; fC = 54 Test Statistic 2 2 2 48 60 98 100 54 40 2 60 = 2.4+0.04+4.9 = 7.34 100 40 10 Goodness of Fit Test Example: Market Share p-Value Approach Area in Upper Tail 2 Value (df = 2) .10 4.6 .05 5.99 .025 7.38 .01 9.21 .005 10.60 Because 2 = 7.34 is between 5.99 and 7.38, the area in the upper tail of the distribution is between .05 and .025. The p-value < = .05. We can reject the null hypothesis. 11 Goodness of Fit Test Example: Market Share Critical Value Approach 2 = 7.34 > 5.99 We reject, at the .05 level of significance, the assumption that the market shares of companies A, B, and C remain the same after Company C introduced a new product. 12 Test of Independence: Contingency Tables Hypothesis test for independence between two variables. Similar to a Goodness of Fit test, it computes 2 test statistic based on the observed frequencies and expected frequencies (assuming the null hypothesis is true, i.e. the two variables are independent from each other). 13 Test of Independence Procedure 1. Set up the null and alternative hypotheses; 2. Select a random sample and record the observed frequency, fij, for each cell of the contingency table; 3. Assuming H0 is true, compute the expected frequency, eij, for each cell as follows: (Row i Total)(Column j Total) eij Sample Size 14 Test of Independence Procedure 4. Compute the test statistic 2 i j ( f ij eij ) 2 eij 5. Determine the rejection rule 2 2 Reject H0 if p -value < or . where is the significance level and, with n rows and m columns, there are (n - 1)(m - 1) degrees of freedom. 15 Test of Independence Example: Field of Study The following table shows the results of recent study regarding gender of individuals and their selected field of study. Field of Study Medicine Business Engineering Total Male 80 60 160 300 Female 40 20 40 100 Total 120 80 200 400 16 Test of Independence Example: Field of Study Hypothesis H0: Field of study is independent of gender Ha: Field of study is not independent of gender 17 Test of Independence Example: Field of Study Expected Frequencies Field of Study Medicine Business Engineering Total Male 300*120/400 300*80/400 =90 =60 300*200/400 =150 300 Female 100*120/400 100*80/400 =30 =20 100*200/400 =50 100 200 400 Total 120 80 18 Test of Independence Example: Field of Study Rejection Rule Reject H0 if p-value < =.05 or 2 > 5.99 [d.f. = (2-1)(3-1)=2]. Test Statistic 2 2 80 90 60 60 2 90 60 2 40 50 50 = 1.11 + 0 + . . . + 2 = 7.11 19 Test of Independence Example: Field of Study p-Value Approach Area in Upper Tail 2 Value (df = 2) .10 4.6 .05 5.99 .025 7.38 .01 9.21 .005 10.60 Because 2 = 7.11 is between 5.99 and 7.38, the area in the upper tail of the distribution is between .05 and .025. The p-value < = .05. We can reject the null hypothesis. 20 Test of Independence Example: Field of Study Critical Value Approach 2 = 7.11 > 5.99 We reject, at the .05 level of significance, the null hypothesis that the selected field of study is independent of gender. 21