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 and 2 of One Sample Hypothesis Testing for Correlation 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 One Sample Hypothesis Testing for Correlation using Spearman’s rho.
We show the data along with the rankings in Figure 1.
Figure 1 – Data and ranking of data for Example 1
Spearman’s rho is the correlation coefficient on the ranked data, namely CORREL(C5:C19,D5:D19) = -.674. Alternatively it can be computed using the Real Statistics formula =SCORREL(A5:A19,B5:B19).
We now use the table in Spearman’s Rho Table to find the critical value for the two-tail test where n = 15 and α = .05. Interpolating between the values for n = 14 and 16, we get a critical value of .525. Since the absolute value of rho is larger than the critical value, we reject the null hypothesis that there is no correlation between cigarette smoking and longevity.
Since n = 15 ≥ 10, we can use a t-test instead of the table. By Theorem 1 of One Sample Hypothesis Testing for Correlation, 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.
Figure 2 – Hypothesis testing of Spearman’s rho
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.
The SCORREL function described in Spearman’s Correlation can also be used for hypothesis testing.
Real Statistics Function: The following array function is provided in the Real Statistics Resource Pack:
SCORREL(R1, R2, lab, tails): in addition to calculating Spearman’s correlation coefficient (rho), this statistic is tested for the null hypothesis rho = 0 using a t test and the t-stat and p-value of the test are returned. If lab = TRUE then a column of labels are added to the output. tails = 1 or 2 (default) and lab = TRUE or FALSE (default).
For Example 1 of Spearman’s Correlation, SCORREL(A5:A19,B5:B19,TRUE) returns the output shown in Figure 3.
Figure 3 – Output from SCORREL function