A correlation summarizes how two variables move together, but does not directly say how much average Y changes when X changes by one unit. Regression expresses that question as an equation.
This unit asks one question.
How well can one line explain a relationship, and where does it fail?
Simple linear regression compresses an average relationship into two coefficients
Yᵢ=β₀+β₁Xᵢ+εᵢ
- β₀, intercept: mean Y when X=0
- β₁, slope: change in mean Y for a one-unit increase in X
- εᵢ, error: individual variation the equation does not explain
In a sample, fit ŷᵢ=b₀+b₁xᵢ. The slope has units of Y units/X units. If X is concentration in mg/mL and Y is viability percentage points, retain those units for scientific meaning.
If X=0 lies outside the observed range, the intercept may be necessary for calculation but have no practical interpretation. Centering X at a scientifically meaningful value makes the intercept the mean response at that observed reference.
Least squares minimizes the sum of squared vertical residuals
A residual is eᵢ=yᵢ−ŷᵢ. Least squares chooses the line with the smallest Σeᵢ². Squaring gives large residuals substantial influence, so always investigate the measurement causes and leverage of outliers.
A positive residual means the observation is above prediction; a negative one is below. Residuals from a suitable linear model should scatter around zero without special structure against fitted values or run order.
R² is an explained proportion, not a quality certificate
R²=1−SSE/SST
R² is the proportion of total observed Y variation explained by the fitted equation within this sample. In simple regression it equals r². A high R² does not guarantee that:
- the linear functional form is right;
- residual variance is constant;
- errors are independent;
- important variables are included;
- the relationship is causal; or
- prediction on new data is good.
Widening the X range can raise R², and narrowing it can lower R². Where response variation is inherently small, even a low R² can accompany a useful average effect.
Inspect curvature, funnels, time trends, clusters, and extreme points in residual-versus-fitted plots. One numeric summary can hide structural model failure.
Four residual patterns point to different problems
- U or S shape: the linear equation may need curvature or transformation.
- Funnel: variance changes with the mean level.
- Run-order trend: drift, autocorrelation, or batch change.
- Isolated large residual: measurement error, a different population, or an influential point.
Do not select a revision merely by adding increasingly favorable polynomial degrees after viewing residuals. Choose terms using mechanism, design range, and pre-specified candidate models, then check with new data or cross-validation.
Repeated X levels permit separation of pure error from lack of fit. A lack-of-fit test can help assess whether a candidate function has systematic failure beyond repeat error, but non-significance does not make the model true.
Extrapolation is not merely extending the line farther
If observed X ranges from 1–5, predicting at X=20 may encounter different response mechanisms, saturation, toxicity, or physical boundaries. The equation has an algebraic value, but evidence exists inside the design range. A prediction interval is uncertainty conditional on the model being right; it does not justify extrapolation.
In-Silico Lab: make the model fail deliberately
- At curvature 0, inspect the fitted line and R².
- Raise curvature to 1.2 and 2, then compare R² and residual structure.
- Add one outlier and inspect changes in slope and SSE.
- Change the seed and see how a sample fit estimates the generating model with variation.
직선과 잔차를 동시에 진단하세요
직선 적합 뒤 R²와 잔차가 곡률·이상값을 서로 다르게 드러내는지 봅니다.
처음이라면: 무엇을 눌러야 하나요?
- 1. 질문을 먼저 읽기Lab 제목에서 이번에 비교할 한 가지를 확인합니다.
- 2. 조건 하나만 바꾸기처음에는 n, 효과, 산포 같은 입력 중 하나만 바꾸십시오.
- 3. 새 합성 표본 누르기새 합성 데이터가 만들어집니다. 같은 조건도 표본에 따라 달라질 수 있습니다.
- 4. 그림과 계산 결과 비교하기바꾸기 전후 무엇이 움직이고 무엇이 그대로인지 한 문장으로 적어보십시오.
막히면 초기화로 돌아가 기본 결과를 본 뒤 조건 하나만 바꾸십시오. 이 Lab은 정답 판정기가 아니라 패턴 관찰 도구입니다.
같은 설정의 합성 관측
계산 결과
높은 R²도 잔차의 곡선 패턴을 지우지 못합니다. 측정 범위 밖 외삽은 특히 금지합니다.
교육용 synthetic model · bjs-relationship-sequence-v1. 실제 연구 판단에는 실험단위, 결측, 분포, 다중성, 사전계획과 도메인 기준을 별도로 반영해야 합니다.
JMP interpretation moves from coefficient table to residuals
절편·기울기 추정과 SE·CI를 실제 단위에서 읽습니다.
R²는 설명 비율이지 모형 적합성의 단독 증명이 아닙니다.
곡률·이분산·시간 drift·이상값 구조를 찾습니다.
Read coefficients, SEs, and CIs in Parameter Estimates; R² and RMSE in Summary of Fit; and the model test in Analysis of Variance, then always inspect residual plots and actual by predicted. Add polynomial terms because of scientific candidates and diagnostics—not because a menu makes them easy.
Example result statement
A linear model was fitted to 38 independent batches over 1–5 mg/mL. The slope was 2.4 percentage points/(mg/mL), 95% CI 1.6–3.2, with R²=.48. Residuals versus fitted values showed no marked curvature, but variance increased at high concentration. The slope direction remained in a weighted-model sensitivity analysis. We did not extrapolate this equation beyond the measured range.
Takeaways
- The slope is the average Y change for a one-unit X change.
- Least squares minimizes squared vertical residuals.
- R² is an explained proportion, not a stand-alone fit criterion.
- Residuals reveal curvature, unequal variance, drift, and outliers.
- Choose polynomial terms by mechanism and validation, not post hoc p-value competition.
- Predictive evidence exists within the observed design range.
The next units move beyond observed X–Y relationships to experimental design, where several inputs are deliberately arranged.
Official supplementary resources
The model and Lab in this article are educational synthetic material.