friedman's test

34

Upload: zari-kahn

Post on 15-Apr-2017

224 views

Category:

Education


0 download

TRANSCRIPT

Page 1: Friedman's test
Page 2: Friedman's test

Lecture objective

• Nonparametric tests• Friedman’s test– History– When to uses– Assumptions– Basic idea – Examples– How to run it in SPSS

Page 3: Friedman's test

NON PARAMETRIC TESTSFRIEDMAN’s TEST

Page 4: Friedman's test

Non Parametric tests

• A nonparametric test is one that is performed without making any restrictive assumptions about the form of the population distribution and associated parameters.

• It provide alternatives to parametric test & has many advantages and disadvantages..

Page 5: Friedman's test

Friedman’s test

• Friedman test is a non parametric statistical method developed by Dr. Milton Friedman

Page 6: Friedman's test

Dr. Milton Friedman

Born July 31, 1912Died November 16, 2006 (aged 94)Contributions:• Price theory (monetarism)• Applied macroeconomics• Floating exchange rates• Permanent income hypothesis• Volunteer military. Friedman test

Page 7: Friedman's test

Awards:• National medal of science (1988)• President medal of freedom (1988)• Nobel memorial prize in economic

sciences(1976)• John bates clark medal (1951)

Page 8: Friedman's test

FRIEDMAN’s TEST

• The Friedman test is a non-parametric alternative to ANOVA with repeated measures.

• It is used to test for differences between groups when the dependent variable being measured is ordinal.

• The Friedman test tests the Null hypothesis of identical populations for dependent data.

• The test is similar to the Kruskal-Wallis Test.• It uses only the rank information of the data.

Page 9: Friedman's test

Assumptions• 1. The r blocks are independent so that the

measurements in one block have no influence on the measurements in any other block.

• 2. The underlying random variable of interest is continuous (to avoid ties).

• 3. The observed data constitute at least an ordinal scale of measurement within each of the r blocks.

• 4. There is no interaction between the m blocks and the k treatment levels.

• 5. The c populations have the same variability.• 6. The c populations have the same shape.

Page 10: Friedman's test

Steps involved in testing

• 1) Formulation of hypothesis• 2) Significance level• 3) Test statistics• 4) Calculations• 5) Critical region• 6) Conclusion

Page 11: Friedman's test

1) Formulation of hypothesis

we check the equality of means of different treatments as in ANOVA, the null hypothesis will be stated as:Ho= M1=M2=……=Mk

H1= not all medians are equal

Page 12: Friedman's test

• 2) Level of significance:it is selected as given if not given 0.05 is

taken.• 3) Test statistics:

where R.j2 is the square of the rank total for

group j (j = 1, 2, . . . , c)m is the number of independent blocksk is the number of groups or treatment levels

Page 13: Friedman's test

4) Calculations:• Start with n rows and k columns. • Rank order the entries of each row

independently of the other rows. • Sum the ranks for each column.• Sum the squared column totals.• Using test statistic calculate the value of Q.

Page 14: Friedman's test

5) Critical region:Reject H0 if Q ≥ critical value at α= 5%If the values of k and/or n exceed those given in tables, the significance of Q may be looked up in chi-squared (χ2) distribution tables with k-1 degrees of freedom.

Page 15: Friedman's test
Page 16: Friedman's test

6) Conclusion:• If the value of Q is less than the critical value

then we’ll not reject H0.• If the value of Q is greater than the critical

value then we’ll reject H0.

Page 17: Friedman's test

Example 1:The manager of a nationally known real estate agencyhas just completed a training session on appraisals forthree newly hired agents. To evaluate the effectiveness ofhis training, the manager wishes to determine whetherthere is any difference in the appraised values placed onhouses by these three different individuals. A sample of12 houses is selected by the manager, and each agent isassigned the task of placing an appraised value (inthousands of dollars) on the 12 houses. The results aresummarized as follows.

Page 18: Friedman's test

At the 0.05 level of significance, use the Friedman rank test to determine whether there is evidence of a difference in the median appraised value for the three agents. What can you conclude?

Houses Agent1 Agent 2 Agent 3

1 181.0 182.0 183.5

2 179.9 180.0 182.4

3 163.0 161.5 164.1

4 218.0 215.0 217.3

5 213.0 216.5 218.4

6 175.0 175.0 216.1

7 217.9 219.5 220.1

8 151.0 150.0 152.4

9 164.9 165.5 166.1

10 192.5 195.0 197.0

11 225.0 222.7 226.4

12 177.5 178.0 179.7

Page 19: Friedman's test

Solution:

1) Formulation of hypothesis: H0 : M1=M2=M3

H1 : Not all medians are equal

2) Level of significance:α=0.05

3) Test statistics:

Page 20: Friedman's test

4) Calculation:

k=3 m=12

Q=159.29-144

Q=15.29

Houses Agent1 Agent 2 Agent 3

1 181.0 1 182.0 2 183.5 3

2 179.9 1 180.0 2 182.4 3

3 163.0 2 161.5 1 164.1 3

4 218.0 3 215.0 1 217.3 2

5 213.0 1 216.5 2 218.4 3

6 175.0 1.5 175.0 1.5 216.1 3

7 217.9 1 219.5 2 220.1 3

8 151.0 2 150.0 1 152.4 3

9 164.9 1 165.5 2 166.1 3

10 192.5 1 195.0 2 197.0 3

11 225.0 2 222.7 1 226.4 3

12 177.5 1 178.0 2 179.7 3

Sum of ranks

17.5 19.5 35

(17.52+19.52+352)-3х12(3+1)

Page 21: Friedman's test

5) Critical region:Reject H0 if Q > critical value at 5% level of significance.Q tab=6.5

6) Conclusion: we reject H0, as Qcal ≥ Qtab, and hence conclude that the appraising ability of three agents are not the same.

Page 22: Friedman's test
Page 23: Friedman's test

Example 2:A water company sought evidence the measures taken to clean up a river were effective. Biological Oxygen Demand (BOD) at 12 sites on the river were

compared before clean up, 1 month later and a

year after clean up.

Page 24: Friedman's test

Solution:

1) Formulation of hypothesis:H0 : The clean up procedure has had no effect on the BOD.H1 : The clean up procedure has affected the BOD.

2) Level of significance:α=0.05

3) Test statistics:

Page 25: Friedman's test

4) Calculations:m=12, k=3

Q=8.43

(322+22.52+17.52)-3х12(3+1)

Page 26: Friedman's test

5) Critical region:Reject H0 if Q > critical value at 5% level of significance.Q tab=6.56) Conclusion:

As Qcal ≥ Qtab so we will reject H0, hence conclude that the cleanup procedure has effected the BOD.

Page 27: Friedman's test

Question 1:The following data on amount of food consumed (g) by

eight rats after 0, 24, and 72 hours of food deprivation appeared in the paper “The Relation Between Differences in Level of Food Deprivation and Dominance in Food Getting in the Rat”. Does the data indicate a difference in the true mean rank of food consumption for the three experimental conditions?

Page 28: Friedman's test

Question 2:

The venerable auction house of Snootly &

Snobs will soon be putting three fine 17th-

and 18th-century violins, A,B, and C, up for

bidding. A certain musical arts foundation,

wishing to determine which of these

instruments to add to its collection, arranges

to have them played by each of 10 concert

violinists. The players are blindfolded, so that

they cannot tell which violin is which; and

each plays the violins in a randomly

determined sequence (BCA, ACB, etc.).

Page 29: Friedman's test

Question 3In this analysis the one variable is the type of animal (fish, reptiles, or mammals), and the response variable is the number of animals on display. From our database, we use three variables reptnum (number of reptiles on display), fishnum (number of fish on display) and mamlnum (number of mammals on display). These scores are shown for the 12 stores below(reptnum, fishnum, mamlnum ).• 12,32,34 14,41,38 15,31,45 12,38,32 7,21,12 4,13,11

10,17,22 4,22,9 14,24,20 4,11,8 5,17,19 10,20,8We have to check that whether the pet shop display same number of pets.

Page 30: Friedman's test

SPSS Method

Page 31: Friedman's test

Question

• Suppose for example we want to find out if students have a preference for one type of soda over others. They are blindfolded and given a taste test. They are asked to take a sip of Brand X, Brand Y and Brand Z sodas and to rank order their preference for the three sodas where a 1 is the highest rank, a 2 the next highest and a 3 the least preferred soda. The data representing the rankings given by each participant to the three sodas are:

Page 32: Friedman's test

• Participants’ Rankings of the Three Brands of Soda

Participant Brand X Brand Y Brand Z

1 2 1 3

2 1 3 2

3 1 2 3

4 1 3 2

5 1 3 2

6 1 2 3

7 1 3 2

8 1 2 3

9 1 3 2

10 2 1 3

Page 33: Friedman's test

SPSS methodEnter ranks for each sample in different columns and then data analysis is done.

Data Analysis• 1. Click on Analyze at top of screen then• a. Click on Non-Parametric Tests then• b. Click on K Related Samples• 2. Highlight Brand x by clicking on it then• a. Click on arrow > to transfer this name to the Test Variable Box• 3. Highlight Brand y by clicking on it then• a. Click on arrow > to transfer this name to the Test Variable Box• 4. Highlight Brand z by clicking on it then• a. Click on arrow > to transfer this name to the Test Variable Box• 5. If one the white square next Friedman is not already checked, click on it to place a check mark there• 6. Click on Statistics button at bottom corner of screen• a. Click on white square next to Descriptive to place a check mark in the box• b. Click on continue button• 7. Click OK. Doing this will result in analysis being conducted. These results are below.

Page 34: Friedman's test

The End