Pearson’s r is one of the most widely used tools in psychological research – it tells you how strongly two variables are related and in which direction. But knowing what it measures is only half the equation. The other half is knowing how to calculate it efficiently. The raw score method gives you a direct, structured path to computing r without the extra step of converting all your data into deviation scores first. This tutorial walks you through the formula, its components, and a complete worked example so you can apply it confidently to your own data.
Table of Contents
- What is Pearson’s r and why does the calculation method matter?
- Understanding the raw score formula
- The deviation score method: a quick comparison
- Step-by-step example: hours of sleep and reaction time
- Step 1: Set up your calculation table
- Step 2: Calculate the column sums
- Step 3: Compute the squared sums
- Step 4: Plug values into the formula
- Step 5: Interpret the result
- Common mistakes to avoid
- When to choose the raw score method
What is Pearson’s r and why does the calculation method matter?
Pearson’s correlation coefficient is a numerical measure of the linear relationship between two continuous variables. Its value always falls between โ1 and +1. A value near +1 signals a strong positive relationship (both variables increase together), a value near โ1 signals a strong negative relationship (one rises as the other falls), and a value near 0 means little to no linear association. Developed by Karl Pearson around 1900, the coefficient has since become a cornerstone of statistical analysis in psychology, education, and the social sciences.
There are at least three established formulas for computing r: the raw score formula, the deviation score formula, and the covariance formula. Critically, all three produce exactly the same result. The choice of method is purely a matter of convenience and the form in which your data is available. The raw score method is particularly useful when you are working directly with original data points and want to avoid computing means and deviations for every individual score before you can even begin the correlation calculation.
Understanding the raw score formula
The raw score formula for Pearson’s r is:
r = [NโXY โ (โX)(โY)] / โ[(NโXยฒ โ (โX)ยฒ)(NโYยฒ โ (โY)ยฒ)]
At first glance, this looks intimidating. But each component has a clear, specific role. Here is what every symbol means:
- N – the total number of paired data points (e.g., if you have 8 participants, N = 8)
- โX and โY – the simple sums of all values in variable X and variable Y respectively
- โXY – the sum of the products of each paired X and Y value (multiply each X by its corresponding Y, then add all those products)
- โXยฒ and โYยฒ – the sum of the squared values of X and Y (square each individual value first, then sum them)
- (โX)ยฒ and (โY)ยฒ – the squares of the sums (sum all values first, then square the total)
That last distinction – between โXยฒ and (โX)ยฒ – is one of the most common sources of error among students. โXยฒ means: square each score, then add. (โX)ยฒ means: add all scores first, then square the total. These produce very different numbers. Getting this right is essential to an accurate result.
The deviation score method: a quick comparison
To appreciate why the raw score method is useful, it helps to briefly understand what the deviation score method requires. The deviation score approach is built around the concept of the sum of products – a measure of the variability shared between two variables. It requires you to first calculate the mean of X and the mean of Y, then subtract each individual score from its respective mean to produce deviation scores, and only then compute cross-products and sums of squares.
The raw score method bypasses those intermediate steps entirely. Raw score formulas are algebraic transformations of the z-score approach, rearranged so you can work with original values directly. The result is fewer calculation steps, fewer rounding errors from intermediate arithmetic, and a more streamlined process – especially with smaller datasets using whole numbers. Both methods yield identical values for r. This equivalence is not a coincidence; it is a mathematical identity built into the formula’s structure.
Step-by-step example: hours of sleep and reaction time
Let’s say a researcher wants to know whether hours of sleep the night before an experiment is related to reaction time (in milliseconds) in a cognitive test. Data is collected from 6 participants. Assign sleep hours as X and reaction time as Y.
Here is the dataset:
- Participant 1: X = 5, Y = 310
- Participant 2: X = 6, Y = 290
- Participant 3: X = 7, Y = 275
- Participant 4: X = 8, Y = 250
- Participant 5: X = 9, Y = 240
- Participant 6: X = 4, Y = 330
Step 1: Set up your calculation table
Create columns for X, Y, XY, Xยฒ, and Yยฒ. This is the standard approach recommended for the raw score method, as it keeps every required value organised in one place before you apply the formula.
- Participant 1: XY = 1550, Xยฒ = 25, Yยฒ = 96100
- Participant 2: XY = 1740, Xยฒ = 36, Yยฒ = 84100
- Participant 3: XY = 1925, Xยฒ = 49, Yยฒ = 75625
- Participant 4: XY = 2000, Xยฒ = 64, Yยฒ = 62500
- Participant 5: XY = 2160, Xยฒ = 81, Yยฒ = 57600
- Participant 6: XY = 1320, Xยฒ = 16, Yยฒ = 108900
Step 2: Calculate the column sums
Sum each column to get the values you will plug into the formula:
- โX = 5 + 6 + 7 + 8 + 9 + 4 = 39
- โY = 310 + 290 + 275 + 250 + 240 + 330 = 1695
- โXY = 1550 + 1740 + 1925 + 2000 + 2160 + 1320 = 10695
- โXยฒ = 25 + 36 + 49 + 64 + 81 + 16 = 271
- โYยฒ = 96100 + 84100 + 75625 + 62500 + 57600 + 108900 = 484825
- N = 6
Step 3: Compute the squared sums
Now compute (โX)ยฒ and (โY)ยฒ – the squares of the totals you just found:
- (โX)ยฒ = 39ยฒ = 1521
- (โY)ยฒ = 1695ยฒ = 2,873,025
Step 4: Plug values into the formula
Now substitute everything into the raw score formula:
Numerator: NโXY โ (โX)(โY) = (6 ร 10695) โ (39 ร 1695) = 64170 โ 66105 = โ1935
Denominator (X part): NโXยฒ โ (โX)ยฒ = (6 ร 271) โ 1521 = 1626 โ 1521 = 105
Denominator (Y part): NโYยฒ โ (โY)ยฒ = (6 ร 484825) โ 2873025 = 2908950 โ 2873025 = 35925
Full denominator: โ(105 ร 35925) = โ(3772125) โ 1942.2
r = โ1935 / 1942.2 โ โ0.996
Step 5: Interpret the result
An r of approximately โ0.996 indicates a very strong negative correlation. As hours of sleep increase, reaction time decreases – meaning better-rested participants responded faster. The closer r is to โ1 or +1, the stronger the linear relationship between the two variables. In this case, sleep duration is an excellent predictor of reaction time in this sample.
It is critical to note, however, that a high correlation does not prove causation. Other variables – such as caffeine intake, stress levels, or time of day – could also be contributing to reaction time differences. Correlation tells you that two variables are related; it does not tell you why.
Common mistakes to avoid
A few errors come up repeatedly when students first apply the raw score formula. Being aware of them in advance saves a great deal of recalculation.
- Confusing โXยฒ with (โX)ยฒ: As covered above, these are fundamentally different operations. Always square individual values first for โXยฒ, and square the total for (โX)ยฒ.
- Errors in the โXY column: Multiplying each X by its paired Y (not by another participant’s Y) is essential. Misalignment in your table is a frequent cause of this error.
- Skipping the scatterplot: It is good practice to generate a scatterplot before calculating any correlation coefficients and then proceed only if the relationship appears reasonably linear. Pearson’s r is only meaningful for linear associations – it will underestimate or misrepresent a curvilinear relationship.
- Ignoring assumptions: For Pearson’s r to be valid, both variables should be continuous and measured on interval or ratio scales, the relationship should be linear, and the data should be approximately normally distributed. If the association is strongly curved (for example, U-shaped), the correlation may appear close to zero even when a clear systematic pattern exists.
When to choose the raw score method
The raw score method is best suited to situations where you have a manageable dataset – typically fewer than 30 pairs – and want a direct, step-by-step path from original data to r. It is especially valuable in educational settings where showing and understanding each calculation step matters. Because it works with data exactly as collected, it eliminates the rounding errors that can accumulate when you first convert to deviation scores and then compute further.
For larger datasets, statistical software handles the arithmetic automatically, but the underlying computation follows the same principles. The raw score formula is an algebraic rearrangement of the z-score-based definition of correlation, which means the method is not a shortcut or approximation – it is mathematically equivalent to every other valid approach. Understanding it deeply gives you insight into what Pearson’s r is actually measuring: the degree to which variation in one variable tracks variation in another, expressed on a standardised scale from โ1 to +1.
What do you think? If you were designing a psychological study to examine the relationship between screen time and sleep quality in adolescents, which variables would you designate as X and Y – and what r value would you predict finding? Does it change how you interpret the result when you know that both the raw score and deviation score methods are guaranteed to produce the same r?
References
- https://en.wikipedia.org/wiki/Pearson_correlation_coefficient
- https://www.sciencedirect.com/topics/computer-science/pearson-correlation
- https://www.andrews.edu/~calkins/math/edrm611/edrm05.htm
- https://open.maricopa.edu/psy230mm/chapter/chapter-16-correlations/
- https://lbecker.uccs.edu/ancova2
- https://www.socscistatistics.com/tests/pearson/
- https://www.cogn-iq.org/learn/theory/pearson-correlation/
Leave a Reply