Relate › Linear regression

Comparison of two regression slopes

Test whether two independent simple linear regressions share the same slope. ANCOVA-style x × group interaction.

What is Comparison of two regression slopes?

When the same x-y relationship is measured in two groups, the question 'do the slopes differ?' is answered by adding an x × group interaction to a combined regression. A significant interaction means the slopes differ.

If slopes are the same but intercepts differ, the curves are parallel — a constant vertical offset between groups. If slopes differ, the curves cross somewhere; report the intersection point and its CI alongside the slope test.

When should I use Comparison of two regression slopes?

  • Method comparison where you've collected (X, Y) under two conditions.
  • Sub-group analysis where you suspect the slope differs.

What data does it need?

Two (X, Y) pairs of columns — one for each group.

What does it report?

Per-group slope + slope difference (B − A) with CI + t (interaction) and F (model comparison) p + intersection point (x*, y*) with delta-method CI.

What does it assume?

  • Same as linear_regression in each group.
  • Independent samples between groups.

How do I interpret the result?

Non-significant slope difference but significant intercept difference ⇒ parallel curves with a vertical shift. Significant slope difference ⇒ the two relationships cross at x*.

See also