Chapter 18 Chi-Square Tests
2 Distribution Let x 1, x 2,.. x n be a random sample from a normal distribution with and 2, and let s 2 be the sample variance, then the random variable (n-1)s 2 / 2 has 2 distribution with n-1 degrees of freedom. Probability Density Function, with k degrees of freedom, Mean Variance Mode = k-2 (when k 3)
2 Distribution fr.academic.ru/pictures/frwiki/67/Chi-square_..
2 Distribution Goodness-of-fit Tests Tests of Independence Tests of Homogeneity
Multinominal Experiments A Multinomial experiment is a statistical experiment that has the following properties: It consists of n repeated trials (repetitions). Each trial can result in one of k possible outcomes. The trials are independent. The probabilities of the various events remain constant for each trial.
Goodness-of-fit Test Observed Frequencies (O i ): Frequencies obtained from the actual performance of an experiment. Goodness-of-fit Test: Test of null hypothesis that the observed frequencies follow certain pattern or theoretical distributions, expressed by the Expected Frequencies (E i ).
Goodness-of-fit Test for Multinominal Experiments Degree of freedom = k -1, where k is the number of categories Chi-square goodness-of-fit test is always a right-tailed test Sample size should be large enough so that the expected frequency for each category is at least 5.
Goodness-of-fit Test for Multinominal Experiments Alt. HypothesisP-valueRejection Criterion H1H1 P( 2 > 0 2 ) 0 2 > 2 ,k-1 Null Hypothesis: H 0 : the observed frequencies follow certain pattern Test statistic: Degree of Freedom = k -1
Goodness-of-fit Test for Multinominal Experiments -- Example 18.1 Department stores in shopping mall H 0 : p 1 = p 2 = p 3 = p 4 = p 5 =.20 H 1 : At least 2 of p i .20 =.01, df = 5 -1 = 4 Test statistic: Critical value: .01,4 = P-value = Reject H 0 OiOi EiEi O i -E i (O i -E i ) 2 (O i -E i ) 2 /E i
Goodness-of-fit Test for Multinominal Experiments -- Example 18.2 Market shares H 0 : p 1 =.144, p 2 =.181, p 3 =.248, p 4 =.141, p 5 =.149, p 6 =.137 H 1 : At least 2 of p i are different =.025, df = 6 -1 = 5 Test statistic: Critical value: .025,5 = P-value =.1252 Fail to reject H 0 OiOi EiEi O i -E i (O i -E i ) 2 (O i -E i ) 2 /E i
Test of Independence for a Contingency Table Contingency Table Columns 12…c Rows1O 11 O 12 …O 1c u1u1 2O 21 O 22 …O 2c u2u2 ……………… rO r1 O r2 …O rc urur 1 2 c
Alt. HypothesisP-valueRejection Criterion H1H1 P( 2 > 0 2 ) 0 2 > 2 ,df Null Hypothesis: H 0 : The two attributes are independent Alt. Hypothesis: H 1 : The two attributes are dependent Test statistic: Degree of Freedom = (r-1)(c-1) Test of Independence for a Contingency Table
Test of Independence for a Contingency Table – Example 18.3 Contingency Table O ij SupportAgainstNo OpinionTotaluiui Female Male Total j E ij SupportAgainstNo Opinion Female Male
Null Hypothesis: H 0 : The two attributes are independent Alt. Hypothesis: H 1 : The two attributes are dependent Test statistic: Degree of Freedom = (r-1)(c-1) = (2-1)(3-1) = 2 Critical value: .025,2 = P-value =.0161 Reject H 0 Test of Independence for a Contingency Table – Example 18.4
Test of Independence for a Contingency Table – Example 18.5 Contingency Table O ij GoodDefectiveTotaluiui Mac Mac Total j E ij GoodDefective Mac Mac 27010
Null Hypothesis: H 0 : The two attributes are independent Alt. Hypothesis: H 1 : The two attributes are dependent Test statistic: Degree of Freedom = (r-1)(c-1) = (2-1)(2-1) = 1 Critical value: .01,1 = P-value =.0809 Fail to reject H 0 Test of Independence for a Contingency Table – Example 18.5
Test of Homogeneity Similar to the test of independence If row/column totals are fixed, perform a test of homogeneity Columns 12…c Rows1O 11 O 12 …O 1c u1u1 2O 21 O 22 …O 2c u2u2 ……………… rO r1 O r2 …O rc urur 1 2 c
Alt. HypothesisP-valueRejection Criterion H1H1 P( 2 > 0 2 ) 0 2 > 2 ,df Null Hypothesis: H 0 : two sets of data are homogeneous Alt. Hypothesis: H 1 : sets of data are not homogeneous Test statistic: Degree of Freedom = (r-1)(c-1) Test of Homogeneity
Test of Independence for a Contingency Table – Example 18.6 Contingency Table O ij Calif.NYTotaluiui Very Satis Somewhat Sat Somewhat Dissat Very Dissatis Total j E ij Calif.NY Very Satis Somewhat Sat Somewhat Dissat Very Dissatis
Null Hypothesis: H 0 : The two states are homogeneous Alt. Hypothesis: H 1 : The two states are not homogeneous Test statistic: Degree of Freedom = (r-1)(c-1) = (4-1)(2-1) = 3 Critical value: .025,3 = P-value = E-9 Reject H 0 Test of Independence for a Contingency Table – Example 18.6