I have the following code in Stata that I'm looking for the equivalent in SAS.

Stata code:

regress DV X1 X2 X3 X4 X5 if groupID == 0
est tab, b se stats(r2_a)
est store groupID0

regress DV X1 X2 X3 X4 X5 if groupID == 1
est tab, b se stats(r2_a)
est store groupID1

suest groupID0 groupID2, vce(cluster firmID)
test [groupID0_mean]_cons = [groupID1_mean]_cons
test [groupID0_mean]X1 = [groupID1_mean]X1
test [groupID0_mean]X2 = [groupID1_mean]X2
test [groupID0_mean]X3 = [groupID1_mean]X3
test [groupID0_mean]X4 = [groupID1_mean]X4
test [groupID0_mean]X5 = [groupID1_mean]X5

The first two regress statements perform OLS and save the coefficients, which I know how to do in SAS. The suest statements performs seeming unrelated regression on both group1 and group2 with clustered standard errors and then tests the equality of coefficients. It's the block of code from suest down that I cannot figure out in SAS.

Any help would be appreciated!

  • $\begingroup$ I think the SUEST statements will end up being LSMEANS statement but it does depend on what PROC you're using, REG or GLM? $\endgroup$
    – Reeza
    Jan 18 '19 at 23:59

I think you can use the SUR option in the PROC SYSLIN statement specifies seemingly unrelated regression, as shown in the following statements:

proc syslin data=in sur;
 demand: model q = r y s;
 supply: model q = r u;
  • 1
    $\begingroup$ Thanks for the reply, but it's the subsequent testing for equality between coefficients from two SUR regressions that I can't seem to figure out. $\endgroup$
    – jadibartolomeo
    Jan 20 '19 at 3:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy