Hi all SAS Users,
I am in a critical issue that when I use Stata and SAS, I have different results
What I want is that I want to run a Difference-in-Difference regression by using OLS with fixed effects (firms (TYPE) and years(yr)).
My code in STATA is:
encode TYPE, generate(TYPE2)
areg wROE pt wTOT_ASS_TUR wFIRM_SIZE LNGDP UNEMPLOYMENT INFLATION wLEVERAGE pri_ove_ern i.yr, a(TYPE2)
My result by running in STATA is:
As can be seen from the picture above, the coefficient of pt is 0.0026, positive.
However, I replicate this regression in SAS by using the code below:
proc glm data=merge_treat_con;
ABSORB TYPE;
class yr;
model wROE= pt TOT_ASS_TUR wFIRM_SIZE LNGDP UNEMPLOYMENT INFLATION
wLEVERAGE pri_ove_ear yr/solution ss3;
run;
quit;
It generates a WARNING but I hope it is not a critical mistake
WARNING: Formatted ABSORB values not sorted in ascending sequence.
And the result is as below:
Boom, the coefficient of pt now is -0.016, negative.
I am wondering which cause these difference and what is the way to get out of this situation?
I highly appreciate any comment and suggestion. Thank you for spending time with me in advance.
Warm regards.
Phil.
YR1991 is in the SAS output, but not in the STATA output. That may be a different parameterization of the model, which of course would result in different coefficients. Or maybe it's something different.
The F-test in SAS has 44781 degrees of freedom in the numerator, but STATA shows only 33 degrees of freedom in the numerator of the F-test.
So, these are not fitting the same model.
YR1991 is in the SAS output, but not in the STATA output. That may be a different parameterization of the model, which of course would result in different coefficients. Or maybe it's something different.
The F-test in SAS has 44781 degrees of freedom in the numerator, but STATA shows only 33 degrees of freedom in the numerator of the F-test.
So, these are not fitting the same model.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.