Pearson Correlation Coefficient and Hypothesis Testing Study Notes

Foundations of Correlation Calculations

The mathematical basis for correlation involves several key components derived from the raw data of two variables, identified here as xx and yy.

  • Key Deviation Formulas:
    • X Deviations: The difference between a specific score and the mean of the xx scores (xMxx - M_x).
    • Y Deviations: The difference between a specific score and the mean of the yy scores (yMyy - M_y).
    • Sum of Squared X Deviations (SSXSSX): Obtained by squaring each x deviation and summing them.
    • Sum of Squared Y Deviations (SSYSSY): Obtained by squaring each y deviation and summing them.
    • Sum of Products (SPSP): Obtained by multiplying the x deviation by the y deviation for each pair and summing those products.

Procedural Walkthrough: Calculating Deviations

In the provided example, the variable xx represents hours of video games played per week, and yy represents the number of fights per week.

  • Sample Data Characteristics:

    • Mean of X (MxM_x): The average hours of games per week was calculated as 66.
    • Mean of Y (MyM_y): The average number of fights per week was calculated as 44.
  • Calculating Individual Deviations:

    • Person 1 (x=0x=0): 06=60 - 6 = -6. This negative deviation signifies the individual plays 6 hours below the average.
    • Person 2 (x=10x=10): 106=410 - 6 = 4. This positive deviation signifies the individual plays 4 hours more than the average.
    • Interpretation: Deviations compare a score to the average. A positive value means the score is above average; a negative value means it is below average.
  • The Deviations Check:

    • An essential rule for any deviation column is that the values must always sum to exactly zero: (xMx)=0\sum (x - M_x) = 0.
    • Validation Example: The x deviations were 6,4,2,2,2-6, 4, -2, 2, 2. Summing these: 6+42+2+2=0-6 + 4 - 2 + 2 + 2 = 0.
    • Validation Example: The y deviations were 2,2,2,0,2-2, 2, -2, 0, 2. Summing these: 2+22+0+2=0-2 + 2 - 2 + 0 + 2 = 0.

Sum of Squares and Sum of Products

Once raw deviations are found, the next steps involve squaring them and calculating products.

  • Squared Deviations (SSSS):

    • X Squared Deviations ((xMx)2(x - M_x)^2): These are always positive. For the example: 36,16,4,4,436, 16, 4, 4, 4. Summing these results in SSX=64SSX = 64.
    • Y Squared Deviations ((yMy)2(y - M_y)^2): For the example: 4,4,4,0,44, 4, 4, 0, 4. Summing these results in SSY=16SSY = 16.
  • Sum of Products (SPSP):

    • The product is the x deviation multiplied by the y deviation: (xMx)×(yMy)(x - M_x) \times (y - M_y).
    • Unlike squared deviations, products can be negative.
    • Calculation:
      • (6)×(2)=12(-6) \times (-2) = 12
      • (4)×(2)=8(4) \times (2) = 8
      • (2)×(2)=4(-2) \times (-2) = 4
      • (2)×(0)=0(2) \times (0) = 0
      • (2)×(2)=4(2) \times (2) = 4
    • Total SP: 12+8+4+0+4=2812 + 8 + 4 + 0 + 4 = 28.

The Pearson Correlation Coefficient (rr)

The formula for the Pearson correlation coefficient utilizes SPSP, SSXSSX, and SSYSSY:

r=SPSSX×SSYr = \frac{SP}{\sqrt{SSX \times SSY}}

  • Step-by-Step Calculation:

    1. Multiply SSXSSX by SSYSSY: 64×16=102464 \times 16 = 1024.
    2. Take the square root of the result: 1024=32\sqrt{1024} = 32.
    3. Divide SPSP by this value: r=2832r = \frac{28}{32}.
    4. Final Result: r=0.875r = 0.875.
  • Interpreting the Coefficient:

    • Direction: Since rr is positive (+0.875+0.875), it is a positive relationship. As one variable increases, the other increases (more video games, more fights).
    • Strength: A correlation of 0.8750.875 is very close to 0.90.9, making it a very strong positive correlation. Correlations rarely reach a perfect 1.01.0 in real-world data.

Hypothesis Testing for Correlation

Hypothesis testing determines if a sample correlation is large enough to suggest a non-zero correlation exists in the broader population.

  • Hypotheses Definitions:

    • Null Hypothesis (H0H_0): ρ=0\rho = 0 (Rho equals zero). There is no correlation in the population between video games and aggression.
    • Alternative Hypothesis (H1H_1): ρ0\rho \neq 0 (Rho does not equal zero). There is a significant population correlation.
  • Degrees of Freedom (dfdf):

    • For correlation/regression, df=n2df = n - 2.
    • In this example, with n=5n = 5 kids: df=52=3df = 5 - 2 = 3.
  • Critical Value Determination:

    • The critical value is found using Table B6 (Critical Values for the Pearson Correlation).
    • Using α=0.05\alpha = 0.05, two-tailed, and df=3df = 3, the critical value (rcritr_{crit}) is approximately 0.8780.878.
  • Making the Decision:

    • Rule: If the absolute value of the obtained correlation (robt|r_{obt}|) is greater than or equal to the critical value (rcritr_{crit}), reject H0H_0.
    • Comparison: 0.875<0.878|0.875| < 0.878.
    • Result: Because 0.8750.875 is just slightly lower than the cutoff of 0.8780.878, we fail to reject the null hypothesis.
    • Conclusion: There is no statistically significant population correlation. This demonstrates a "warning" about small sample sizes: even a very strong correlation (0.8750.875) can occur by chance when the sample is as small as n=5n=5.

Cautions for Interpreting Correlation

There are four major caveats when working with Pearson correlations (represented as rr or ρ\rho).

1. Correlation is Not Causation

A relationship between two variables does not prove that one causes the other. Only a controlled experiment can prove causation.

  • Directionality Problem: If stress and marital satisfaction are negatively correlated, does stress cause low satisfaction, or does low marital satisfaction cause stress? It may be both.
  • Third Variable Problem: A third factor, such as finances, might influence both stress and marital satisfaction, creating the appearance of a direct link between them.
  • Example (Education and Income): While higher education correlates with higher income, it is possible that higher income allows someone the leisure to pursue more education, or that a "Type A" personality causes both high education and high income.

2. Linear Relationships Only

Pearson's rr specifically measures how well data points fit a straight line.

  • Curvilinear Relationships: If the data follows a curve (e.g., an inverted U), the points may have a very strong relationship, but Pearson's rr will be weak because it tries and fails to fit a straight line to the curve.
  • Importance of Scatter Plots: Always create a scatter plot first. If the relationship is clearly non-linear, do not use Pearson's rr.

3. Extrapolation

Extrapolation is the dangerous practice of concluding trends beyond the observed range of data.

  • Yerkes-Dodson Law Example: A graph of arousal vs. performance shows an inverted U. If a researcher only looks at low-to-medium arousal levels, they might wrongly conclude a linear relationship where "higher arousal always equals higher performance." This ignores the eventual decline in performance at high arousal (stress).
  • Range Constraints: Do not assume a relationship found between 0100-10 hours of video games holds true for someone playing 4040 hours a week.

4. Impact of Outliers

A single outlier can drastically change the correlation coefficient.

  • Effect on Strength: Outliers can make a non-existent correlation look strong, or they can pull a strong correlation down toward zero.
  • Handling Outliers: Do not discard them without a legitimate reason (e.g., a participant falling asleep during the study). Outliers are still data and can sometimes be the most informative points in a set.