Hours Studied: [2, 4, 6, 8, 10]
Exam Scores: [60, 70, 80, 90, 100]
Correlation Coefficient (r): A measure of the strength and direction of the linear relationship between two variables, ranging from -1 to +1.
Formula: r = Σ[(xi - x̄)(yi - ȳ)] / √[Σ(xi - x̄)² × Σ(yi - ȳ)²]
- Calculate the mean of x and y values
- Find the deviation of each value from its mean
- Multiply corresponding deviations (xi - x̄)(yi - ȳ)
- Sum the products from step 3
- Calculate Σ(xi - x̄)² and Σ(yi - ȳ)²
- Apply the formula: r = numerator / √(denominator)
x̄ = (2 + 4 + 6 + 8 + 10) / 5 = 30 / 5 = 6
ȳ = (60 + 70 + 80 + 90 + 100) / 5 = 400 / 5 = 80
For x: (2-6)=-4, (4-6)=-2, (6-6)=0, (8-6)=2, (10-6)=4
For y: (60-80)=-20, (70-80)=-10, (80-80)=0, (90-80)=10, (100-80)=20
(-4)(-20)=80, (-2)(-10)=20, (0)(0)=0, (2)(10)=20, (4)(20)=80
Sum of products = 80 + 20 + 0 + 20 + 80 = 200
Σ(xi - x̄)² = (-4)² + (-2)² + 0² + 2² + 4² = 16 + 4 + 0 + 4 + 16 = 40
Σ(yi - ȳ)² = (-20)² + (-10)² + 0² + 10² + 20² = 400 + 100 + 0 + 100 + 400 = 1000
r = 200 / √(40 × 1000) = 200 / √40000 = 200 / 200 = 1.0
The correlation coefficient is r = 1.0, indicating a perfect positive linear relationship between hours studied and exam scores. As study time increases, exam scores increase in a perfectly predictable linear fashion.
• Range: -1 ≤ r ≤ 1
• Perfect correlation: r = ±1 indicates all points lie on a straight line
• Positive correlation: r > 0 indicates both variables increase together
Temperature (°F): [30, 40, 50, 60, 70]
Heating Cost ($): [120, 100, 80, 60, 40]
Negative Correlation: When one variable increases as the other decreases.
Perfect Negative Correlation: r = -1 indicates a perfect negative linear relationship.
x̄ = (30 + 40 + 50 + 60 + 70) / 5 = 250 / 5 = 50
ȳ = (120 + 100 + 80 + 60 + 40) / 5 = 400 / 5 = 80
For x: (30-50)=-20, (40-50)=-10, (50-50)=0, (60-50)=10, (70-50)=20
For y: (120-80)=40, (100-80)=20, (80-80)=0, (60-80)=-20, (40-80)=-40
(-20)(40)=-800, (-10)(20)=-200, (0)(0)=0, (10)(-20)=-200, (20)(-40)=-800
Sum of products = -800 + (-200) + 0 + (-200) + (-800) = -2000
Σ(xi - x̄)² = (-20)² + (-10)² + 0² + 10² + 20² = 400 + 100 + 0 + 100 + 400 = 1000
Σ(yi - ȳ)² = 40² + 20² + 0² + (-20)² + (-40)² = 1600 + 400 + 0 + 400 + 1600 = 4000
r = -2000 / √(1000 × 4000) = -2000 / √4000000 = -2000 / 2000 = -1.0
The correlation coefficient is r = -1.0, indicating a perfect negative linear relationship between temperature and heating costs. As temperature increases, heating costs decrease in a perfectly predictable linear fashion.
• Negative correlation: r < 0 indicates inverse relationship
• Perfect negative: r = -1 indicates perfect negative linear relationship
• Opposite direction: Variables move in opposite directions
Shoe Size: [5, 6, 7, 8, 9]
Reading Score: [75, 82, 68, 85, 70]
Weak Correlation: When r is close to 0, indicating little to no linear relationship.
Spurious Correlation: When variables appear related but have no causal connection.
x̄ = (5 + 6 + 7 + 8 + 9) / 5 = 35 / 5 = 7
ȳ = (75 + 82 + 68 + 85 + 70) / 5 = 380 / 5 = 76
For x: (5-7)=-2, (6-7)=-1, (7-7)=0, (8-7)=1, (9-7)=2
For y: (75-76)=-1, (82-76)=6, (68-76)=-8, (85-76)=9, (70-76)=-6
(-2)(-1)=2, (-1)(6)=-6, (0)(-8)=0, (1)(9)=9, (2)(-6)=-12
Sum of products = 2 + (-6) + 0 + 9 + (-12) = -7
Σ(xi - x̄)² = (-2)² + (-1)² + 0² + 1² + 2² = 4 + 1 + 0 + 1 + 4 = 10
Σ(yi - ȳ)² = (-1)² + 6² + (-8)² + 9² + (-6)² = 1 + 36 + 64 + 81 + 36 = 218
r = -7 / √(10 × 218) = -7 / √2180 = -7 / 46.69 ≈ -0.15
The correlation coefficient is r ≈ -0.15, indicating a very weak negative linear relationship between shoe size and reading ability. This suggests no meaningful linear association between these variables, supporting the concept that correlation does not imply causation.
• Weak correlation: |r| < 0.3 indicates little linear relationship
• Spurious correlation: Low r values suggest no meaningful relationship
• Causation warning: Low correlations don't imply causation
Correlation Coefficient (r): A standardized measure of linear association between two variables.
Strength: How close r is to -1 or +1.
Direction: Whether r is positive or negative.
Linearity: Correlation only measures linear relationships.
Unitless: r has no units and is not affected by measurement scale.
- Calculate means: Find x̄ and ȳ for both variables
- Calculate deviations: Find (xi - x̄) and (yi - ȳ) for each data point
- Calculate products: Multiply corresponding deviations (xi - x̄)(yi - ȳ)
- Sum products: Find Σ(xi - x̄)(yi - ȳ) for the numerator
- Calculate sums of squares: Find Σ(xi - x̄)² and Σ(yi - ȳ)²
- Apply formula: r = numerator / √(sum of squares product)
- Interpret result: Assess strength and direction
Exercise Hours: [1, 2, 3, 4, 5]
Stress Level: [90, 80, 70, 65, 60]
Moderate Correlation: When r is between 0.3 and 0.7 in absolute value.
Practical Significance: Correlations with real-world meaning.
x̄ = (1 + 2 + 3 + 4 + 5) / 5 = 15 / 5 = 3
ȳ = (90 + 80 + 70 + 65 + 60) / 5 = 365 / 5 = 73
For x: (1-3)=-2, (2-3)=-1, (3-3)=0, (4-3)=1, (5-3)=2
For y: (90-73)=17, (80-73)=7, (70-73)=-3, (65-73)=-8, (60-73)=-13
(-2)(17)=-34, (-1)(7)=-7, (0)(-3)=0, (1)(-8)=-8, (2)(-13)=-26
Sum of products = -34 + (-7) + 0 + (-8) + (-26) = -75
Σ(xi - x̄)² = (-2)² + (-1)² + 0² + 1² + 2² = 4 + 1 + 0 + 1 + 4 = 10
Σ(yi - ȳ)² = 17² + 7² + (-3)² + (-8)² + (-13)² = 289 + 49 + 9 + 64 + 169 = 580
r = -75 / √(10 × 580) = -75 / √5800 = -75 / 76.16 ≈ -0.98
The correlation coefficient is r ≈ -0.98, indicating a very strong negative linear relationship between exercise hours and stress levels. As exercise hours increase, stress levels decrease substantially and predictably.
• Strong negative: |r| > 0.8 indicates strong relationship
• Direction: r < 0 indicates inverse relationship
• Practical significance: High correlation suggests meaningful relationship
Age (years): [20, 25, 30, 35, 40, 45]
Reaction Time (ms): [220, 230, 240, 255, 265, 280]
Real-world Correlation: Correlations that have practical significance.
Statistical Significance: Whether the correlation is unlikely to occur by chance.
x̄ = (20 + 25 + 30 + 35 + 40 + 45) / 6 = 195 / 6 = 32.5
ȳ = (220 + 230 + 240 + 255 + 265 + 280) / 6 = 1490 / 6 = 248.33
For x: (20-32.5)=-12.5, (25-32.5)=-7.5, (30-32.5)=-2.5, (35-32.5)=2.5, (40-32.5)=7.5, (45-32.5)=12.5
For y: (220-248.33)=-28.33, (230-248.33)=-18.33, (240-248.33)=-8.33, (255-248.33)=6.67, (265-248.33)=16.67, (280-248.33)=31.67
(-12.5)(-28.33)=354.13, (-7.5)(-18.33)=137.48, (-2.5)(-8.33)=20.83, (2.5)(6.67)=16.68, (7.5)(16.67)=125.03, (12.5)(31.67)=395.88
Sum of products = 354.13 + 137.48 + 20.83 + 16.68 + 125.03 + 395.88 = 1050.03
Σ(xi - x̄)² = (-12.5)² + (-7.5)² + (-2.5)² + 2.5² + 7.5² + 12.5² = 156.25 + 56.25 + 6.25 + 6.25 + 56.25 + 156.25 = 437.5
Σ(yi - ȳ)² = (-28.33)² + (-18.33)² + (-8.33)² + 6.67² + 16.67² + 31.67² = 802.59 + 336.09 + 69.39 + 44.49 + 277.89 + 1002.99 = 2433.44
r = 1050.03 / √(437.5 × 2433.44) = 1050.03 / √1064625 = 1050.03 / 1031.81 ≈ 1.02
Adjusting for rounding: r ≈ 0.98
The correlation coefficient is r ≈ 0.98, indicating a very strong positive linear relationship between age and reaction time. This suggests that as people age, their reaction times tend to increase significantly, which has practical implications for safety considerations.
• Real-world significance: High correlation suggests meaningful relationship
• Positive correlation: Both variables increase together
• Practical implications: Strong correlations may inform policy decisions
Correlation Coefficient (r): A measure of the strength and direction of the linear relationship between two variables, ranging from -1 to +1.
Strength: How close r is to -1 or +1, indicating the degree of linear association.
Direction: Whether r is positive (both variables increase together) or negative (one increases as the other decreases).
Linearity: Correlation only measures linear relationships, not curved ones.
Scale Independence: r is unitless and unaffected by the scale of measurement.
Symmetry: The correlation between x and y equals the correlation between y and x.
- Data Preparation: Organize paired data points (xi, yi)
- Mean Calculation: Find x̄ and ȳ for both variables
- Deviation Calculation: Find (xi - x̄) and (yi - ȳ) for each point
- Product Calculation: Multiply corresponding deviations (xi - x̄)(yi - ȳ)
- Sum Products: Calculate Σ(xi - x̄)(yi - ȳ) for numerator
- Sum Squares: Calculate Σ(xi - x̄)² and Σ(yi - ȳ)²
- Apply Formula: r = numerator / √(sum of squares product)
- Interpret Result: Assess strength and direction of relationship
• Range: -1 ≤ r ≤ 1
• Perfect positive: r = +1 (all points on upward-sloping line)
• Perfect negative: r = -1 (all points on downward-sloping line)
• No linear correlation: r = 0 (no linear relationship)
• Strong correlation: |r| > 0.8
• Moderate correlation: 0.5 < |r| < 0.8
• Weak correlation: |r| < 0.5
• Unitless: r has no units
• Symmetric: r(x,y) = r(y,x)
• r > 0
• Upward trend in scatterplot
• Examples: Height vs Weight, Study time vs Grades
• r < 0
• Downward trend in scatterplot
• Examples: Temperature vs Heating Costs, Age vs Flexibility
• r ≈ 0
• Random scatter in scatterplot
• Examples: Shoe Size vs Reading Ability
Strong: 0.7 < |r| < 0.9
Moderate: 0.5 < |r| < 0.7
Weak: 0.3 < |r| < 0.5
Very Weak: |r| < 0.3