Consider a setting where the RHS of the two equations is identical, what is different is the LHS outcome:

Regression 1:

Regresion 2:

The goal is to test the equality of the coefficients on

Option 1 is to use

Option 2 is to manually stack the data (one dataset copy per regression), creating a dataset dummy variable, and estimating a model where

In my "real life" application, I am using

When I do not "absorb" fixed effects I have no problems, in the sense that on top of running the test of interest I am also able to retrieve the coefficients

However, when I absorb fixed effects this result doesn't hold anymore: the coefficients from the stacked regression are different from those obtained from the two separate regressions. I believe this is due to the fact that de-meaning the two separate models is different than de-meaning the stacked one.

Is it a right approach in this setting to first

Regression 1:

Code:

\[ y = a + bX + e \]

Code:

\[ y_2 = a_2 + b_2 X + e_2 \]

The goal is to test the equality of the coefficients on

*X*in the two regressions. By browsing on the internet I found two options.Option 1 is to use

*suest*, as for instance explained here: https://stats.idre.ucla.edu/stata/co...s-using-suest/Option 2 is to manually stack the data (one dataset copy per regression), creating a dataset dummy variable, and estimating a model where

*X*is interacted with the dummy. This is explained here: https://www.stata.com/support/faqs/s...-coefficients/In my "real life" application, I am using

*-reghdfe-*since I also need to absorb a large number of fixed effects. Since the package does not support*suest*, I am trying to implement option 2.When I do not "absorb" fixed effects I have no problems, in the sense that on top of running the test of interest I am also able to retrieve the coefficients

*b*and*b_2*(and the two intercepts) from the stacked regression. These are identical to those obtained when separately estimating the two original regressions.However, when I absorb fixed effects this result doesn't hold anymore: the coefficients from the stacked regression are different from those obtained from the two separate regressions. I believe this is due to the fact that de-meaning the two separate models is different than de-meaning the stacked one.

Is it a right approach in this setting to first

*separately*de-mean the two datasets, then stack the de-meaned datasets, and finally apply "Option 2"? My problem with this is that standard errors will be wrongly calculated since we have to take into account a preliminary estimation step. Do you know of alternative approaches to reach the same goal?
## Comment