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!


migrated from stackoverflow.com Jan 22 at 14:06

This question came from our site for professional and enthusiast programmers.

  • $\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 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;
  • $\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 at 3:53

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.