Calculate The Linear Correlation Coefficient For The Data Below

Article with TOC
Author's profile picture

monithon

Mar 17, 2026 · 4 min read

Calculate The Linear Correlation Coefficient For The Data Below
Calculate The Linear Correlation Coefficient For The Data Below

Table of Contents

    How to Calculate the Linear Correlation Coefficient (Pearson’s r) – A Step‑by‑Step Guide

    When you have two quantitative variables and you want to know how strongly they move together, the linear correlation coefficient—most commonly Pearson’s r—is the go‑to statistic. It tells you both the direction (positive or negative) and the strength of a linear relationship, with values ranging from –1 (perfect negative correlation) through 0 (no linear correlation) to +1 (perfect positive correlation). Below is a complete, easy‑to‑follow walkthrough that includes the formula, the computational steps, an illustrative example, and tips for interpreting the result. Even if you don’t have the exact data set you intended to analyze, the procedure shown here works for any pair of numbers.


    1. What Is the Linear Correlation Coefficient?

    The linear correlation coefficient (denoted r) quantifies the degree to which two variables, X and Y, vary together in a straight‑line pattern. Mathematically, it is the covariance of the two variables divided by the product of their standard deviations:

    [ r ;=; \frac{\displaystyle\sum_{i=1}^{n}(X_i-\bar X)(Y_i-\bar Y)} {\sqrt{\displaystyle\sum_{i=1}^{n}(X_i-\bar X)^2}; \sqrt{\displaystyle\sum_{i=1}^{n}(Y_i-\bar Y)^2}} ]

    where

    • (n) = number of paired observations,
    • (\bar X) and (\bar Y) = sample means of X and Y, * (X_i) and (Y_i) = individual data points.

    Key properties * Scale‑freer does not depend on the units of measurement.

    • Symmetrical – swapping X and Y leaves r unchanged.
    • Sensitive to outliers – a single extreme point can dramatically alter the value.

    2. Step‑by‑Step Calculation Procedure

    Below is a practical checklist you can follow with any data set. Each step builds on the previous one, making it easy to spot mistakes.

    Step Action Formula / Note
    1 List the paired data ((X_i, Y_i)). Keep them in two columns.
    2 Compute the means (\bar X) and (\bar Y). (\bar X = \frac{1}{n}\sum X_i), (\bar Y = \frac{1}{n}\sum Y_i).
    3 Find the deviations from the mean for each observation: (X_i-\bar X) and (Y_i-\bar Y). These will be used repeatedly.
    4 Calculate the cross‑product for each pair: ((X_i-\bar X)(Y_i-\bar Y)). Sum of these gives the numerator.
    5 Square each deviation: ((X_i-\bar X)^2) and ((Y_i-\bar Y)^2). Needed for the two denominator sums.
    6 Sum the columns from steps 4 and 5: (\sum (X_i-\bar X)(Y_i-\bar Y)), (\sum (X_i-\bar X)^2), (\sum (Y_i-\bar Y)^2).
    7 Plug the sums into the Pearson formula. (r = \frac{\text{sum of cross‑products}}{\sqrt{\text{sum of }X\text{ squares}};\sqrt{\text{sum of }Y\text{ squares}}}).
    8 Interpret the result (see Section 4).

    Tip: Using a spreadsheet (Excel, Google Sheets) or a statistical calculator automates steps 3‑6, but doing them by hand at least once reinforces understanding.


    3. Worked Example (Illustrative Data Set)

    Since the original prompt did not include a specific data table, we will demonstrate the calculation with a small, easy‑to‑follow dataset. Feel free to replace the numbers with your own data; the mechanics stay identical.

    Observation (i) (X_i) (Hours Studied) (Y_i) (Exam Score %)
    1 2 65
    2 3 70
    3 5 78
    4 6 82
    5 8 88

    Step 1–2: Compute the Means

    [ \bar X = \frac{2+3+5+6+8}{5} = \frac{24}{5} = 4.8 ] [ \bar Y = \frac{65+70+78+82+88}{5} = \frac{383}{5} = 76.6 ]

    Step 3–6: Build the Table of Deviations, Cross‑Products, and Squares

    i (X_i) (Y_i) (X_i-\bar X) (Y_i-\bar Y) ((X_i-\bar X)(Y_i-\bar Y)) ((X_i-\bar X)^2) ((Y_i-\bar Y)^2)
    1 2 65 -2.8 -11.6 32.48 7.84 134.56
    2 3 70 -1.8 -6.6 11.88 3.24 43.56
    3 5 78 0.2 1.4 0.28 0.04 1.96
    4 6 82 1.2 5.4 6.48 1.44 29.16
    5 8 88 3.2 11.4 36.48 10.24 129.96
    Sum **87

    Related Post

    Thank you for visiting our website which covers about Calculate The Linear Correlation Coefficient For The Data Below . We hope the information provided has been useful to you. Feel free to contact us if you have any questions or need further assistance. See you next time and don't miss to bookmark.

    Go Home