How to Perform the Friedman Test in Excel (with Detailed Steps)

The Friedman test uses ranks to compare more than two groups. It is used when normality and equal variance conditions are not satisfied. Although there are no built-in functions to perform the Friedman test in Excel, there is a simple workaround.

Key Takeaways

➤ Friedman Test is a non-parametric test for comparing ranks across more than two groups when normality and equal variances are not satisfied.
➤ The ranks of the observations are used instead of the values of the observations.
➤ The highest value is assigned a rank of 1, followed by the consecutive values.

Friedman test formula

In this article, we’ll learn about the Friedman test and how we can perform and interpret the results of this test.

Download Practice Workbook


What is Friedman Test in Statistics?

The Friedman test is a non-parametric statistical test that compares more than two groups with a blocking variable. It is suitable for observations where normality and equal variances are not met. In this test, the observations are ranked within each block (the highest value gets rank 1 and so on) and the sum of ranks between groups is compared.

This test is useful for testing the same subjects under different conditions. The Chi-square distribution is used to calculate the P value so all Friedman tests are one-tailed tests. The formula for Friedman statistic:

Formula for Friedman test

where

b is the number of rows or blocks

k is the number of columns or treatments

Ti2 is the squared sum of the ranks of sample treatments


Example of Friedman Test in Excel

In this dataset, we compare the effectiveness of three different diets on weight loss. The same group of participants follows each diet for a month, and their weight loss (in pounds) is recorded at the end of each period. The two hypotheses are stated below:

Null hypothesis: The weight loss is the same for all the diets (treatments).
Alternate hypothesis: The weight loss is not the same for all diets.

Steps:

➤ Select the output cell (G2) and enter the formula to rank the values in each row in ascending order.

=RANK.AVG(B2,$B2:$D2,1)

Ranking values in each row in ascending order with RANK.AVG function

Note: Press the  F4  key three times to lock only the column references.

➤ Drag the Fill Handle across and then down to rank all the data points.

Using Fill Handle tool

➤ Use the SUM function and apply the Fill Handle tool.

=SUM(G2:G11)

Calculating sum of ranks with SUM function

➤ Calculate the squared sum of ranks for the three diets.

=G12^2

Squared sum of ranks

➤ Determine the number of participants (blocks) with the COUNTA function.

=COUNTA(A2:A11)

Determining number of blocks with COUNTA function

➤ Similarly, obtain the number of diets (treatments).

=COUNTA(B1:D1)

Counting the number of treatments

➤ The formula to calculate the Friedman statistic is given below. It is convenient to break the formula into smaller parts. The first part of the formula evaluates to 0.1000.

=12/(D15*D16*(D16+1))

First part of the Friedman statistic formula

➤ In the second part add up all the sum of rank squared values to get a value of 1305.5.

=SUM(G13:I13)

Second part of the Friedman statistic formula

➤ The third part returns a value of 120.

=(3*D15)*(D16+1)

Third part of the Friedman statistic formula

➤ Select a suitable significance level (0.05).
➤ Calculate the Friedman statistic:

=(D18*D22)-D26

Friedman statistic result

➤ Now, determine the Chi-square critical value. Choose the significance level (0.05) as the probability.

=CHISQ.INV.RT(H20,D16-1)

Determining Chi-square critical value

➤ Also, calculate the P value.

=CHISQ.DIST.RT(H21,D16-1)

Calculating P value

Explanation
The calculated Friedman statistic value is larger than the Chi-square critical value so that we can reject the null hypothesis. This is further confirmed by the P value less than the significance level (0.05). In conclusion, there is a significant difference in weight loss effectiveness among the three diets.

FAQ

When to use the Friedman test?

The Friedman test is used when normality and equal variance conditions are unmet.

What is the difference between ANOVA and Friedman test?

For normally distributed data we use parametric tests like the Two way block ANOVA test. In contrast, we use the Friedman test if the data is not normally distributed. The Friedman test is the non-parametric version of the ANOVA test.

Why are ranks used in the Friedman test?

Ranks are used because, by focusing on the sum of ranks instead of the mean difference, the Friedman test can handle data that does not need to follow a normal distribution.

Why one-tailed test is used for the Friedman test?

All Friedman tests are one-tailed tests since the Chi-square distribution is used to calculate the P value.


Wrapping Up

In this tutorial, we’ve learned about the Friedman test, how to perform the Friedman test in Excel and interpret the test results. Feel free to download the practice file and share your thoughts in the comments below.

ExcelInsider Team
We will be happy to hear your thoughts

Leave a reply