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.
What regression tells you
- 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
| Item | Value | Meaning |
|---|---|---|
| Slope | 9.92 (SE 1.29, 95% CI 7.12 to 12.73) | Protein rises by about 9.9 for each unit of mRNA |
| Y intercept | 5.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.832 | 83% of the variation in protein is explained by the line |
| Sy.x | 4.71 | Points scatter around the line with an SD of about 4.7 |
| Slope = 0 test | t(12) = 7.71, P = 5.5 × 10−6 | A slope of 0 (no relationship) is implausible |
| X intercept | −0.51 | Outside 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² 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
| x | Predicted ŷ | 95% confidence band | 95% prediction band |
|---|---|---|---|
| 2.25 | 27.4 | 24.6 to 30.1 | 16.7 to 38.0 |
| 3.64 | 41.1 | 36.4 to 45.9 | 29.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).
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.
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.
Related guides
Product and journal names are trademarks or registered trademarks of their respective owners.