To compare regression lines across groups, fit a model with a group-by-predictor interaction and test that interaction. It tests whether the slopes differ. If the data support a common slope, fit a parallel-lines model and test the group term to compare elevations. These are separate questions: a slope test does not establish whether the lines have different levels, and a common-slope comparison should not be used when meaningful slope differences remain.
What feature of the lines do you want to compare?
Two fitted lines can differ in slope, elevation, or both. A slope describes how the expected outcome changes as the predictor changes. Elevation describes the expected outcome at a specified predictor value. The usual analysis tests slope equality first; only if a common slope is defensible does the parallel-lines model provide a single adjusted group comparison.
- Slope: Do groups have different rates of change in the outcome as X changes?
- Elevation with a common slope: If rates of change are treated as equal, are the parallel lines at different levels?
- Predicted difference at a particular X: How far apart are the fitted group values at a scientifically relevant predictor value?
GraphPad’s Prism Curve Fitting Guide describes comparing linear regression lines as equivalent to one form of analysis of covariance (ANCOVA): Comparing linear regression lines.
Test whether the slopes differ
Fit a model with a group-by-predictor interaction
For two groups, code group membership as an indicator G (0 for the reference group and 1 for the other group), and fit:
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
#1 Best Overall
Y = β0 + β1X + β2G + β3(X × G) + ε
The reference group’s slope is β1. The other group’s slope is β1 + β3. The null hypothesis of equal slopes is H0: β3 = 0. The interaction coefficient represents the difference between the two slopes under this coding.
With three or more groups, use a categorical group factor and jointly test its interaction with X. The omnibus null sets all group-specific slope differences to zero. This is the usual ANCOVA test of slope homogeneity. Penn State’s ANCOVA material explains the interaction test and common-slope follow-up: ANCOVA.
Rank #2
- This guide is a perfect overview for the topics covered in introductory statistics courses.
Use a joint test when there are several groups
In a standard linear model, a partial F test comparing nested models tests the interaction restrictions together. For two groups, the interaction coefficient’s t test addresses that one slope contrast. For several groups, the omnibus test asks whether any slope differs; it does not identify which pairs differ. If particular pairwise comparisons matter, use planned contrasts or appropriately adjusted pairwise slope comparisons, and report their uncertainty.
Interpret the interaction result carefully
If the interaction is statistically significant
A significant interaction is evidence, under the fitted model, that the group slopes are not all equal. Keep the interaction in the model; do not report one common adjusted group effect as if all lines were parallel. Report group-specific slope estimates and confidence intervals. Where the scientific question concerns group differences in outcome, estimate or plot those differences at meaningful, preferably prespecified, values of X, with uncertainty.
Rank #3
An omnibus interaction result alone does not say which groups differ. Follow it with the focused contrasts relevant to the question rather than treating the omnibus test as a complete account of every group comparison.
If the interaction is not statistically significant
A nonsignificant interaction means the analysis did not find sufficient evidence against equal slopes at the chosen significance threshold and with the available precision. It does not prove that population slopes are identical. Report the interaction estimate and its uncertainty, and consider whether the sample could detect slope differences large enough to matter in context.
Rank #4
If the goal is to establish that slope differences are small enough to be practically unimportant, specify an equivalence margin in advance and use an equivalence procedure. That answers a different question from failing to reject the conventional equal-slopes null.
Compare group elevations when a common slope is reasonable
When the shared-slope assumption is defensible, remove or constrain the interaction and fit the common-slope model:
Recommended Free Tools
Best Value
Y = β0 + β1X + β2G + ε
Then test the group term. This asks whether the parallel fitted lines differ in elevation at a common value of X. State the predictor value used for the adjusted comparison. Centering X at a meaningful value makes the group coefficient easier to interpret: with X centered there, β2 is the modeled group difference at that value.
GraphPad’s Prism Curve Fitting Guide distinguishes this follow-up from the slope test: once slopes are treated as indistinguishable, comparing elevations tests whether the lines are identical or merely parallel at different levels (guide to comparing regression lines).
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Check whether the linear ANCOVA model fits the data
The classical interpretation assumes a suitable linear mean relationship over the analyzed predictor range, independent errors consistent with the study design, and an error-variance model appropriate to the data. The common-slope comparison adds the assumption that group slopes can reasonably be treated as equal. Canada’s environmental monitoring guidance identifies approximate equality of slopes as a key ANCOVA assumption: Analysis of covariance guidance.
- Inspect residual patterns for evidence that the straight-line mean model or variance assumptions are unsuitable.
- Examine the group-by-X interaction rather than assuming groups have parallel relationships.
- Restrict interpretation to predictor values with relevant data support; fitted values outside observed ranges are extrapolations.
- If curvature is plausible, consider group-specific nonlinear terms or another response-appropriate model. A straight-line comparison answers only the linear-model question.
- For clustered, repeated, or otherwise dependent observations, use an error structure and degrees-of-freedom approach suited to that design; the basic ANCOVA test is not an automatic solution.
Report the test so readers can tell what was compared
A useful report names the model term and null hypothesis rather than relying only on a software label, since contrast coding and sums-of-squares conventions can affect displayed coefficient tests. Include:
Quick wins for a faster PC:
Repair Windows errors before they cause bigger problemsFix Now →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Clear out junk files and repair common Windows errorsFree Scan →- The model, including how groups were coded and whether the interaction was included.
- The slope-equality null hypothesis: for two groups, the interaction coefficient equals zero; for multiple groups, all group-by-predictor interaction terms equal zero.
- The test statistic, degrees of freedom, and p-value for the relevant joint or coefficient test.
- Group-specific slope estimates with confidence intervals.
- If common slopes are defensible, the common-slope follow-up and the predictor value used for the adjusted group comparison.
- If slopes differ, the group differences estimated at relevant predictor values, or a plot with uncertainty bands.
For a nonsignificant interaction, describe the result as a failure to find sufficient evidence of slope differences—not as proof of equal slopes.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

