Presentation is loading. Please wait.

Presentation is loading. Please wait.

Copyright © 2013, 2009, and 2007, Pearson Education, Inc. Chapter 11 Analyzing the Association Between Categorical Variables Section 11.2 Testing Categorical.

Similar presentations


Presentation on theme: "Copyright © 2013, 2009, and 2007, Pearson Education, Inc. Chapter 11 Analyzing the Association Between Categorical Variables Section 11.2 Testing Categorical."— Presentation transcript:

1

2 Copyright © 2013, 2009, and 2007, Pearson Education, Inc. Chapter 11 Analyzing the Association Between Categorical Variables Section 11.2 Testing Categorical Variables for Independence

3 Copyright © 2013, 2009, and 2007, Pearson Education, Inc. 3 Testing Categorical Variables for Independence Create a table of frequencies divided into the categories of the two variables:  The hypotheses for the test are: : The two variables are independent. : The two variables are dependent (associated). The test assumes random sampling and a large sample size (cell counts in the frequency table of at least 5).

4 Copyright © 2013, 2009, and 2007, Pearson Education, Inc. 4 Expected Cell Counts If the Variables Are Independent The count in any particular cell is a random variable.  Different samples have different count values. The mean of its distribution is called an expected cell count.  This is found under the presumption that is true.

5 Copyright © 2013, 2009, and 2007, Pearson Education, Inc. 5 How Do We Find the Expected Cell Counts? Expected Cell Count: For a particular cell, The expected frequencies are values that have the same row and column totals as the observed counts, but for which the conditional distributions are identical (this is the assumption of the null hypothesis).

6 Copyright © 2013, 2009, and 2007, Pearson Education, Inc. 6 Table 11.5 Happiness by Family Income, Showing Observed and Expected Cell Counts. We use the highlighted totals to get the expected count of 66.86 = (315 * 423)/1993 in the first cell. How Do We Find the Expected Cell Counts?

7 Copyright © 2013, 2009, and 2007, Pearson Education, Inc. 7 Chi-Squared Test Statistic The chi-squared statistic summarizes how far the observed cell counts in a contingency table fall from the expected cell counts for a null hypothesis.

8 Copyright © 2013, 2009, and 2007, Pearson Education, Inc. 8 State the null and alternative hypotheses for this test.  : Happiness and family income are independent  : Happiness and family income are dependent (associated) Example: Happiness and Family Income

9 Copyright © 2013, 2009, and 2007, Pearson Education, Inc. 9 Report the statistic and explain how it was calculated.  To calculate the statistic, for each cell, calculate:  Sum the values for all the cells.  The value is 106.955. Example: Happiness and Family Income

10 Copyright © 2013, 2009, and 2007, Pearson Education, Inc. 10 Example: Happiness and Family Income

11 Copyright © 2013, 2009, and 2007, Pearson Education, Inc. 11 Insight: The larger the value, the greater the evidence against the null hypothesis of independence and in support of the alternative hypothesis that happiness and income are associated. The Chi-Squared Test Statistic

12 Copyright © 2013, 2009, and 2007, Pearson Education, Inc. 12 The Chi-Squared Distribution To convert the test statistic to a P-value, we use the sampling distribution of the statistic. For large sample sizes, this sampling distribution is well approximated by the chi-squared probability distribution.

13 Copyright © 2013, 2009, and 2007, Pearson Education, Inc. 13 Figure 11.3 The Chi-Squared Distribution. The curve has larger mean and standard deviation as the degrees of freedom increase. Question: Why can’t the chi-squared statistic be negative? The Chi-Squared Distribution

14 Copyright © 2013, 2009, and 2007, Pearson Education, Inc. 14 Main properties of the chi-squared distribution:  It falls on the positive part of the real number line.  The precise shape of the distribution depends on the degrees of freedom: The Chi-Squared Distribution

15 Copyright © 2013, 2009, and 2007, Pearson Education, Inc. 15 Main properties of the chi-squared distribution (cont’d):  The mean of the distribution equals the df value.  It is skewed to the right.  The larger the value, the greater the evidence against : independence. The Chi-Squared Distribution

16 Copyright © 2013, 2009, and 2007, Pearson Education, Inc. 16 Table 11.7 Rows of Table C Displaying Chi-Squared Values. The values have right-tail probabilities between 0.250 and 0.001. For a table with r = 3 rows and c = 3 columns, df = (r - 1) x (c - 1) = 4, and 9.49 is the chi-squared value with a right-tail probability of 0.05. The Chi-Squared Distribution

17 Copyright © 2013, 2009, and 2007, Pearson Education, Inc. 17 The Five Steps of the Chi-Squared Test of Independence 1.Assumptions:  Two categorical variables  Randomization  Expected counts in all cells

18 Copyright © 2013, 2009, and 2007, Pearson Education, Inc. 18 2. Hypotheses:  The two variables are independent  The two variables are dependent (associated) The Five Steps of the Chi-Squared Test of Independence

19 Copyright © 2013, 2009, and 2007, Pearson Education, Inc. 19 3. Test Statistic: The Five Steps of the Chi-Squared Test of Independence

20 Copyright © 2013, 2009, and 2007, Pearson Education, Inc. 20 4. P-value:  Right-tail probability above the observed value, for the chi-squared distribution with. 5. Conclusion:  Report P-value and interpret in context. If a decision is needed, reject when P-value significance level. The Five Steps of the Chi-Squared Test of Independence

21 Copyright © 2013, 2009, and 2007, Pearson Education, Inc. 21 Chi-Squared is Also Used as a “Test of Homogeneity” The chi-squared test does not depend on which is the response variable and which is the explanatory variable. When a response variable is identified and the population conditional distributions are identical, they are said to be homogeneous.  The test is then referred to as a test of homogeneity.

22 Copyright © 2013, 2009, and 2007, Pearson Education, Inc. 22 Chi-Squared and the Test Comparing Proportions in 2x2 Tables In practice, contingency tables of size 2x2 are very common. They often occur in summarizing the responses of two groups on a binary response variable.  Denote the population proportion of success by in group 1 and in group 2.  If the response variable is independent of the group,, so the conditional distributions are equal.  is equivalent to independence

23 Copyright © 2013, 2009, and 2007, Pearson Education, Inc. 23 Example: Aspirin and Heart Attacks Revisited Table 11.9 Annotated MINITAB Output for Chi-Squared Test of Independence of Group (Placebo, Aspirin) and Whether or Not Subject Died of Cancer. The same P-value results as with a two-sided Z test comparing the two population proportions.

24 Copyright © 2013, 2009, and 2007, Pearson Education, Inc. 24 What are the hypotheses for the chi-squared test for these data?  The null hypothesis is that whether a doctor has a heart attack is independent of whether he takes placebo or aspirin.  The alternative hypothesis is that there’s an association. Example: Aspirin and Heart Attacks Revisited

25 Copyright © 2013, 2009, and 2007, Pearson Education, Inc. 25 Report the test statistic and P-value for the chi- squared test:  The test statistic is 11.35 with a P-value of 0.001. This is very strong evidence that the population proportion of heart attacks differed for those taking aspirin and for those taking placebo. The sample proportions indicate that the aspirin group had a lower rate of heart attacks than the placebo group. Example: Aspirin and Heart Attacks Revisited

26 Copyright © 2013, 2009, and 2007, Pearson Education, Inc. 26 Limitations of the Chi-Squared Test If the P-value is very small, strong evidence exists against the null hypothesis of independence. But… The chi-squared statistic and the P-value tell us nothing about the nature of the strength of the association. We know that there is statistical significance, but the test alone does not indicate whether there is practical significance as well.

27 Copyright © 2013, 2009, and 2007, Pearson Education, Inc. 27 The chi-squared test is often misused. Some examples are:  When some of the expected frequencies are too small.  When separate rows or columns are dependent samples.  Data are not random.  Quantitative data are classified into categories - results in loss of information. Limitations of the Chi-Squared Test

28 Copyright © 2013, 2009, and 2007, Pearson Education, Inc. 28 “Goodness of Fit” Chi-Squared Tests The Chi-Squared test can also be used for testing particular proportion values for a categorical variable.  The null hypothesis is that the distribution of the variable follows a given probability distribution; the alternative is that it does not.  The test statistic is calculated in the same manner where the expected counts are what would be expected in a random sample from the hypothesized probability distribution.  For this particular case, the test statistic is referred to as a goodness-of-fit statistic.


Download ppt "Copyright © 2013, 2009, and 2007, Pearson Education, Inc. Chapter 11 Analyzing the Association Between Categorical Variables Section 11.2 Testing Categorical."

Similar presentations


Ads by Google