Calculating Pearson's correlation coefficient
Calculate from paired numerical data with positive variation in both variables. Then inspect whether a linear summary represents the pattern; the existence of a coefficient does not ensure suitability
- Check suitability Pearson's r is used for two numerical variables with an approximately linear pattern and no influential outlier \(\displaystyle \text{numerical}+\text{numerical}+\text{linear form}\to\text{Pearson's }r\)
- Keep pairs together The explanatory and response values from one case form one pair and must stay together \(\displaystyle \left(x_i,y_i\right)=\left(2,5\right)\)
- Use the roles as axes Use the explanatory variable as x and the response variable as y \(\displaystyle x=\text{EV},\quad y=\text{RV}\)
- Round only at the end Keep the complete calculation until the final reported value of r is rounded to the stated precision \(\displaystyle r=-0.6734\ldots\to-0.67\text{ (2 d.p.)}\)
- Calculated versus suitable Curved data can have a calculable coefficient, but a single linear statistic can be misleading. Report the pattern and limitations
Worked example
Calculate Pearson's r for the paired data below to 2 decimal places
- \(\displaystyle \bar{x}=\frac{10+20+30+40}{4}=25,\quad\bar{y}=\frac{4+8+6+10}{4}=7\)Find the mean of each variable before centring the pairs
- \(\displaystyle S_{xy}=\left(-15\right)\left(-3\right)+\left(-5\right)(1)+(5)\left(-1\right)+(15)(3)=80\)Multiply the centred values from the same four cases and add the products
- \(\displaystyle S_{xx}=\left(-15\right)^{2}+\left(-5\right)^{2}+5^{2}+15^{2}=500,\quad S_{yy}=\left(-3\right)^{2}+1^{2}+\left(-1\right)^{2}+3^{2}=20\)Add the squared centred values for x and for y
- \(\displaystyle r=\frac{80}{\sqrt{500\times20}}=\frac{80}{100}=0.80\)Substitute the three centred sums and round the positive result to 2 decimal places
Common mistakes
Difficulty levels
Questions about this topic
Why must the two lists stay paired?+
Each pair represents one case. Reordering one list independently attaches a response value to the wrong explanatory value and changes the association
When is Pearson's r appropriate?+
Use it for two numerical variables with an approximately linear pattern and no influential outlier. It is not a suitable summary for a clear curved relationship
What does the sign of r show?+
A positive sign means the response tends to increase as the explanatory variable increases. A negative sign means the response tends to decrease
Can I use a calculator?+
A calculator is allowed unless a question is marked no calculator
Which year level and chapter is this?+
Year 12, VCE Units 3 & 4, General Mathematics, chapter 2: Association between variables