Nonparametric Statistics
Friedman Repeated-Measures Rank Test and Iman-Davenport F Formula
Rank repeated-measures blocks row by row in Excel and Arte Sheets, verify the rank-sum invariant, and compute Friedman’s Q alongside the sharper Iman-Davenport F statistic.
Rank within each subject row — never across the entire table!
The #1 spreadsheet mistake in Friedman’s (1937) repeated-measures ANOVA by ranks is ranking against the entire N x k matrix instead of ranking the k treatments separately inside each block row. Always verify the rank-sum checksum first: across N = 6 subjects and k = 3 conditions, the column rank sums R1 + R2 + R3 MUST equal N * k * (k + 1) / 2 = 6 * 3 * 4 / 2 = 36.
Enter 6 subjects’ response latencies (ms, ascending rank 1 = fastest) across Protocols A, B, C in B2:D7 so that within-row ranks E2:G7 sum to R1 = 7, R2 = 12, R3 = 17 (7 + 12 + 17 = 36). By hand, Q = (12 / (6 * 3 * 4)) * (7^2 + 12^2 + 17^2) - 3 * 6 * 4 = (482 / 6) - 72 = 80.3333 - 72 = 8.3333. Because Friedman’s chi-square approximation is overly conservative for small N, Iman and Davenport (1980) transform Q into F_ID = ((N - 1) * Q) / (N*(k - 1) - Q) = (5 * 8.3333) / (12 - 8.3333) = 125 / 11 = 11.3636 on df1 = 2, df2 = 10.
| Statistic (N = 6, k = 3) | Exact Formula | Sample Output |
|---|---|---|
| Total Rank-Sum Checksum | N * k * (k + 1) / 2 | 36 (7 + 12 + 17) |
| Friedman Chi-Square Q | (12 / (N*k*(k+1))) * SUM(R_j^2) - 3*N*(k+1) | 8.3333 (25 / 3) |
| Iman-Davenport F_ID (df 2, 10) | ((N - 1) * Q) / (N * (k - 1) - Q) | 11.3636 (125 / 11) |
| Kendall Concordance W | Q / (N * (k - 1)) | 0.6944 (25 / 36) |
Friedman Chi-Square Q Formula
Rank each row ascending via RANK(B2, $B2:$D2, 1) in E2:G7 and evaluate Q directly from column rank sums.
=LET(n_blk, ROWS(E2:G7), k_trt, COLUMNS(E2:G7), r_1, SUM(E2:E7), r_2, SUM(F2:F7), r_3, SUM(G2:G7), ROUND((12 / (n_blk * k_trt * (k_trt + 1))) * (r_1^2 + r_2^2 + r_3^2) - 3 * n_blk * (k_trt + 1), 4))Iman-Davenport F Statistic Formula (Guarding Perfect Agreement)
When every single block ranks the treatments in the exact same order (Kendall’s W = 1, Q = N*(k - 1) = 12), the Iman-Davenport denominator N*(k - 1) - Q hits 0 — guard that boundary explicitly as "Perfect Concordance (W=1)".
=LET(n_blk, ROWS(E2:G7), k_trt, COLUMNS(E2:G7), r_1, SUM(E2:E7), r_2, SUM(F2:F7), r_3, SUM(G2:G7), q_stat, (12 / (n_blk * k_trt * (k_trt + 1))) * (r_1^2 + r_2^2 + r_3^2) - 3 * n_blk * (k_trt + 1), denom, n_blk * (k_trt - 1) - q_stat, IF(denom <= 0.000001, "Perfect Concordance (W=1)", ROUND(((n_blk - 1) * q_stat) / denom, 4)))Try the example
Use the original values or change them to test your understanding.