Variable Relationships › Limitations and Considerations

Michael BrenndoerferJune 3, 20254 min read
Machine Learning from ScratchAll chapters
Part 1 of 9Statistics 101
Chapter 6Variable Relationships › Limitations and Considerations
Reading section 9 of 11 · Limitations and Considerations · 4 minSection 9 of 11 · 4 min

Book contents

Section 9 of 11 · 4 min read

Variable Relationships › Limitations and ConsiderationsOne section · Sections in this chapter9 / 11 ↓
Reading tools Definitions & inline links

Choose your expertise level to adjust how many terms are explained. Beginners see more tooltips, experts see fewer to maintain reading flow. Hover over underlined terms for instant definitions.

Article links

Make inline references clickable

Correlation and regression methods rest on important assumptions that should be verified in practice. Linearity is perhaps the most fundamental assumption: these methods measure and model linear relationships, so they may fail to capture non-linear patterns. Visualizing relationships before computing correlations or fitting regression models helps ensure linearity is plausible. If relationships are non-linear, transformations like logarithms or polynomials may help, or alternative methods like generalized additive models may be more appropriate.

Outliers can dramatically influence correlation and regression estimates because both methods involve squared deviations. A single extreme observation can inflate or deflate correlation coefficients substantially and can rotate regression lines away from the bulk of the data. Some methods downweight outliers, but understanding why outliers occur and whether they represent valid data points is important before deciding how to handle them.

The following visualization demonstrates just how sensitive correlation coefficients are to outliers. A single extreme point can completely change the correlation from near zero to strongly negative.

Out[9]:
Visualization
Scatter plot showing correlation without outlier.
Correlation without outlier (r ≈ -0.16). The data shows little linear relationship between X and Y, with points scattered around a broadly horizontal pattern.
Scatter plot showing correlation with single outlier highlighted.
Correlation with a single outlier (r ≈ -0.28). Adding one extreme point in the upper-left makes the sample correlation more negative. The highlighted outlier has disproportionate influence because correlation uses deviations from both means, demonstrating why anomalous observations must be investigated.

Regression additionally assumes that errors are independent, identically distributed, and have constant variance (homoscedasticity). When these assumptions are violated (for example, when errors are correlated across time or when variance increases with the predicted value), standard errors and confidence intervals become unreliable. Residual diagnostics including plots of residuals versus fitted values help detect such violations and guide corrective actions like transformation or switching to weighted regression.

Sample size affects the reliability of correlation and regression estimates. Small samples yield imprecise estimates with wide confidence intervals, and correlations can appear strong due to chance even when no relationship exists in the population. Statistical significance testing helps distinguish real relationships from sampling variability, but practical significance also matters: a statistically significant but tiny correlation may have little practical value despite low p-values in large datasets.

Finally, correlation and regression describe associations in observed data but do not, by themselves, establish causation. Claims about causal relationships require additional evidence from experimental manipulation, temporal ordering, elimination of confounders, or strong theoretical justification. Interpreting regression coefficients as causal effects requires study designs that support such interpretation, such as randomized experiments or appropriate causal inference methods.