CalculatorsToolsGuides 日本語
BenchFig › Guides › Reading linear regression and R² (slope CI, confidence vs prediction bands)
Statistics

Reading linear regression and R² (slope CI, confidence vs prediction bands)

Fitting a regression line to a scatter plot produces many numbers: slope, intercept, R² and more. What does each mean, and what belongs in the paper? Using the app’s sample (n = 14), this guide works through the slope’s confidence interval, R², the difference between confidence and prediction bands, and residual plots.

Updated: BenchFig日本語

What regression tells you

Key points
  • The regression line y = a + b·x minimizes the sum of squared residuals (vertical distances from points to the line): least squares
  • The slope b is how much y changes when x goes up by 1; its 95% confidence interval shows how precisely it is known
  • R² is the share of the variation in y explained by the line; Sy.x is the scatter of points around the line (residual SD)
  • The confidence band is the uncertainty of the line itself; the prediction band is where a new single point would fall, and is much wider

A correlation coefficient summarizes in one number how closely two variables move together; regression describes with an equation how to predict y from x. Because x is treated as the predictor and y as the outcome, swapping them gives a different line.

Example: results for the sample data

−10010203040506001234Protein (a.u.)mRNA (relative)Y = 9.92X + 5.03, R² = 0.832
The app’s sample (made up, n = 14). Solid line: regression line; shaded band: 95% confidence band (uncertainty of the line itself); dotted lines: 95% prediction band (where a new single measurement would fall). The confidence band is narrowest near the mean of x and widens toward the ends.
ItemValueMeaning
Slope9.92 (SE 1.29, 95% CI 7.12 to 12.73)Protein rises by about 9.9 for each unit of mRNA
Y intercept5.03 (SE 3.18, 95% CI −1.90 to 11.95)Predicted value at mRNA = 0; the CI includes 0, so it cannot be distinguished from 0
R²0.83283% of the variation in protein is explained by the line
Sy.x4.71Points scatter around the line with an SD of about 4.7
Slope = 0 testt(12) = 7.71, P = 5.5 × 10−6A slope of 0 (no relationship) is implausible
X intercept−0.51Outside the data range (0.52 to 3.64): an extrapolation, not to be interpreted

The slope’s 95% CI is b ± t0.975, n−2 × SE(b), here 9.92 ± 2.179 × 1.29. Since SE(b) = Sy.x / √Σ(x − x̄)², the slope is estimated more precisely when the points scatter less and when x covers a wider range.

Reading R²

R² = 1 − Σ(y − ŷ)²Σ(y − ȳ)²Numerator: sum of squared residuals around the line. Denominator: sum of squares around the mean of y.

R² runs from 0 to 1; closer to 1 means points closer to the line. But a high R² does not mean a straight line is the right model: as the saturating curve below shows, a clearly curved relationship can have R² above 0.7. Conversely, with noisy biological data a low R² can still reflect a meaningful relationship if the slope’s CI is well away from 0.

Confidence band vs prediction band

Confidence: ŷ ± t · Sy.x · √(1n + (x − x̄)²Σ(x − x̄)²)
Prediction: ŷ ± t · Sy.x · √(1 + 1n + (x − x̄)²Σ(x − x̄)²)
xPredicted ŷ95% confidence band95% prediction band
2.2527.424.6 to 30.116.7 to 38.0
3.6441.136.4 to 45.929.9 to 52.4

The confidence band is the range likely to contain the true line, and it shrinks without limit as n grows. The prediction band is where a new single animal’s value would fall; the extra “1 +” keeps the scatter of individual points (Sy.x) in it however large n is. At x = 2.25 (near the mean of x), the confidence band is 5.5 wide but the prediction band 21.2. When you draw a band, always say which one it is in the legend.

Checking the fit with a residual plot

Plotting residuals (observed y minus the line’s prediction) against x shows whether a straight line is adequate. Residuals scattered around 0 with no pattern are fine. A bow means a curved relationship; a funnel that widens to the right means the scatter grows with x (consider a log transform).

−8−6−4−2024601234ResidualmRNA (relative)
Sample: no pattern
−20−15−10−5051002468ResidualTime (h)
Saturating curve: a bow
Residual plots (horizontal line: residual = 0). Left: residuals scatter randomly around 0, so a straight line is adequate. Right: a straight line fitted to a saturating curve (R² = 0.74) leaves a pattern (low at both ends, high in the middle), showing that a line does not capture the shape.

The example on the right has a fairly high R² of 0.74, yet its residuals show a clear pattern. Do not conclude that a line fits from R² alone.

Open this sample on the Correlation & regression screenToggle the confidence and prediction bands, and edit the values in the table to see how the slope’s 95% CI and the band widths change.
Open for free →

How it relates to the correlation coefficient

In simple regression, R² equals the square of Pearson’s r (here r = 0.912, r² = 0.832). The slope is b = r × SD(y) / SD(x) = 0.912 × 11.03 / 1.014 = 9.92, and the P value for slope = 0 is the same as for r = 0. The difference is that r is a unitless strength of association, while the slope is a rate of change in units of y per unit of x. The CI of r and how it compares with Spearman are covered in Pearson vs Spearman correlation.

How to write it in a paper

Methods: “The relationship between x and y was fitted by least-squares linear regression; 95% confidence intervals of the slope and intercept are shown. Shaded bands show the 95% confidence band of the regression line.”

Results: “Protein levels increased with mRNA levels (slope 9.92, 95% CI 7.12–12.73; R² = 0.83; n = 14; P < 0.001).” Give the slope its units (e.g. a.u. per relative unit), and include n and the scatter plot. If you predict outside the data range (extrapolation), justify why the line should hold there.

BenchFig fits straight lines with one x variable (simple linear regression). Comparing slopes between data sets, nonlinear regression and multiple regression are out of scope.

FAQ

What R² counts as a “good fit”?

There is no fixed threshold. Standard curves are often expected to exceed 0.99, while in noisy biological relationships an R² of 0.3 can be meaningful. Rather than the size of R², check that the residual plot shows no pattern and how narrow the slope’s confidence interval is.

Can I force the intercept through zero?

Only if y = 0 at x = 0 is certain on theoretical grounds and the data extend close to it. Forcing it changes the definition of R² (many programs then report a larger value), so values are no longer comparable. BenchFig always estimates the intercept.

Can I test whether two groups have different slopes?

BenchFig gives the slope and 95% CI for each data set but does not test the difference between slopes (ANCOVA). Use clearly non-overlapping CIs as a rough guide; for a formal test, fit a model with an interaction term in R, Prism or similar.

What if the relationship is curved?

If a log transform makes it straight, you can fit a simple regression after transforming. Nonlinear regression (four-parameter logistic dose–response, exponentials, etc.) and multiple regression with two or more x variables are not available in BenchFig.

Fit a regression line to sample dataOpen a sample on the Correlation & regression screen to get the line with its 95% confidence band (prediction band optional), slope and intercept with 95% CIs, R², Sy.x, the X intercept and a results sentence.
Open for free →
Your own data, all the way to the final figure.Loading your files, saving, and journal-ready export (PDF, TIFF, PNG, SVG) are in BenchFig Pro for Windows, updated based on researchers’ requests: ¥3,980/year (2 PCs), with lab and perpetual licenses too.
About the app →

Related guides

Product and journal names are trademarks or registered trademarks of their respective owners.