#  2 Test of Independence. Hypothesis Tests Categorical Data.

## Presentation on theme: " 2 Test of Independence. Hypothesis Tests Categorical Data."— Presentation transcript:

 2 Test of Independence

Hypothesis Tests Categorical Data

 2 Test of Independence Shows if a relationship exists between 2 categorical variables – One sample is drawn – Does not show nature of relationship – Does not show causality Similar to testing p 1 = p 2 = … = p c Used widely in marketing Uses contingency (XTAB) table

 2 Test of Independence Contingency Table Shows # observations from 1 sample jointly in 2 categorical variables Levels of variable 2 Levels of variable 1

 2 Test of Independence Hypotheses & Statistic Hypotheses – H 0 : Variables are independent – H 1 : Variables are related (dependent)

 2 Test of Independence Hypotheses & Statistic Hypotheses – H 0 : Variables are independent – H 1 : Variables are related (dependent) Test statistic Observed frequency Expected frequency

 2 Test of Independence Hypotheses & Statistic Hypotheses – H 0 : Variables are independent – H 1 : Variables are related (dependent) Test statistic Degrees of freedom: (r - 1)(c - 1) Observed frequency Expected frequency Rows Columns

 2 Test of Independence Expected Frequencies Statistical independence means joint probability equals product of marginal probabilities – P(A and B) = P(A)·P(B) Compute marginal probabilities Multiply for joint probability Expected frequency is sample size times joint probability

Expected Frequencies Calculation 82·112 160 78·48 160 82·48 160 78·112 160 Expected frequency = (row total*column total)/grand total

You’re a marketing research analyst. You ask a random sample of 286 consumers if they purchase Diet Pepsi or Diet Coke. At the.05 level, is there evidence of a relationship?  2 Test of Independence Example

 2 Test of Independence Solution H 0 : No Relationship H 1 : Relationship  =.05 df = (2 - 1)(2 - 1) = 1 Critical Value(s): Test Statistic: Decision:Conclusion:  =.05

Expected Frequencies Solution f e  5 in all cells 132·170 286 154·170 286 132·116 286 132·154 286

 2 Test of Independence Test Statistic Solution

 2 Test of Independence Solution H 0 : No Relationship H 1 : Relationship  =.05 df = (2 - 1)(2 - 1) = 1 Critical Value(s): Test Statistic: Decision:Conclusion:  =.05

 2 Test of Independence Solution H 0 : No Relationship H 1 : Relationship  =.05 df = (2 - 1)(2 - 1) = 1 Critical Value(s): Test Statistic: Decision:Conclusion: Reject at  =.05  =.05

 2 Test of Independence Solution H 0 : No Relationship H 1 : Relationship  =.05 df = (2 - 1)(2 - 1) = 1 Critical Value(s): Test Statistic: Decision:Conclusion: Reject at  =.05 There is evidence of a relationship  =.05

OK. There is a statistically significant relationship between purchasing Diet Coke & Diet Pepsi. So what do you think the relationship is? Aren’t they competitors?  2 Test of Independence Thinking Challenge AloneGroupClass

You Re-Analyze the Data Low Income High Income

True Relationships* Apparent relation Underlying causal relation Control or intervening variable (true cause) Diet Coke Diet Pepsi

Moral of the Story* Numbers don’t think - People do! © 1984-1994 T/Maker Co.

This Class... What was the most important thing you learned in class today? What do you still have questions about? How can today’s class be improved? Please take a moment to answer the following questions in writing: