Correlation and Linear Regression

Overview of Association Testing
  • Testing Associations (Continuous Variables):

    • Scatterplot: Visual inspection ("eyeballing") of coordinate pairs (XiX_i, YiY_i).

    • Correlation: Quantifies the strength and direction of a linear association.

    • Regression: Quantifies how changes in predictor variables influence an outcome variable to allow prediction.

Pearson Correlation Coefficient
  • Definition & Formula:

    • Ratio of signal to noise:   r=SignalNoise=covxysxsyr = \frac{\text{Signal}}{\text{Noise}} = \frac{\text{cov}_{xy}}{s_x s_y}   cov(x,y)=∑i=1N(xi−xˉ)(yi−yˉ)N−1\text{cov}(x, y) = \frac{\sum_{i=1}^{N} (x_i - \bar{x})(y_i - \bar{y})}{N - 1}

  • Value Range:

    • −1≤r≤+1-1 \le r \le +1

    • r=+1r = +1: Perfect positive linear relationship.

    • r=−1r = -1: Perfect negative linear relationship.

    • r=0r = 0: No linear relationship (nonlinear relationships may still exist).

  • Anscombe's Quartet & Linearity:

    • Evaluates linear associations only.

    • Datasets can share identical summary statistics (Xˉ=9.0\bar{X} = 9.0, Yˉ=7.5\bar{Y} = 7.5, r=.82r = .82) while having completely different patterns or outliers; visual inspection via scatterplots is required.

Causality, Confounders, and Hypothesis Testing
  • Spurious Correlations:

    • Significant associations driven by a third confounding variable (e.g., age confounding arm length and reasoning ability) or sheer coincidence.

  • Three Criteria for Causality:

    1. Concomitant Variation: Cause (XX) and effect (YY) must empirically vary together.

    2. Temporal Precedence: Cause (XX) must occur before effect (YY).

    3. Non-Spuriousness: Association cannot be explained by alternative confounding factors.

  • Hypothesis Testing for Correlation:

    • Null hypothesis:   H0:r=0H_0: r = 0

    • Alternative hypothesis:   Ha:r≠0H_a: r \ne 0

    • Degrees of freedom:   df=n−2df = n - 2

    • Reporting standards:

    • Significant:     r(198)=.578r(198) = .578, p<.001p < .001

    • Non-significant:     r(198)=.039r(198) = .039, p=.587p = .587

Simple Linear Regression Foundations
  • Correlation vs. Regression:

    • Correlation: Symmetric; variables are interchangeable (similar to a tt-test).

    • Regression: Asymmetric; directional dependency using predictors to explain an outcome (tied to ANOVA and the General Linear Model).

  • Model Equation:   Yi=b0+b1Xi+εiY_i = b_0 + b_1 X_i + \varepsilon_i

    • YiY_i: Outcome (dependent variable).

    • b0b_0: Intercept (value of YY when X=0X = 0).

    • b1b_1: Regression slope (change in YY per 1-unit increase in XX).

    • XiX_i: Predictor (independent variable).

    • εi\varepsilon_i: Random error component.

  • Ordinary Least Squares (OLS):

    • Finds the line of best fit by minimizing the sum of squared vertical distances from data points to the line.

Evaluating Regression Models
  • Partitioning Sum of Squares:   SST=SSM+SSRSS_T = SS_M + SS_R

    • SSTSS_T: Total sum of squares (variation relative to grand mean yˉ\bar{y}).

    • SSMSS_M: Model sum of squares (variance explained by fitted regression model).

    • SSRSS_R: Residual sum of squares (unexplained variability / error).

  • Goodness of Fit (R2R^2):

    • Proportion of total variance explained by the model:   R2=SSMSSTR^2 = \frac{SS_M}{SS_T}

  • Model Significance (FF-Test):

    • Tests if regression model explains significantly more variance than the grand mean:   F=MSMMSR=SSMdfMSSRdfRF = \frac{MS_M}{MS_R} = \frac{\frac{SS_M}{df_M}}{\frac{SS_R}{df_R}}

Regression Coefficients and Reporting
  • Unstandardized Coefficient (bib_i):

    • Raw change in YY per 1-unit change in XX.

    • Used for prediction:   Y^=b0+b1X\hat{Y} = b_0 + b_1 X

    • Example: If b0=34.67b_0 = 34.67 and b1=0.601b_1 = 0.601, at X=80X = 80:   Y^=34.67+80×0.601=82.75\hat{Y} = 34.67 + 80 \times 0.601 = 82.75

  • Standardized Coefficient (βi\beta_i):

    • Shift in standard deviations of YY per 1-SD shift in XX.

    • Example: A 1-SD increase in XX with β=0.685\beta = 0.685 and sy=26.10s_y = 26.10:   ΔY=0.685×26.10=17.8785\Delta Y = 0.685 \times 26.10 = 17.8785

  • Reporting Format:

    • Predictor:   b=0.601b = 0.601, t(98)=9.314t(98) = 9.314, p<.001p < .001

    • Overall model:   R2=.47R^2 = .47, F(1,98)=86.74F(1, 98) = 86.74, p<.001p < .001