It's common to fit the same model to different subgroups and then make inferences about whether coefficients are similar across subgroups. What's the best way to do this in Stata? Here's an example that regresses price on mpg, separately for foreign and domestic cars:
How can I now test if the coefficient of mpg is similar for foreign and domestic cars?
I'm aware, by the way, that I can accomplish something similar by estimating an interaction between foreign and mpg, like this:
But I'd like to know if Stata has a convenient way to compare the foreign and domestic regressions without an interaction.
Code:
sysuse auto, clear reg price mpg if foreign reg price mpg if !foreign
I'm aware, by the way, that I can accomplish something similar by estimating an interaction between foreign and mpg, like this:
Code:
reg price c.mpg##i.foreign
Comment