Dear Colleagues

I'm running a mediation analysis in which I run two OLS regressions. They are similar but the second one has 1 more additional control variable and I want to compare the estimated coefficient of the main independent variable in the two regression and conduct a t-test for the difference. The following is an example for the code I'm running (assume that x y and z are controls):


Code:
regress Risk index x y 

est store reg1

regress Risk index x y z

est store reg2

suest  reg1 reg2

test [reg1_mean]index-[reg2_mean]index=0
My goal is to compare the Risk coefficient in equation 1 and 2 and run a t test for that. However, when I run the last line of my code (i.e. test...etc), STATA reproduces the regressions but with different coefficients compared to the result if I run the regression one by one myself. Moreover, this code will not run if I add the robust option in the regression command.

Is my code correct? why the regression results differes when running the test code?


the following paper did just that in table 3 (panel A) and deduct the coefficients from each other and test if it is significant or not:

Ferris, S. P., Javakhadze, D., & Rajkovic, T. (2017). CEO social capital, risk-taking and corporate policies. Journal of Corporate Finance, 47, 46-71.


Any advice?


Regards,
Ahmad