Hi,

I need to extract equationwise error terms of components of my SUR estimation. However by using post estimation predict command I am only able to produce one error term from entire estimation. How could I calculate error terms for all equations and store them seperately?


The following code simulates what I am trying to do by using sample data from stata repository. I need both residual series for open and high equations. In my original work this SUR system includes 11 different equations representing 11 different co-integration vectors. Now I am trying to produce their residuals to estimate short term 11 VEC equations by using SUR estimation.

Thank you very much


Code:
.  sysuse sp500.dta
(S&P 500)

. tsset date

Time variable: date, 02jan2001 to 31dec2001, but with gaps
        Delta: 1 day

. sureg (open L1.open L2.open L1.high L2.high L3.high) (high L1.open L2.open L1.high L2.high)

Seemingly unrelated regression
------------------------------------------------------------------------------
Equation             Obs   Params         RMSE  "R-squared"      chi2   P>chi2
------------------------------------------------------------------------------
open                  90        5      7.61825      0.9928   12416.11   0.0000
high                  90        4     11.59675      0.9828    5156.78   0.0000
------------------------------------------------------------------------------

------------------------------------------------------------------------------
             | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
open         |
        open |
         L1. |  -.4114277   .1297403    -3.17   0.002    -.6657139   -.1571415
         L2. |   .0716423    .091755     0.78   0.435    -.1081943    .2514789
             |
        high |
         L1. |   1.339624   .0796114    16.83   0.000     1.183588    1.495659
         L2. |    .094866   .1446546     0.66   0.512    -.1886517    .3783837
         L3. |  -.0810755   .0515966    -1.57   0.116     -.182203    .0200519
             |
       _cons |   -29.7035   11.58405    -2.56   0.010    -52.40783   -6.999178
-------------+----------------------------------------------------------------
high         |
        open |
         L1. |   -.614001   .1973872    -3.11   0.002    -1.000873   -.2271291
         L2. |   .0386898   .1194357     0.32   0.746       -.1954    .2727795
             |
        high |
         L1. |   1.374734   .1211697    11.35   0.000     1.137246    1.612223
         L2. |   .2000723   .2200332     0.91   0.363    -.2311849    .6313294
             |
       _cons |  -6.871725   17.42993    -0.39   0.693    -41.03377    27.29032
------------------------------------------------------------------------------

. predict residuals, equation(open : high)
(option xb assumed; fitted values)
equation open : high not found
r(303);

. predict residuals
(option xb assumed; fitted values)
(158 missing values generated)

. list residuals

     +----------+
     | residu~s |
     |----------|
  1. |        . |