Back to List

Express and Diagnose a Relationship: Regression and Residuals

Explains regression slope, intercept, fitted values, least squares, and R², then diagnoses curvature, unequal variance, drift, and outliers with residual plots.

Intermediate
|
30min
|
Verified (2026-08-14)
regressionslopeinterceptleast squaresresidualR-squaredlack of fitJMP
Progress0/19 (0%)

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?
기울기X 한 단위 변화에 따른 평균 Y 변화
예측값 ŷ적합식이 각 X에서 제시한 값
잔차 e관측값 y에서 예측값 ŷ를 뺀 차이
관측 Y 변동 중 모형이 설명한 비율

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.

U15 · Figure 01
직선이 놓친 구조는 잔차 그림에서 다시 나타납니다
관측값과 적합 직선잔차 = y − ŷ
왼쪽 직선은 평균 경향을 요약하지만 오른쪽 잔차의 U자 패턴은 선형식에 곡률 항이 빠졌음을 알립니다.

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.

A high R² cannot rescue a U-shaped residual pattern

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

  1. U or S shape: the linear equation may need curvature or transformation.
  2. Funnel: variance changes with the mean level.
  3. Run-order trend: drift, autocorrelation, or batch change.
  4. 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

  1. At curvature 0, inspect the fitted line and R².
  2. Raise curvature to 1.2 and 2, then compare R² and residual structure.
  3. Add one outlier and inspect changes in slope and SSE.
  4. Change the seed and see how a sample fit estimates the generating model with variation.
In-Silico Lab · U15

직선과 잔차를 동시에 진단하세요

직선 적합 뒤 R²와 잔차가 곡률·이상값을 서로 다르게 드러내는지 봅니다.

처음이라면: 무엇을 눌러야 하나요?
  1. 1. 질문을 먼저 읽기Lab 제목에서 이번에 비교할 한 가지를 확인합니다.
  2. 2. 조건 하나만 바꾸기처음에는 n, 효과, 산포 같은 입력 중 하나만 바꾸십시오.
  3. 3. 새 합성 표본 누르기새 합성 데이터가 만들어집니다. 같은 조건도 표본에 따라 달라질 수 있습니다.
  4. 4. 그림과 계산 결과 비교하기바꾸기 전후 무엇이 움직이고 무엇이 그대로인지 한 문장으로 적어보십시오.

막히면 초기화로 돌아가 기본 결과를 본 뒤 조건 하나만 바꾸십시오. 이 Lab은 정답 판정기가 아니라 패턴 관찰 도구입니다.

같은 설정의 합성 관측

계산 결과

상관 r0.679
기울기1.726
0.461
SSE276.26

높은 R²도 잔차의 곡선 패턴을 지우지 못합니다. 측정 범위 밖 외삽은 특히 금지합니다.

교육용 synthetic model · bjs-relationship-sequence-v1. 실제 연구 판단에는 실험단위, 결측, 분포, 다중성, 사전계획과 도메인 기준을 별도로 반영해야 합니다.

JMP interpretation moves from coefficient table to residuals

Parameter Estimates

절편·기울기 추정과 SE·CI를 실제 단위에서 읽습니다.

Summary of Fit

R²는 설명 비율이지 모형 적합성의 단독 증명이 아닙니다.

Residual Plot / Lack of Fit

곡률·이분산·시간 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.
회귀식은 관계를 압축한 후보 모형입니다. R²보다 잔차 구조와 외삽 범위를 먼저 확인해야 예측이 과학적 질문을 버티게 됩니다.

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.

💬 Questions & Comments

0 comments

You can post without signing in. Guest comments cannot be edited or deleted by their author.

0/2000

Loading...