Source: Mathematical Statistics, University of Central Florida
Tags: Pearson formula, Spearman formula, correlation computation, sample correlation, hypothesis testing correlation, p-value, significance test, scatter plot interpretation
Difficulty: Intermediate | Prerequisites: Part 1 of these notes, summation notation, square roots, basic algebra
This second part covers the mechanics: the formulas you need to compute correlation by hand or interpret calculator/software output, how to test whether a sample correlation is statistically significant, and worked reasoning using data similar to the source collection exercise. If you are comfortable with the conceptual material in Part 1, this section gives you the computational tools and exam practice.
The Pearson r formula standardises covariance by the product of the two standard deviations. You can also test whether a sample r is significantly different from zero using a t-test. The formulas look involved but follow a consistent pattern: compute means, deviations, products of deviations, then normalise.
r = Σ[(xᵢ - x̄)(yᵢ - ȳ)] / √[Σ(xᵢ - x̄)² · Σ(yᵢ - ȳ)²]
Where:
xᵢ and yᵢ are individual data points in the two variables
x̄ and ȳ are the sample means
The numerator is the sum of the products of deviations (i.e., the sample covariance times n - 1)
The denominator standardises by the variability of each variable
r = [nΣxᵢyᵢ - (Σxᵢ)(Σyᵢ)] / √{[nΣxᵢ² - (Σxᵢ)²][nΣyᵢ² - (Σyᵢ)²]}
This version avoids computing means and deviations separately. It is often faster for hand calculation and is what most textbooks present for exam use.
cov(x, y) = Σ[(xᵢ - x̄)(yᵢ - ȳ)] / (n - 1)
Note the n - 1 denominator (Bessel's correction) for sample data.
r² = (explained variance) / (total variance)
Interpretation: if r = 0.70, then r² = 0.49, meaning 49% of the variance in y is linearly associated with x.
rₛ = 1 - [6Σdᵢ²] / [n(n² - 1)]
Where:
dᵢ is the difference between the ranks of xᵢ and yᵢ for each pair
n is the number of paired observations
This shortcut works when there are no tied ranks; with ties, use the Pearson formula applied to the averaged ranks
t = r√(n - 2) / √(1 - r²)
With degrees of freedom = n - 2.
Compare the computed t to the critical t-value from the t-distribution table at your chosen significance level (typically α = 0.05). If |t| exceeds the critical value, the correlation is statistically significant.
List all paired observations (xᵢ, yᵢ).
Compute the sums: Σx, Σy, Σx², Σy², Σxy.
Note n (the number of pairs).
Plug into the raw-score formula.
Check: r must fall between -1 and +1. If it does not, there is an arithmetic error.
The source data contains responses from four persons across two forms:
Form 1 has 27 items (scored 0 to 4, resembling a Likert-type scale).
Form 2 has 12 items (scored 1 to 5).
Each person completed both forms. This structure supports several types of correlation analysis:
Within-person correlation: correlating a person's Form 1 responses with their Form 2 responses (if items are designed to measure the same construct). Only the first 12 items of Form 1 can be paired with the 12 items of Form 2.
Between-person correlation: correlating Person 1's scores with Person 2's scores on the same form to assess agreement or similarity.
Test-retest or parallel-forms reliability: if Form 1 and Form 2 are designed as parallel measures, the correlation between total scores estimates reliability.
The source data uses ordinal scales (0–4 and 1–5). Strictly speaking, Likert-type items are ordinal, not interval, so Spearman rₛ is the more defensible choice. In practice, many researchers apply Pearson r to Likert data when the distribution is reasonably symmetric, but you should know the distinction and be prepared to justify your choice on an exam.
Report both r (or rₛ) and the p-value (or t-statistic with degrees of freedom).
State the direction (positive or negative).
State the strength (using the benchmarks from Part 1).
Report r² for the proportion of variance explained.
A result like r(25) = 0.68, p < .01 means: with 25 degrees of freedom, the correlation is 0.68, and the probability of observing this result if the true correlation were zero is less than 1%.
Both variables are continuous (or treated as approximately continuous).
The relationship is linear.
Both variables are approximately normally distributed (for inference/significance testing).
Observations are independent of each other.
Homoscedasticity: the spread of y-values is roughly constant across all levels of x.
If any of these assumptions are seriously violated, consider Spearman rₛ or other non-parametric alternatives.
⚠️ The raw-score formula is the one most commonly tested in timed exams. Practise it until you can set up the five sums (Σx, Σy, Σx², Σy², Σxy) quickly.
⚠️ Exams frequently ask you to interpret r² rather than r. Know the difference: r = 0.60 does not mean 60% explained variance; r² = 0.36 does.
⚠️ Be ready to explain why correlation ≠ causation with a concrete example. This appears on nearly every introductory statistics exam.
⚠️ If the exam gives you ordinal data (like Likert scales), mention Spearman as the more appropriate measure, even if they ask you to compute Pearson. Noting the limitation earns marks.
⚠️ Watch for restricted range. If data are collected from a narrow subset (e.g., only high-achievers), the correlation will be attenuated (closer to zero) compared to the full population.
1. True or False: A Pearson r of -0.85 indicates a weaker relationship than an r of +0.60.
A: False. The strength is determined by the absolute value. |-0.85| > |0.60|, so -0.85 is the stronger relationship.
2. Fill in the blank: The square of the correlation coefficient is called the __________ and represents the proportion of __________ in one variable explained by the other.
A: Coefficient of determination; variance.
3. True or False: If r = 0 between two variables, the variables are completely unrelated.
A: False. They may have a non-linear relationship that r cannot detect.
4. Fill in the blank: The degrees of freedom for a significance test of Pearson r are __________.
A: n - 2, where n is the number of paired observations.
5. True or False: Spearman rₛ requires both variables to be normally distributed.
A: False. Spearman is a non-parametric method and does not require normality.
Q: A researcher collects data from 30 participants and finds r = 0.45. Calculate the t-statistic for testing whether this correlation is significantly different from zero.
A: t = 0.45 × √(30 - 2) / √(1 - 0.45²) = 0.45 × √28 / √(1 - 0.2025) = 0.45 × 5.292 / √0.7975 = 2.381 / 0.893 ≈ 2.67. With df = 28, this exceeds the critical t of approximately 2.048 at α = 0.05 (two-tailed), so the correlation is statistically significant.
Q: Two variables have a Pearson r of 0.70. What percentage of variance in one variable is explained by the other?
A: r² = 0.70² = 0.49, so 49% of the variance is explained.
Q: A student computes Pearson r on data from a 5-point Likert scale. What concern should they raise?
A: Likert scale data is ordinal, not truly interval. Pearson r assumes interval or ratio data. Spearman rank correlation would be more appropriate, or the student should justify treating the scale as approximately interval.
Q: Explain why a correlation of 0.30 might be statistically significant in one study but not another.
A: Statistical significance depends on both the size of r and the sample size (n). With a large n, even small correlations produce large t-statistics and reach significance. With a small n, the same r may not reach the critical threshold. The correlation value alone does not determine significance.
Q: You have paired data from four people who each completed a 27-item form and a 12-item form. Describe two different correlation analyses you could run on this data.
A: First, you could correlate each person's first 12 items on Form 1 with their 12 items on Form 2 to assess within-person consistency across the two forms (parallel-forms reliability). Second, you could compute total scores per person per form and correlate the Form 1 totals with the Form 2 totals across the four persons, though n = 4 would yield very low statistical power.
This material connects directly to simple linear regression, where the correlation coefficient is used to assess model fit: r² in correlation is the same r² reported in regression output. Understanding correlation is a prerequisite for multiple regression, where you will deal with correlations among several predictors simultaneously.
Correlation also links to reliability analysis in psychometrics. The source data (two forms completed by the same persons) is a classic setup for estimating parallel-forms reliability, which is fundamentally a correlation between two versions of a test.
The significance test for r connects to the broader hypothesis testing framework (null and alternative hypotheses, test statistics, p-values, Type I and Type II errors) that runs through the entire course.
Pearson r, Pearson product-moment correlation, sample correlation coefficient, population correlation rho, Spearman rank correlation, Spearman rho, covariance, coefficient of determination, r-squared, scatter plot, bivariate analysis, linear association, test-retest reliability, parallel-forms reliability, Likert scale correlation, ordinal correlation, significance test for correlation, t-test for r, restricted range, attenuation, homoscedasticity, correlation matrix, causation vs correlation, confounding variable, spurious correlation