# Significance difference between the slopes of three regression lines

I have three simple regression models with three different Y (dependant variable) and one X (independent variable). All the slopes are significant. Is there anything called testing the difference between the slopes of all the three models?

• Are the dependent variables all measuring the same quantity? – Glen_b -Reinstate Monica Sep 29 '14 at 0:35
• Are you talking about testing all three at once, or are you looking to compare the slopes pairwise? – Glen_b -Reinstate Monica Sep 29 '14 at 0:44
• @Glen_b Yes they all measure the same quantity. If there is a test that do the comparison at once, it would be great. Otherwise, pairwise would do the job. – salhin Sep 29 '14 at 7:32
• That's covered by my answer. – Glen_b -Reinstate Monica Sep 29 '14 at 7:37

In the case where $y_1$, $y_2$, $y_3$ are all measuring the same thing and are independent, you can easily make such a comparison. (If they're not measuring the same thing, comparing slopes won't make sense.)

I assume for the moment you want to test simultaneous equality of all three against the possibility that at least one differs from the rest.

If you are prepared to assume homogeneity of variance, this is quite simple. You just stack up the three DVs, and stack three copies of $x$. You then add a factor/dummy variables representing which of the original dependent variables each observation is in (which I will refer to collectively as "group").

You then fit a model of the form $E(y) = \text{group} + x + \text{group} \times x$. If the interaction terms differ significantly from zero, you would conclude the slopes are different, but if the interaction terms don't differ significantly from zero, you could not conclude the slopes are different.

(If you can't assume equal variance, it's a bit more complicated, but something can still be done.)

what values group variables will take for the three Ys?

If group is a factor, you'd code it as 100 copies of each of $1$,$2$, and $3$ (or any 3 other unique things). If you convert that to dummies, then the first dummy would be 100 $1$'s followed by 200 $0$'s, the second would be 100 $0$'s, then 100 $1$'s and 100 $0$'s, and the third dummy would be 200 $0$'s followed by 100 $1$s (but you'd normally omit the first dummy from the model).

• Just to confirm my understanding, if I have 100 observation for each of the Ys and Xs so E(y) and x will have 300 value each. If so, what values group variables will take for the three Ys? – salhin Sep 29 '14 at 7:48
• See the updated answer. – Glen_b -Reinstate Monica Sep 29 '14 at 9:28
• @Glen_b But how could we say that they all are significant just because of one coefficient because it could be that only two are significant and they are making regression coefficient significant? – 李 慕 Apr 10 '16 at 14:54
• @Naseer This sounds like a new (different) question - most likely one already answered on site. Briefly: the answer comes down to the fact that it's not meaningful to talk about "significance" in the absence of a hypothesis. Your question is entirely resolved by being clear about which hypothesis you want to test. – Glen_b -Reinstate Monica Apr 10 '16 at 23:05

You can compare models when fitted to the same data. Here it would be meaningless to test the difference between the slopes, since you fitted the models to different data.