Friedman's Analysis of Variance Test (and Kendall's Coefficient of Concordance) ------------------------------------------------------------------------------- ^friedman^ varlist {^in^ range] [^if^ exp] ^friedman^ estimates Friedman's nonparametric two-way analysis of variance ^and^ Kendall's Coefficient of Concordance (a descriptive measure of the agreement between k sets of rankings). The two tests are equivalent and one p-value is given for both. Note the the value of Kendall's statistic must be between 0 and 1 and therefore may be easier to interpret. Missing values are not allowed. I have tried to trap this, but may not find all cases--if you ever obtain a negative result for the test statistics, then you have at least one missing value. For Kendall's coefficient, the variables are the rankers or judges or tests, while the cases are the things being judged or ranked. For example, one common use is to compare the rankings of students on each of several tests; the following is taken from Gibbons, JD (1985), Nonparametric Statistical Inference, 2nd edition, NY: Marcel Dekker, Inc., pp. 326-327. S t u d e n t -------------------------------------------- T E S T 1 2 3 4 5 6 7 8 ----------------------------------------------------- 1 90 60 45 48 58 72 25 85 2 62 81 92 76 70 75 95 72 3 60 91 85 81 90 76 93 80 If you enter this as three variables, then you can just type in ^friedman varlist^ and all is fine. If you enter the data as 8 variables, one per student, then use the ^xpose, c^ command first. You can then enter the ^friedman^ command, as above. Note that if you need to transpose the data you should first eliminate all variables that you will not be analyzing. Otherwise you may get a surprise. The above data set is included as gibbons2.dta--as 8 variables. I also include Gibbons' example Friedman data set from p. 325 of her book as gibbons1.dta. This one also needs to be transposed prior to testing. This code is written expecting the raters to be the variables. This is because the genrank program ranks variables across cases, not the other way around. Note that in other programs you would do things differently--thus, in SYSTAT enter this data set as 8 variables to obtain the same results as below. The results from the above data are: Friedman = 2.8889 Kendall = 0.1376 p-value = 0.8951 Kendall's coefficient of concordance ranges from 0 to 1, with 0 meaning no agreement across raters (judges). The null hypothesis (Friedman) is that the treatments are equal; the null hypothesis (Kendall) is that there is no agreement between rankings or test results. I do not produce the sums of ranks for each case, though other software does. To add it to your output, add the line ^li sum_rs^ near the end (I recommend either just before or just after the current display lines). The p-value is an approximation, though it appears to be pretty good as long as there are at least 8 cases and 3 variables. WARNING: do not add "compress" or in any other way try to change the code so that the new variables are bytes rather than floats--your answer will be WRONG! (Note that all new variables are dropped at the end of the ado file anyway.)