Top Banner
Chapter 13: Chi-Square Test 1
30

Chapter 13: Chi-Square Test 1. Motivating Example Research Question: Among all adults in the U.S. who were in a car accident, is there a relationship.

Mar 30, 2015

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Chapter 13: Chi-Square Test 1. Motivating Example Research Question: Among all adults in the U.S. who were in a car accident, is there a relationship.

1

Chapter 13: Chi-Square Test

Page 2: Chapter 13: Chi-Square Test 1. Motivating Example Research Question: Among all adults in the U.S. who were in a car accident, is there a relationship.

2

Motivating Example

Research Question: Among all adults in the U.S. who were in a car accident, is there a relationship between cell phone use and injury severity?

Sample: 200 randomly-selected U.S. adults who were in car accidents

Results: See Table 11

1This example is entirely fictitious

Page 3: Chapter 13: Chi-Square Test 1. Motivating Example Research Question: Among all adults in the U.S. who were in a car accident, is there a relationship.

3

Table 1: Bivariate TableInjuries Used Cell? Total

Sustained

No Yes

None 82 (82%) 66 (66%) 148Minor 12 (12%) 18 (18%) 30

Severe 6 (6%) 16 (16%) 22Total 100 100 200

Relationship: There is a relationship in the sample; cell phone users are less likely than non-users to sustain no injuries (66% vs. 82%)

Page 4: Chapter 13: Chi-Square Test 1. Motivating Example Research Question: Among all adults in the U.S. who were in a car accident, is there a relationship.

4

Table 2: “No Association” Table

Injuries Used Cell? TotalSustaine

dNo Yes

None 74 (74%) 74 (74%) 148 (74%)

Minor 15 (15%) 15 (15%) 30 (15%)Severe 11 (11%) 11 (11%) 22 (11%)Total 100 100 200

No Relationship: Cell phone users are just as likely as non-users to sustain no injuries (74%)

Page 5: Chapter 13: Chi-Square Test 1. Motivating Example Research Question: Among all adults in the U.S. who were in a car accident, is there a relationship.

5

Relationship in Sample Vs. PopulationSample: We found a relationship in the

sample of 200 accident victims

Population: We want to know whether there is a relationship in the population

◦ALL adults in the U.S. who were in car accidents

◦We can use hypothesis testing procedures

◦The chi-square test is used to test hypotheses involving bivariate tables

Page 6: Chapter 13: Chi-Square Test 1. Motivating Example Research Question: Among all adults in the U.S. who were in a car accident, is there a relationship.

6

Chi-Square (χ2) Test ProcedureState the null and research hypotheses

Compute a χ2 statistic

Determine the degrees of freedom

Find the p-value for the χ2 statistic

Decide whether there is evidence to reject the null hypothesis

Interpret the results

Page 7: Chapter 13: Chi-Square Test 1. Motivating Example Research Question: Among all adults in the U.S. who were in a car accident, is there a relationship.

7

χ2 Test AssumptionsAssumption 1: The sample is

selected at random from a population

Assumption 2: The variables are nominal or ordinal

Note: In this class, you won’t have to determine whether the assumptions have been met

Page 8: Chapter 13: Chi-Square Test 1. Motivating Example Research Question: Among all adults in the U.S. who were in a car accident, is there a relationship.

8

χ2 Test: Hyptheses

Null Hypothesis (H0): The two variables are not related in the population

Research Hypothesis (H1): The two variables are related in the population

Alpha (α): This will be given to you in every problem (when it’s not given, assume α = 0.05)

Page 9: Chapter 13: Chi-Square Test 1. Motivating Example Research Question: Among all adults in the U.S. who were in a car accident, is there a relationship.

9

χ2 Test: HypthesesCell Phone – Injuries Example

Null Hypothesis (H0): Cell phone use and injury severity are not related among all adults in the U.S. who were in a car accident

Research Hypothesis (H1): Cell phone use and injury severity are related among all adults in the U.S. who were in a car accident

Alpha (α): Use α = 0.05)

Page 10: Chapter 13: Chi-Square Test 1. Motivating Example Research Question: Among all adults in the U.S. who were in a car accident, is there a relationship.

10

χ2 Test: Calculating the χ2 Statistic

Formula:

Two Components◦Observed Frequencies (fo)

◦Expected Frequencies (fe)

CellsAll e

eo

f

ff 22

Page 11: Chapter 13: Chi-Square Test 1. Motivating Example Research Question: Among all adults in the U.S. who were in a car accident, is there a relationship.

11

Calculating the χ2 Statistic: fo and fe

Observed Frequencies (fo)

◦Definition: The actual frequencies in the sample

◦ Example: In the cell phone – injuries example, these are given in Table 1

Expected Frequencies (fe)

◦Definition: The frequencies we would expect assuming the two variables were independent In other words, assuming the null hypothesis was true

◦ Example: In the cell phone – injuries example, these are given in Table 2

Page 12: Chapter 13: Chi-Square Test 1. Motivating Example Research Question: Among all adults in the U.S. who were in a car accident, is there a relationship.

12

Calculating the χ2 Statistic: Logic Behind the Formula

We are comparing the observed and expected frequencies

We are comparing the results in our sample with what we would expect if the two variables were independent (i.e., assuming H0 is true)

We are doing this because we are “testing the null hypothesis (H0)”, which assumes that the two variables are independent in the population

Page 13: Chapter 13: Chi-Square Test 1. Motivating Example Research Question: Among all adults in the U.S. who were in a car accident, is there a relationship.

13

Calculating the χ2 Statistic:Size of Difference

Small Difference◦ If the differences between the observed and expected

frequencies are small, the χ2 statistic will be small◦ As a result, we will likely fail to reject H0

Large Difference◦ If the differences between the observed and expected

frequencies are large, the χ2 statistic will be large◦ As a result, we will likely reject H0

What is Small or Large?◦ We will use Appendix D to decide what is small or large

Page 14: Chapter 13: Chi-Square Test 1. Motivating Example Research Question: Among all adults in the U.S. who were in a car accident, is there a relationship.

14

Calculating the χ2 Statistic: Computing fe

Procedure: For each cell, multiply the corresponding column marginal and row marginal, then divide by the sample size:

Huh?!?!? Let’s do this for the cell phone – injuries example (next several slides)

N

)marginalrow)(marginalcolumn(ef

Page 15: Chapter 13: Chi-Square Test 1. Motivating Example Research Question: Among all adults in the U.S. who were in a car accident, is there a relationship.

15

Calculating the χ2 Statistic: Computing feInjuries Used Cell? Total

Sustained No Yes

None 148

Minor 30

Severe 22

Total 100 100 200

Begin with a table containing only the row and column totals

Page 16: Chapter 13: Chi-Square Test 1. Motivating Example Research Question: Among all adults in the U.S. who were in a car accident, is there a relationship.

16

Calculating the χ2 Statistic: Computing feInjuries Used Cell? Total

Sustained No Yes

None 148

Minor 30

Severe 22

Total 100 100 200

For each cell, multiply the corresponding row and column total, then divide by the total sample size (200 here)

74200

)100)(148(

Page 17: Chapter 13: Chi-Square Test 1. Motivating Example Research Question: Among all adults in the U.S. who were in a car accident, is there a relationship.

17

Calculating the χ2 Statistic: Computing feInjuries Used Cell? Total

Sustained No Yes

None 148

Minor 30

Severe 22

Total 100 100 200

74200

)100)(148(

Page 18: Chapter 13: Chi-Square Test 1. Motivating Example Research Question: Among all adults in the U.S. who were in a car accident, is there a relationship.

18

Calculating the χ2 Statistic: Computing feInjuries Used Cell? Total

Sustained No Yes

None 148

Minor 30

Severe 22

Total 100 100 200

For each cell, multiply the corresponding row and column total, then divide by the total sample size (200 here)

15200

)100)(30(

Page 19: Chapter 13: Chi-Square Test 1. Motivating Example Research Question: Among all adults in the U.S. who were in a car accident, is there a relationship.

19

Calculating the χ2 Statistic: Computing feInjuries Used Cell? Total

Sustained No Yes

None 148

Minor 30

Severe 22

Total 100 100 200

15200

)100)(30(

Page 20: Chapter 13: Chi-Square Test 1. Motivating Example Research Question: Among all adults in the U.S. who were in a car accident, is there a relationship.

20

Calculating the χ2 Statistic: Computing feInjuries Used Cell? Total

Sustained No Yes

None 148

Minor 30

Severe 22

Total 100 100 200

11200

)100)(22(

Page 21: Chapter 13: Chi-Square Test 1. Motivating Example Research Question: Among all adults in the U.S. who were in a car accident, is there a relationship.

21

Calculating the χ2 Statistic: Computing feInjuries Used Cell? Total

Sustained No Yes

None 148

Minor 30

Severe 22

Total 100 100 200

11200

)100)(22(

Page 22: Chapter 13: Chi-Square Test 1. Motivating Example Research Question: Among all adults in the U.S. who were in a car accident, is there a relationship.

22

Calculating the χ2 Statistic: Computing feInjuries Used Cell? Total

Sustained No Yes

None 74 74 148

Minor 15 15 30

Severe 11 11 22

Total 100 100 200

This is the complete table of expected frequencies (fe)

Page 23: Chapter 13: Chi-Square Test 1. Motivating Example Research Question: Among all adults in the U.S. who were in a car accident, is there a relationship.

23

Calculating the χ2 StatisticInjuries Used Cell? Total

Sustained No Yes

None 82 66 148

Minor 12 18 30

Severe 6 16 22

Total 100 100 200

46.7

27.227.260.060.086.086.011

25

11

25

15

9

15

9

74

64

74

64

11

5

11

)5(

15

3

15

)3(

74

)8(

74

8

11

1116

11

116

15

1518

15

1512

74

7466

74

7482

222222

22222222

CellsAll e

eo

f

ff

Injuries Used Cell? Total

Sustained No Yes

None 74 74 148

Minor 15 15 30

Severe 11 11 22

Total 100 100 200

ObservedFrequencies

(fo)

ExpectedFrequencies

(fe)

Page 24: Chapter 13: Chi-Square Test 1. Motivating Example Research Question: Among all adults in the U.S. who were in a car accident, is there a relationship.

24

χ2 Test: Degrees of Freedom (df)

Formula:◦r = number of rows◦c = number of columns

Interpretation: The number of cells in the table that need to have numbers before we can fill in the remaining cells

Cell Phone – Injury Example

)1()1( crdf

2)1)(2()12()13()1()1( crdf

Page 25: Chapter 13: Chi-Square Test 1. Motivating Example Research Question: Among all adults in the U.S. who were in a car accident, is there a relationship.

25

χ2 Test: Determining the P-Value

χ2 Distribution

◦ The p-value will be based on the χ2 distribution

◦ The χ2 distribution is positively skewed This means that our hypothesis tests will always be one-

tailed

◦ Values of the χ2 statistic are always positive Minimum = 0 (variables are completely independent) Maximum = ∞

◦ The shape of the χ2 distribution is dictated by its df See figure on next slide

Page 26: Chapter 13: Chi-Square Test 1. Motivating Example Research Question: Among all adults in the U.S. who were in a car accident, is there a relationship.

26

χ2 Test: Determining the P-Value

Page 27: Chapter 13: Chi-Square Test 1. Motivating Example Research Question: Among all adults in the U.S. who were in a car accident, is there a relationship.

27

χ2 Test: Determining the P-ValueSteps

◦ Find df in the first column of Appendix D

◦ Read across the row until you find the χ2 value you computed

◦ Read up to the first row to find the p-value

Cell Phone – Injury Example

◦ χ2 = 7.46, df = 2

◦ Reading across the row where df = 2, a value of 7.46 is between 5.991 and 7.824

◦ Reading up to the top row, the p-value is between 0.05 and 0.02

Page 28: Chapter 13: Chi-Square Test 1. Motivating Example Research Question: Among all adults in the U.S. who were in a car accident, is there a relationship.

28

χ2 Test: Determining the P-Value

Additional practice finding p-values

◦ χ2 = 0.446, df = 2 P-value = 0.80

◦ χ2 = 4.09, df = 1 P-value is between 0.02 and 0.05

◦ χ2 = 0.01, df = 2 P-value is greater than 0.99

◦ χ2 = 15.00, df = 4 P-value is between 0.001 and 0.01

Page 29: Chapter 13: Chi-Square Test 1. Motivating Example Research Question: Among all adults in the U.S. who were in a car accident, is there a relationship.

29

χ2 Test: Evidence to Reject H0?Decision Rule

◦If the p-value is less than α, we have evidence to reject H0 in favor of H1

◦If the p-value is greater than α, we do not have evidence to reject H0 in favor of H1

Cell Phone – Injury Example◦The p-value (which is between 0.02 and

0.05) is less than α = 0.05◦We have evidence to reject H0 in favor of

H1

Page 30: Chapter 13: Chi-Square Test 1. Motivating Example Research Question: Among all adults in the U.S. who were in a car accident, is there a relationship.

30

χ2 Test: InterpretationIf We Reject H0: We have evidence to

suggest that the two variables are related in the population

If We Do Not Reject H0: We do not have evidence to suggest that the two variables are related in the population

Cell Phone – Injury Example: We have evidence that cell phone use and injury severity are related among all adults in the U.S. who were in a car accident