Analysis of two-way tables - Inference for two-way tables IPS chapter 9.2 © 2006 W.H. Freeman and Company.

Slides:



Advertisements
Similar presentations
CHAPTER 23: Two Categorical Variables: The Chi-Square Test
Advertisements

CHAPTER 23: Two Categorical Variables The Chi-Square Test ESSENTIAL STATISTICS Second Edition David S. Moore, William I. Notz, and Michael A. Fligner Lecture.
Chapter 13: Inference for Tables
Does Background Music Influence What Customers Buy?
Chapter 13: Inference for Distributions of Categorical Data
Copyright ©2011 Brooks/Cole, Cengage Learning More about Inference for Categorical Variables Chapter 15 1.
Copyright ©2006 Brooks/Cole, a division of Thomson Learning, Inc. More About Categorical Variables Chapter 15.
1 Chi-Squared Distributions Inference for Categorical Data and Multiple Groups.
CHAPTER 11 Inference for Distributions of Categorical Data
Analysis of Two-Way Tables Inference for Two-Way Tables IPS Chapter 9.1 © 2009 W.H. Freeman and Company.
Statistics 303 Chapter 9 Two-Way Tables. Relationships Between Two Categorical Variables Relationships between two categorical variables –Depending on.
Chapter 9 Hypothesis Testing.
1 Chapter 20 Two Categorical Variables: The Chi-Square Test.
Presentation 12 Chi-Square test.
+ The Practice of Statistics, 4 th edition – For AP* STARNES, YATES, MOORE Chapter 11: Inference for Distributions of Categorical Data Section 11.2 Inference.
Lesson Inference for Two-Way Tables. Vocabulary Statistical Inference – provides methods for drawing conclusions about a population parameter from.
Analysis of Two-Way Tables
Analysis of Count Data Chapter 26
Goodness-of-Fit Tests and Categorical Data Analysis
A random sample of 300 doctoral degree
Analysis of Count Data Chapter 14  Goodness of fit  Formulas and models for two-way tables - tests for independence - tests of homogeneity.
Analysis of two-way tables - Formulas and models for two-way tables - Goodness of fit IPS chapters 9.3 and 9.4 © 2006 W.H. Freeman and Company.
1 Desipramine is an antidepressant affecting the brain chemicals that may become unbalanced and cause depression. It was tested for recovery from cocaine.
Chapter 11 Chi-Square Procedures 11.3 Chi-Square Test for Independence; Homogeneity of Proportions.
Analysis of Count Data Chapter 26  Goodness of fit  Formulas and models for two-way tables - tests for independence - tests of homogeneity.
Analysis of two-way tables - Formulas and models for two-way tables - Goodness of fit IPS chapters 9.3 and 9.4 © 2006 W.H. Freeman and Company.
Warm-up Researchers want to cross two yellow- green tobacco plants with genetic makeup (Gg). See the Punnett square below. When the researchers perform.
Lecture 9 Chapter 22. Tests for two-way tables. Objectives The chi-square test for two-way tables (Award: NHST Test for Independence)  Two-way tables.
Chi-Square Procedures Chi-Square Test for Goodness of Fit, Independence of Variables, and Homogeneity of Proportions.
FPP 28 Chi-square test. More types of inference for nominal variables Nominal data is categorical with more than two categories Compare observed frequencies.
13.2 Chi-Square Test for Homogeneity & Independence AP Statistics.
Analysis of Two-Way tables Ch 9
+ Chi Square Test Homogeneity or Independence( Association)
Chi-Square Analysis Test of Homogeneity. Sometimes we compare samples of different populations for certain characteristics. This data is often presented.
BPS - 5th Ed. Chapter 221 Two Categorical Variables: The Chi-Square Test.
Analysis of two-way tables - Inference for two-way tables IPS chapter 9.1 © 2006 W.H. Freeman and Company.
Chapter 11 Chi- Square Test for Homogeneity Target Goal: I can use a chi-square test to compare 3 or more proportions. I can use a chi-square test for.
+ The Practice of Statistics, 4 th edition – For AP* STARNES, YATES, MOORE Chapter 11: Inference for Distributions of Categorical Data Section 11.2 Inference.
CHAPTER 23: Two Categorical Variables The Chi-Square Test ESSENTIAL STATISTICS Second Edition David S. Moore, William I. Notz, and Michael A. Fligner Lecture.
Statistical Significance for a two-way table Inference for a two-way table We often gather data and arrange them in a two-way table to see if two categorical.
Lecture 9 Chapter 22. Tests for two-way tables. Objectives (PSLS Chapter 22) The chi-square test for two-way tables (Award: NHST Test for Independence)[B.
AP STATISTICS LESSON (DAY 1) INFERENCE FOR TWO – WAY TABLES.
+ Chapter 11 Inference for Distributions of Categorical Data 11.1Chi-Square Goodness-of-Fit Tests 11.2Inference for Relationships.
Lesson Inference for Two-Way Tables. Knowledge Objectives Explain what is mean by a two-way table. Define the chi-square (χ 2 ) statistic. Identify.
Copyright © 2013, 2009, and 2007, Pearson Education, Inc. Chapter 11 Analyzing the Association Between Categorical Variables Section 11.2 Testing Categorical.
Lecture PowerPoint Slides Basic Practice of Statistics 7 th Edition.
Chapter 13- Inference For Tables: Chi-square Procedures Section Test for goodness of fit Section Inference for Two-Way tables Presented By:
Lecture PowerPoint Slides Basic Practice of Statistics 7 th Edition.
BPS - 5th Ed. Chapter 221 Two Categorical Variables: The Chi-Square Test.
The Practice of Statistics, 5th Edition Starnes, Tabor, Yates, Moore Bedford Freeman Worth Publishers CHAPTER 11 Inference for Distributions of Categorical.
Chapter 13 Section 2. Chi-Square Test 1.Null hypothesis – written in words 2.Alternative hypothesis – written in words – always “different” 3.Alpha level.
Statistics for Business and Economics Module 2: Regression and time series analysis Spring 2010 Lecture 2: Chi–squared tests; goodness–of–fit & independence.
Chapter 14 Inference for Distribution of Categorical Variables: Chi-Squared Procedures.
Chapter 11: Categorical Data n Chi-square goodness of fit test allows us to examine a single distribution of a categorical variable in a population. n.
Class Seven Turn In: Chapter 18: 32, 34, 36 Chapter 19: 26, 34, 44 Quiz 3 For Class Eight: Chapter 20: 18, 20, 24 Chapter 22: 34, 36 Read Chapters 23 &
Chi Square Procedures Chapter 14. Chi-Square Goodness-of-Fit Tests Section 14.1.
AP Stats Check In Where we’ve been… Chapter 7…Chapter 8… Where we are going… Significance Tests!! –Ch 9 Tests about a population proportion –Ch 9Tests.
11/12 9. Inference for Two-Way Tables. Cocaine addiction Cocaine produces short-term feelings of physical and mental well being. To maintain the effect,
22. Chi-square test for two-way tables
Objectives (PSLS Chapter 22)
Objectives (BPS chapter 23)
Two-Way Tables and The Chi-Square Test*
22. Chi-square test for two-way tables
Section 13.2 Chi-square Test of Association / Independence
Chapter 11: Inference for Distributions of Categorical Data
Analyzing the Association Between Categorical Variables
Comparing Proportions for Multiple Populations
Chapter 13: Chi-Square Procedures
Analysis of two-way tables
Presentation transcript:

Analysis of two-way tables - Inference for two-way tables IPS chapter 9.2 © 2006 W.H. Freeman and Company

Objectives (IPS chapter 9.2) Inference for two-way tables  The “no association” hypothesis  Expected counts in two-way tables  The Chi-square test

Hypothesis: no association Again, we want to know if the differences in sample proportions between groups are likely to have occurred by chance. We use the chi-square (   ) test to assess the hypothesis of no relationship between the two categorical variables of a two-way table.

Expected counts in two-way tables Two-way tables summarize the data according to two categorical variables. We want to test the hypothesis that there is no relationship between these two categorical variables (H 0 ). To test this hypothesis, we compare actual counts from the sample data with expected counts assuming the hypothesis of no relationship. The expected count in any cell of a two-way table when H 0 is true is:

Expected counts in two-way tables If there is no difference between the row proportions for the various columns then we can estimate the common proportion for any row as total for that row divided by n. If we apply that proportion to the column total (multiplication) we get the formula given on the previous page. That number represents the number of observations we expect to see in the cell if there is no association between the row and column factors.

Cocaine addiction Cocaine produces short-term feelings of physical and mental well being. To maintain that effect, the drug may have to be taken more frequently and at higher doses. After stopping use, users may feel tired, sleepy or depressed. The pleasurable high followed by unpleasant after-effects encourage repeated compulsive use, which can easily lead to dependency. Desipramine is an antidepressant that acts on the brain in a way that may mitigate depression. It was tested to see if it aided recovery from cocaine addiction. Treatment with desipramine was compared to a standard treatment (lithium) and a placebo.

25*26/74 ≈ Desipramine Lithium Placebo Expected relapse counts No Yes 35% Expected Observed Cocaine addiction

The chi-square statistic (  2 ) is a measure of how much the observed cell counts in a two-way table diverge from the expected cell counts. The formula for the  2 statistic is given by Large values for  2 are caused by large deviations from the expected counts and provide strong evidence against H 0. How large is “Large”? The chi-square test

For the chi-square test, H 0 states that there is no association between the row and column variables in a two-way table. The alternative is that these variables are related. If H 0 is true, the chi-square test statistic has approximately a χ 2 distribution with (r − 1)(c − 1) degrees of freedom. See Table F in the textbook. The P-value for the chi-square test is the area to the right of  2 under the  2 distribution with df (r−1)(c−1): P(χ 2 ≥ X 2 ).

Table F  If we have 3 rows and 3 columns then degrees of freedom is  (3-1)*(3-1) = 4  If we are interested in choosing a large value we are unlikely to reach by chance we might select the 95 th percentile since there is only a 5% chance of getting a number that large if H o is true.  From page T-20 we get the value 9.49  If we calculate  2 from the sample and if that value is greater than 9.49 then we are likely to conclude that we have strong evidence against H o.

When is it safe to use a  2 test? We can safely use the chi-square test when:  All individual expected counts are 1 or more (≥1)  No more than 20% of expected counts are less than 5 (< 5)  For a 2x2 table, this implies that all four expected counts should be 5 or more.

Chi-square test vs. z-test for two proportions When comparing only two proportions such as in a 2x2 table where the columns represent counts of “success” and “failure,” we can test H 0 : p 1 = p 2 vs. H a p 1 ≠ p 2 equally with a two-sided z-test or with a chi-square test with 1 degree of freedom and get the same p-value. In fact, the two test statistics are related by the simple expression X 2 = (z) 2.

Observed Cocaine addiction The p-value is or half a percent. This is very significant. We reject the null hypothesis of no association and conclude that there is a significant relationship between treatment (desipramine, lithium, placebo) and outcome (relapse or not). Minitab statistical software output for the cocaine study

Successful firms Franchise businesses are often given exclusive rights to a territory. This means that the outlet will not have to compete with other outlets of the same chain within that territory. How does the presence of an exclusive-territory clause in the contract relate to the survival of the business? A random sample of 170 new franchises recorded two categorical variables for each firm: (1) whether the firm was successful or not (based on economic criteria) and (2) whether or not the firm had an exclusive-territory contract. This is a 2x2 table (two levels for success, yes/no; two levels for exclusive territory, yes/no).  df = (2 − 1)(2 − 1) = 1

Successful firms How does the presence of an exclusive-territory clause in the contract relate to the survival of the business? To compare firms that have an exclusive territory with those that do not, we start by examining column percents (conditional distribution): The difference between the percent of successes among the two types of firms is quite large. The chi-square test can tell us whether or not these differences can be plausibly attributed to chance. Specifically, we will test H 0 : No relationship between exclusivity clause and success H a : There is some relationship between the two variables

The p-value is significant at  5% (p is about 1.5%) so we reject H 0 : we have found a significant relationship between an exclusive territory and the success of a franchised firm. Successful firms Here is the chi-square output from Minitab: