On this webpage we show how to use Spearman’s rank correlation for hypothesis testing. In particular, we show how to test whether there is a correlation between two random variables by testing whether or not Spearman’s rho = 0 (the null hypothesis).
For low values of rho, a table of critical values can be used (see Spearman’s Rho Table). For higher values (generally about n > 10), Theorem 1 of Correlation Testing via t Test and Theorem 1 of Correlation Testing via Fisher Transformation is applied using Spearman’s rho in place of Pearson’s correlation r.
In general, however, Kendall’s tau is often the preferred non-parametric approach since it has more desirable statistical properties.
Example 1: Repeat the analysis for Example 1 of Correlation Testing via t Test using Spearman’s rho, i.e. test whether Spearman’s rho is significantly different from zero based on the sample data in range B4:C18 of Figure 1.
Figure 1 – Hypothesis testing of Spearman’s rho
Spearman’s rho is the correlation coefficient on the ranked data, namely CORREL(D4:D18,E4:E18) = -.674. Alternatively it can be computed using the Real Statistics formula =SCORREL(D4:D18,E4:E18).
We now use the table in Spearman’s Rho Table to find the critical value of .521 for the two-tail test where = 15 and = .05. Since the absolute value of rho is larger than the critical value, we reject the null hypothesis that there is no correlation.
Since n = 15 ≥ 10, we can use a t-test instead of the table. By Theorem 1 of Correlation Testing via t Test, we use the test statistic
Since |t| = 3.29 > 2.16 = tcrit = TINV(.05,13), we again conclude that there is a significant negative correlation between the number of cigarettes smoked and longevity. The details of the analysis are shown in Figure 2.
For Excel 2007 users, replace the formula in cell H11 by TINV(H10,H7) and the formula in cell H12 by TDIST(ABS(H9),H7,2).
Observation: To conduct a one-tail test use the table in Spearman’s Rho Table with α multiplied by 2.
Real Statistics Excel Function: The following function is provided in the Real Statistics Resource Pack:
RhoCRIT(n, α, tails, h) = the critical value of the Spearman’s rho test for samples of size n, for the given value of alpha (default .05), and tails = 1 or 2 (default). If h = TRUE (default) harmonic interpolation is used; otherwise linear interpolation is used.
SCORREL(R1, R2, lab, tails, alpha): an array function which outputs a column range consisting of Spearman’s correlation coefficient (rho) and the t-stat and p-value which test the null hypothesis that rho = 0. If lab = TRUE then a column of labels are added to the output (default is FALSE). tails = 1 or 2 (default), alpha = significant level (default .05)
For Example 1, RhoCRIT(15, .05, 2) = .521, as described above.
For Example 1 of Spearman’s Correlation, SCORREL(B4:B18,C4:C18,TRUE) returns the output shown in Figure 2.
Figure 2 – Output from SCORREL function