20
PSY 340 Statistics for the Social Sciences Chi-Squared Test of Independence Statistics for the Social Sciences Psychology 340 Spring 2010

PSY 340 Statistics for the Social Sciences Chi-Squared Test of Independence Statistics for the Social Sciences Psychology 340 Spring 2010

  • View
    214

  • Download
    0

Embed Size (px)

Citation preview

Page 1: PSY 340 Statistics for the Social Sciences Chi-Squared Test of Independence Statistics for the Social Sciences Psychology 340 Spring 2010

PSY 340Statistics for the

Social Sciences

Chi-Squared Test of Independence

Statistics for the Social SciencesPsychology 340

Spring 2010

Page 2: PSY 340 Statistics for the Social Sciences Chi-Squared Test of Independence Statistics for the Social Sciences Psychology 340 Spring 2010

PSY 340Statistics for the

Social Sciences

A manufacturer of watches takes a sample of 200 people. Each person isclassified by age and watch type preference (digital vs. analog).

A manufacturer of watches takes a sample of 200 people. Each person isclassified by age and watch type preference (digital vs. analog).

The question: is there a relationship between age and watch preference?

Young (under 30)

Old (over 30)

Chi-Squared Test for Independence

Page 3: PSY 340 Statistics for the Social Sciences Chi-Squared Test of Independence Statistics for the Social Sciences Psychology 340 Spring 2010

PSY 340Statistics for the

Social Sciences

A manufacturer of watches takes a sample of 200 people. Each person isclassified by age and watch type preference (digital vs. analog).

A manufacturer of watches takes a sample of 200 people. Each person isclassified by age and watch type preference (digital vs. analog).

The question: is there a relationship between age and watch preference?

Young (under 30)

Old (over 30)

Chi-Squared Test for Independence

Page 4: PSY 340 Statistics for the Social Sciences Chi-Squared Test of Independence Statistics for the Social Sciences Psychology 340 Spring 2010

PSY 340Statistics for the

Social Sciences

Statistical analysis follows design

Page 5: PSY 340 Statistics for the Social Sciences Chi-Squared Test of Independence Statistics for the Social Sciences Psychology 340 Spring 2010

PSY 340Statistics for the

Social Sciences

A manufacturer of watches takes a sample of 200 people. Each person isclassified by age and watch type preference (digital vs. analog). The question: is there a relationship between age and watch preference?

A manufacturer of watches takes a sample of 200 people. Each person isclassified by age and watch type preference (digital vs. analog). The question: is there a relationship between age and watch preference?

PREFERENCE

Digital Analog Undecided Row totals

Under 30

Age

Over 30

Column totals

Chi-Squared Test for Independence

Page 6: PSY 340 Statistics for the Social Sciences Chi-Squared Test of Independence Statistics for the Social Sciences Psychology 340 Spring 2010

PSY 340Statistics for the

Social Sciences

Chi-Squared Test for Independence

Step 1: State the hypotheses– H0: Preference is

independent of age (“no relationship”)

– HA: Preference is related to age (“there is a relationship”)

A manufacturer of watches takes a sample of 200 people. Each person isclassified by age and watch type preference (digital vs. analog). The question: is there a relationship between age and watch preference?

A manufacturer of watches takes a sample of 200 people. Each person isclassified by age and watch type preference (digital vs. analog). The question: is there a relationship between age and watch preference?

Observed scores

PREFERENCE

Digital Analog Undecided Row totals

Under 30

90

40

10

Age

Over 30

10

40

10

Column totals

Chi-Squared Test for Independence

Page 7: PSY 340 Statistics for the Social Sciences Chi-Squared Test of Independence Statistics for the Social Sciences Psychology 340 Spring 2010

PSY 340Statistics for the

Social Sciences

Step 2: Compute your degrees of freedom & get critical valuedf = (#Columns - 1) * (#Rows - 1) = (3-1) * (2-1) = 2

Level of significance df 0.05 0.025 0.01 1 3.84 5.02 6.64 2 5.99 7.38 9.21 3 7.81 9.35 11.34 : : : :

• For this example, with df = 2, and α = 0.05

• The critical chi-squared value is 5.99

– Go to Chi-square statistic table and find the critical value

PREFERENCE

Digital Analog Undecided Row totals

Under 30

90

40

10

Age

Over 30

10

40

10

Column totals

Chi-Squared Test for Independence

Page 8: PSY 340 Statistics for the Social Sciences Chi-Squared Test of Independence Statistics for the Social Sciences Psychology 340 Spring 2010

PSY 340Statistics for the

Social Sciences Chi-Squared Test for Independence

PREFERENCE

Digital Analog Undecided Row totals

Under 30

90

40

10

Age

Over 30

10

40

10

Column totals

Step 3: Collect the data. Obtain row and column totals (sometimes called the marginals) and calculate the expected frequencies

Observed scores

Page 9: PSY 340 Statistics for the Social Sciences Chi-Squared Test of Independence Statistics for the Social Sciences Psychology 340 Spring 2010

PSY 340Statistics for the

Social Sciences Chi-Squared Test for Independence

PREFERENCE

Digital Analog Undecided Row totals

Under 30

90

40

10

140

Age

Over 30

10

40

10

60

Column totals

100

80

20

200

Spot check: make sure the row totals and column totals add up to the same thing

Step 3: Collect the data. Obtain row and column totals (sometimes called the marginals) and calculate the expected frequencies

Observed scores

Page 10: PSY 340 Statistics for the Social Sciences Chi-Squared Test of Independence Statistics for the Social Sciences Psychology 340 Spring 2010

PSY 340Statistics for the

Social Sciences

Step 3: Collect the data. Obtain row and column totals (sometimes called the marginals) and calculate the expected frequencies

PREFERENCE

Digital Analog Undecided Row totals

Under 30

90

40

10

140

Age

Over 30

10

40

10

60

Column totals

100

80

20

200

Under 30

Over 30

Digital Analog Undecided

fe =100(140)

200=70

70

fe =80(140)

200=56

56

fe =20(140)

200=14

14

fe =100(60)

200=30

30

fe =80(60)200

=24

24

fe =20(60)200

=6

6

Observed scores

fe =fcolumnfrow

n

Expected scores

Chi-Squared Test for Independence

Page 11: PSY 340 Statistics for the Social Sciences Chi-Squared Test of Independence Statistics for the Social Sciences Psychology 340 Spring 2010

PSY 340Statistics for the

Social Sciences

Step 3: Collect the data. Obtain row and column totals (sometimes called the marginals) and calculate the expected frequencies

PREFERENCE

Digital Analog Undecided Row totals

Under 30

90

40

10

140

Age

Over 30

10

40

10

60

Column totals

100

80

20

200

Under 30

Over 30

Digital Analog Undecided

fe =100(140)

200=70

70

fe =80(140)

200=56

56

fe =20(140)

200=14

14

fe =100(60)

200=30

30

fe =80(60)200

=24

24

fe =20(60)200

=6

6

Observed scores

fe =fcolumnfrow

n

Expected scores

“expected frequencies” - if the null hypothesis is correct, then these are the frequencies that

you would expect

“expected frequencies” - if the null hypothesis is correct, then these are the frequencies that

you would expect

Chi-Squared Test for Independence

Page 12: PSY 340 Statistics for the Social Sciences Chi-Squared Test of Independence Statistics for the Social Sciences Psychology 340 Spring 2010

PSY 340Statistics for the

Social Sciences

χ 2 = ∑fo − fe( )

2

fe

Cell fo fe (fo-fe) (fo-fe)2 (fo-fe)

2/fe <30 digital

90 70

<30 analog

40 56

<30 undecided

10 14

>30 digital

10 30

>30 analog

40 24

>30 undecided

10 6

PREFERENCE

Digital Analog Undecided Row totals

Under 30

70 90

56 40

14 10

140

Age

Over 30

30 10

24 40

6 10

60

Column totals

100

80

20

200

• Find the residuals (fo - fe) for each cell

Step 4: compute the χ2

Chi-Squared Test for Independence

Page 13: PSY 340 Statistics for the Social Sciences Chi-Squared Test of Independence Statistics for the Social Sciences Psychology 340 Spring 2010

PSY 340Statistics for the

Social Sciences

Step 4: compute the χ2

Cell fo fe (fo-fe) (fo-fe)2 (fo-fe)

2/fe <30 digital

90 70 20

<30 analog

40 56 -16

<30 undecided

10 14 -4

>30 digital

10 30 -20

>30 analog

40 24 16

>30 undecided

10 6 4

PREFERENCE

Digital Analog Undecided Row totals

Under 30

70 90

56 40

14 10

140

Age

Over 30

30 10

24 40

6 10

60

Column totals

100

80

20

200

• Find the residuals (fo - fe) for each cell

χ 2 = ∑fo − fe( )

2

fe

Chi-Squared Test for Independence

Page 14: PSY 340 Statistics for the Social Sciences Chi-Squared Test of Independence Statistics for the Social Sciences Psychology 340 Spring 2010

PSY 340Statistics for the

Social Sciences

• Square these differences

Cell fo fe (fo-fe) (fo-fe)2 (fo-fe)

2/fe <30 digital

90 70 20 400

<30 analog

40 56 -16 256

<30 undecided

10 14 -4 16

>30 digital

10 30 -20 400

>30 analog

40 24 16 256

>30 undecided

10 6 4 16

PREFERENCE

Digital Analog Undecided Row totals

Under 30

70 90

56 40

14 10

140

Age

Over 30

30 10

24 40

6 10

60

Column totals

100

80

20

200

• Find the residuals (fo - fe) for each cell

χ 2 = ∑fo − fe( )

2

fe

Step 4: compute the χ2

Chi-Squared Test for Independence

Page 15: PSY 340 Statistics for the Social Sciences Chi-Squared Test of Independence Statistics for the Social Sciences Psychology 340 Spring 2010

PSY 340Statistics for the

Social Sciences

• Square these differences

Cell fo fe (fo-fe) (fo-fe)2 (fo-fe)

2/fe <30 digital

90 70 20 400 5.71

<30 analog

40 56 -16 256 4.57

<30 undecided

10 14 -4 16 1.14

>30 digital

10 30 -20 400 13.33

>30 analog

40 24 16 256 10.67

>30 undecided

10 6 4 16 2.67

PREFERENCE

Digital Analog Undecided Row totals

Under 30

70 90

56 40

14 10

140

Age

Over 30

30 10

24 40

6 10

60

Column totals

100

80

20

200

• Find the residuals (fo - fe) for each cell

• Divide the squared differences by fe

χ 2 = ∑fo − fe( )

2

fe

Step 4: compute the χ2

Chi-Squared Test for Independence

Page 16: PSY 340 Statistics for the Social Sciences Chi-Squared Test of Independence Statistics for the Social Sciences Psychology 340 Spring 2010

PSY 340Statistics for the

Social Sciences

• Square these differences

Cell fo fe (fo-fe) (fo-fe)2 (fo-fe)

2/fe <30 digital

90 70 20 400 5.71

<30 analog

40 56 -16 256 4.57

<30 undecided

10 14 -4 16 1.14

>30 digital

10 30 -20 400 13.33

>30 analog

40 24 16 256 10.67

>30 undecided

10 6 4 16 2.67

PREFERENCE

Digital Analog Undecided Row totals

Under 30

70 90

56 40

14 10

140

Age

Over 30

30 10

24 40

6 10

60

Column totals

100

80

20

200

• Find the residuals (fo - fe) for each cell

• Divide the squared differences by fe

• Sum the results

=38.09 = χ 2

χ 2 = ∑fo − fe( )

2

fe

Step 4: compute the χ2

Chi-Squared Test for Independence

Page 17: PSY 340 Statistics for the Social Sciences Chi-Squared Test of Independence Statistics for the Social Sciences Psychology 340 Spring 2010

PSY 340Statistics for the

Social Sciences

Chi-Squared, the final stepStep 5: Compare this computed statistic (38.09)

against the critical value (5.99) and make a decision about your hypotheses

χ2(2,n=200)=38.09,p<0.05

A manufacturer of watches takes a sample of 200 people. Each person isclassified by age and watch type preference (digital vs. analog). The question: is there a relationship between age and watch preference?

A manufacturer of watches takes a sample of 200 people. Each person isclassified by age and watch type preference (digital vs. analog). The question: is there a relationship between age and watch preference?

here we reject the H0 and conclude that there is a relationship between age and watch preference

Page 18: PSY 340 Statistics for the Social Sciences Chi-Squared Test of Independence Statistics for the Social Sciences Psychology 340 Spring 2010

PSY 340Statistics for the

Social Sciences In SPSSIn SPSS• Each person gets a row• Each person has data about the

variables – age & watch preference

Page 19: PSY 340 Statistics for the Social Sciences Chi-Squared Test of Independence Statistics for the Social Sciences Psychology 340 Spring 2010

PSY 340Statistics for the

Social Sciences In SPSSIn SPSS• Analyze => Descriptives =>

Crosstabs• Select the two variables (usually

they are nominal or ordinal) you want to examine and click the arrow to move one into the “rows” and one into the “columns” box.

• Click on “statistics” button, and check the “Chi-square” box.

• Click “continue.”• Click “OK.”

Page 20: PSY 340 Statistics for the Social Sciences Chi-Squared Test of Independence Statistics for the Social Sciences Psychology 340 Spring 2010

PSY 340Statistics for the

Social Sciences SPSS OutputLook at the “Chi-square tests”

box.The top row of this box gives

results for “Pearson’s Chi-Square”

• “Value” is the value of the χ2 statistic,

• “df” is the degrees of freedom for the test

• “Asymp. Sig. (2-sided)” is the probability (p-value) associated with the test.

• The chi-squared distribution, like the F-distribution, is “squared” so 1-tailed test is not possible.