c82mcp diploma statistics school of psychology university of nottingham 1 kruskall-wallis and...

27
C82MCP Diploma Statistics School of Psychology University of Nottingham 1 Kruskall-Wallis and Friedman Tests Non-parametric statistical tests exist for studies were there are more than two samples Kruskall Wallis - Between Groups Designs Friedman - Within Subjects & Matched Designs

Post on 19-Dec-2015

214 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: C82MCP Diploma Statistics School of Psychology University of Nottingham 1 Kruskall-Wallis and Friedman Tests Non-parametric statistical tests exist for

C82MCP Diploma Statistics

School of PsychologyUniversity of Nottingham

1

Kruskall-Wallis and Friedman Tests

• Non-parametric statistical tests exist for studies were there are more than two samples• Kruskall Wallis - Between Groups Designs• Friedman - Within Subjects & Matched Designs

Page 2: C82MCP Diploma Statistics School of Psychology University of Nottingham 1 Kruskall-Wallis and Friedman Tests Non-parametric statistical tests exist for

C82MCP Diploma Statistics

School of PsychologyUniversity of Nottingham

2

Rationale of the Kruskall Wallis

• When the null hypothesis is true we expect a random distribution of ranks across the groups

• When the null hypothesis is false we expect a systematic distribution of ranks across the groups

Rank

Group A B C B A C C B A

1 2 3 4 5 6 7 8 9

A

B

C

Group Rank Sum

15

14

16

Rank

Group A A B A B C B C C

1 2 3 4 5 6 7 8 9

A

B

C

Group Rank Sum

7

15

23

Page 3: C82MCP Diploma Statistics School of Psychology University of Nottingham 1 Kruskall-Wallis and Friedman Tests Non-parametric statistical tests exist for

C82MCP Diploma Statistics

School of PsychologyUniversity of Nottingham

3

The Rationale of the Kruskall Wallis

• The Null Hypothesis is True• The average rank of each cell in the design should be

equal• The Null Hypothesis is False

• The average rank of each cell in the design should be different

Page 4: C82MCP Diploma Statistics School of Psychology University of Nottingham 1 Kruskall-Wallis and Friedman Tests Non-parametric statistical tests exist for

C82MCP Diploma Statistics

School of PsychologyUniversity of Nottingham

4

An Example of the Kruskall Wallis

Type of ReinforcementControl Praise CriticismScore Rank Score Rank Score Rank10 4 12 6.5 11 513 8.5 14 11.5 9 2.514 11.5 15 14.5 12 6.515 14.5 14 11.5 9 2.514 11.5 16 16.5 8 116 16.5 17 18 13 8.5

Total 66.5 Total 78.5 Total 26.0Mean 11.08 Mean 13.08 Mean 4.33

Page 5: C82MCP Diploma Statistics School of Psychology University of Nottingham 1 Kruskall-Wallis and Friedman Tests Non-parametric statistical tests exist for

C82MCP Diploma Statistics

School of PsychologyUniversity of Nottingham

5

Formula for the Kruskall Wallis

• The critical value of the Kruskall-Wallis is calculated using the following formula:

• Where is the total number of scores is the mean rank for each level of the variable is the number of scores in each level of the variable

KW 12

N(N 1)nR 2

3(N 1)

N

R

n

Page 6: C82MCP Diploma Statistics School of Psychology University of Nottingham 1 Kruskall-Wallis and Friedman Tests Non-parametric statistical tests exist for

C82MCP Diploma Statistics

School of PsychologyUniversity of Nottingham

6

Calculating the Value of the Kruskall Wallis

• Given the formula

• We substitute the values

KW 1218 181

(6(11.082)6(13.082)6(4.332)

3181

Total Number of Subjects

Number of Subjects in Each Group

Group Rank Means

KW 12

N(N 1)nR 2

3(N 1)

Page 7: C82MCP Diploma Statistics School of Psychology University of Nottingham 1 Kruskall-Wallis and Friedman Tests Non-parametric statistical tests exist for

C82MCP Diploma Statistics

School of PsychologyUniversity of Nottingham

7

The Significance of the Kruskall Wallis

• The observed value equals 8.81.• Find the critical value of the test statistic in tables• In this case the critical value is 5.99.• If the observed value is greater than the critical value then

reject the null hypothesis.• We reject the null hypotheses and state that the groups are

different

Page 8: C82MCP Diploma Statistics School of Psychology University of Nottingham 1 Kruskall-Wallis and Friedman Tests Non-parametric statistical tests exist for

C82MCP Diploma Statistics

School of PsychologyUniversity of Nottingham

8

Interpreting a Kruskall Wallis

• Plotting the Mean Rank we find:

• We know that the three levels of the independent variable produce different outcomes.

• We don't know exactly what or where the differences are.

Mean Rank0

2

4

6

8

10

12

14

Control

Praise

Criticism

Page 9: C82MCP Diploma Statistics School of Psychology University of Nottingham 1 Kruskall-Wallis and Friedman Tests Non-parametric statistical tests exist for

C82MCP Diploma Statistics

School of PsychologyUniversity of Nottingham

9

Interpreting a Kruskall Wallis

• We can ask a variety of questions: • Is praise is better than no

reinforcement?• Is criticism worse than no

reinforcement?• Is praise better than criticism?

• The Kruskall Wallis statistic doesn't give us the answers

Mean Rank0

2

4

6

8

10

12

14

Control

Praise

Criticism

Page 10: C82MCP Diploma Statistics School of Psychology University of Nottingham 1 Kruskall-Wallis and Friedman Tests Non-parametric statistical tests exist for

C82MCP Diploma Statistics

School of PsychologyUniversity of Nottingham

10

Post Hoc Comparisons

• We can test the significance of individual pairs of conditions • These tests are known as post hoc pairwise comparisons• A critical difference value is calculated

• If the difference between two rank means is greater than the critical difference then it is significant

• If the difference between two rank means is less than the critical difference then it is not significant

Page 11: C82MCP Diploma Statistics School of Psychology University of Nottingham 1 Kruskall-Wallis and Friedman Tests Non-parametric statistical tests exist for

C82MCP Diploma Statistics

School of PsychologyUniversity of Nottingham

11

Post Hoc Comparisons

• The critical difference value is given by the following formula:

• Where is the total number of subjects in the experiment is the number of subjects in one group is the number of subjects in the other group

Critical Difference 2.394N(N +1)

12

1

n1

1

n2

N

n1

n2

Page 12: C82MCP Diploma Statistics School of Psychology University of Nottingham 1 Kruskall-Wallis and Friedman Tests Non-parametric statistical tests exist for

C82MCP Diploma Statistics

School of PsychologyUniversity of Nottingham

12

Post Hoc Comparisons

• If the difference between a pair of Rank Means is greater than or equal to the right hand side of this equation then they are significantly different at p<0.05.

• Substituting the appropriate values:

• The critical difference we need to exceed is 7.38

Critical Difference2.394 18(181)12

161

6

Critical Difference 2.394N(N +1)

12

1

n1

1

n2

Page 13: C82MCP Diploma Statistics School of Psychology University of Nottingham 1 Kruskall-Wallis and Friedman Tests Non-parametric statistical tests exist for

C82MCP Diploma Statistics

School of PsychologyUniversity of Nottingham

13

Interpreting a Kruskall Wallis

• The differences between the mean ranks are:• Control vs Praise = 2• Control vs Criticism = 6.75• Praise vs Criticism = 8.75

• The difference between Praise vs Criticism exceeds the critical difference

• Therefore there is only one significant difference at p<0.05

Page 14: C82MCP Diploma Statistics School of Psychology University of Nottingham 1 Kruskall-Wallis and Friedman Tests Non-parametric statistical tests exist for

C82MCP Diploma Statistics

School of PsychologyUniversity of Nottingham

14

The Rationale of the Friedman

• In the Friedman there are two possible sampling strategies:• Each subject contributes several scores• A matched group of subjects provide one score each

Page 15: C82MCP Diploma Statistics School of Psychology University of Nottingham 1 Kruskall-Wallis and Friedman Tests Non-parametric statistical tests exist for

C82MCP Diploma Statistics

School of PsychologyUniversity of Nottingham

15

S1

S2

S3

Rank Total

Subject Level A Level B Level C

1

2

3

6

2

1

2

5

3

3

1

7

S1

S2

S3

Rank Total

Subject Level A Level B Level C

1

2

1

4

2

1

2

5

3

3

3

9

• When the null hypothesis is true we expect a random distribution of the ranks across the subjects

• When the null hypothesis is false we expect a systematic distribution of the ranks across the subjects

Rationale of the Friedman• Each individual subjects scores are ranked

Page 16: C82MCP Diploma Statistics School of Psychology University of Nottingham 1 Kruskall-Wallis and Friedman Tests Non-parametric statistical tests exist for

C82MCP Diploma Statistics

School of PsychologyUniversity of Nottingham

16

The Rationale of the Friedman

• When the Null hypothesis is true• The rank totals of the different levels of the IV will be

about equal• When the Null hypothesis is false

• The rank totals of the different levels of the IV will be different

Page 17: C82MCP Diploma Statistics School of Psychology University of Nottingham 1 Kruskall-Wallis and Friedman Tests Non-parametric statistical tests exist for

C82MCP Diploma Statistics

School of PsychologyUniversity of Nottingham

17

An Example of the Friedman

Type of ReinforcementControl Praise Criticism

Group Score Rank Score Rank Score Rankg1 10 1 12 3 11 2g2 13 2 14 3 9 1g3 14 2 15 3 12 1g4 15 3 14 2 9 1g5 14 2 16 3 8 1g6 16 2 17 3 13 1

Total 12 Total 17 Total 7

Page 18: C82MCP Diploma Statistics School of Psychology University of Nottingham 1 Kruskall-Wallis and Friedman Tests Non-parametric statistical tests exist for

C82MCP Diploma Statistics

School of PsychologyUniversity of Nottingham

18

Formula for the Friedman

• The critical value of the Friedman is calculated using the following formula:

• Where N is the total number of subjects or groups R is the rank total for each level of the independent

variables k is the number levels of the independent variables

Fr 12Nk(k1)

R2

3N(k1)

Page 19: C82MCP Diploma Statistics School of Psychology University of Nottingham 1 Kruskall-Wallis and Friedman Tests Non-parametric statistical tests exist for

C82MCP Diploma Statistics

School of PsychologyUniversity of Nottingham

19

Calculating the Value of the Friedman

• Give the formula

• The Friedman is calculated as follows

Fr 12Nk(k1)

R2

3N(k1)

Subjects/Groups Levels of the IV

Group RankTotals

Fr 12(6)(3)(31)

(12217272)

(3)(6)(31)

Page 20: C82MCP Diploma Statistics School of Psychology University of Nottingham 1 Kruskall-Wallis and Friedman Tests Non-parametric statistical tests exist for

C82MCP Diploma Statistics

School of PsychologyUniversity of Nottingham

20

The Significance of the Friedman

• The observed value is 8.33• Find the critical value of the test statistic in tables• The critical value is 7.00• If the observed value is greater than the critical value then

reject the null hypothesis.• We reject the null hypothesis and conclude that the three

levels of the treatment variable are different

Page 21: C82MCP Diploma Statistics School of Psychology University of Nottingham 1 Kruskall-Wallis and Friedman Tests Non-parametric statistical tests exist for

C82MCP Diploma Statistics

School of PsychologyUniversity of Nottingham

21

Interpreting a Friedman

• Plotting the Rank Totals we find:• We know that the three levels

of the independent variable produce different outcomes.

• We don't know exactly what or where the differences are.

12

17

7

Total Rank0

2

4

6

8

10

12

14

16

18

Control

Praise

Criticism

Page 22: C82MCP Diploma Statistics School of Psychology University of Nottingham 1 Kruskall-Wallis and Friedman Tests Non-parametric statistical tests exist for

C82MCP Diploma Statistics

School of PsychologyUniversity of Nottingham

22

Interpreting a Friedman

• We can ask a variety of questions: • Is praise is better than no reinforcement?• Is criticism worse than no reinforcement?• Is praise better than criticism?

• The Friedman statistic doesn't give us the answers

Page 23: C82MCP Diploma Statistics School of Psychology University of Nottingham 1 Kruskall-Wallis and Friedman Tests Non-parametric statistical tests exist for

C82MCP Diploma Statistics

School of PsychologyUniversity of Nottingham

23

Post Hoc Comparisons

• Post Hoc Comparisons • We can test the significance of individual pairs of

conditions • A critical difference value is calculated

• If the difference between two rank totals is greater than the critical difference then it is significant

• If the difference between two rank totals is less than the critical difference then it is not significant

Page 24: C82MCP Diploma Statistics School of Psychology University of Nottingham 1 Kruskall-Wallis and Friedman Tests Non-parametric statistical tests exist for

C82MCP Diploma Statistics

School of PsychologyUniversity of Nottingham

24

Post Hoc Comparisons

• The critical difference value is given by the following formula:

• Where• N is the total number of subjects or matched groups

in the experiment• k is the number of levels of the independent variable

Critical Difference2.394 Nk(k1)6

Page 25: C82MCP Diploma Statistics School of Psychology University of Nottingham 1 Kruskall-Wallis and Friedman Tests Non-parametric statistical tests exist for

C82MCP Diploma Statistics

School of PsychologyUniversity of Nottingham

25

Post Hoc Comparisons

• If the difference between a pair of Rank Totals is greater than or equal to the right hand side of this equation then they are significantly different at p<0.05.

• Substituting the appropriate values:

• The critical difference we need to exceed is 8.29

Critical Difference2.394 (6)(3)(4)6

Page 26: C82MCP Diploma Statistics School of Psychology University of Nottingham 1 Kruskall-Wallis and Friedman Tests Non-parametric statistical tests exist for

C82MCP Diploma Statistics

School of PsychologyUniversity of Nottingham

26

Interpreting a Friedman

• The differences between the rank totals are:• Control vs Praise = 5• Control vs Criticism = 5• Praise vs Criticism = 10

• The difference between Praise vs Criticism exceeds the critical difference

• Therefore there is only one significant difference at p<0.05

Page 27: C82MCP Diploma Statistics School of Psychology University of Nottingham 1 Kruskall-Wallis and Friedman Tests Non-parametric statistical tests exist for

C82MCP Diploma Statistics

School of PsychologyUniversity of Nottingham

27

Summary

• There are two non-parametric statistical tests that apply experiments with more than two levels of the independent variable• Kruskall-Wallis - K levels of a between group (independent

samples) design• Friedman - K levels of a within group (or matched

samples) design• For both these tests further exploration is required to

establish the differences between pairs of conditions.