Friedman's Test is a nonparametric alternative to twoway analysis of variance. The hypothesis is:
H_{0} the means of all the samples are equal
H_{1} the mean of at least one of the samples is different
Consider the example where three treatments are evaluated on four different patients:
Therapy

Andrew

Belinda

Chris

Dave

Relaxed 
110

140

100

130

Normal 
115

150

105

135

High Intensity 
117

155

100

135

The test involves:
 impose ranks on each of the columns. If values are equal, average the ranks they would have got if they were slightly different:
Therapy

Andrew

Belinda

Chris

Dave

Relaxed 
1

1

1.5

1

Normal 
2

2

3

2.5

High Intensity 
3

3

1.5

2.5

 calculate the F_{r} statistic using the formula:
Where:
I 
Number of samples (treatments) 
J 
Number of blocks 
R_{i} 
sum of the ranks in row 'i' 
This gives a value for F_{r} of 4.65
The value of F_{r} has an approximately chisquare distribution with I  1 degrees of freedom.
