Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • name conflict in identifying a matrix

    Hi,

    I need to compare parameters of equation coming from SUR and GLM estimations. So I need to code a procedure for Hausman Specification Test. Because I am unable to subset parameters of first equation from a SUR estimation. I filtered parameter vector and var-cov matrix of SUR estimation


    Code:
      sysuse sp500.dta
                   tsset date
     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
    ------------------------------------------------------------------------------
    
    .  mat open  = e(b)[1, "open:"]
    
    .  mat open_varcov  = e(V)["open:","open:"]

    Then I tried to assign these matrices to an instrumental equation specified as bellow

    Code:
    reg (open L1.open L2.open L1.high L2.high L3.high)
    erepost b = open
    erepost open_varcov = e(V)["open:","open:"]
    But I received the following error


    [P] error . . . . . . . . . . . . . . . . . . . . . . . . Return code 507
    name conflict
    You have issued a matrix post command, and the variance-
    covariance matrix of the estimators does not have the same row
    and column names, or if it does, those names are not the same
    as for the coefficient vector.

    (end of search)
    previously I have completed a similar procedure for a cross sectional study and it was ok. Does L1. lag operators could be the problem? Do I need to generate lag variables separately and use these generated variables in my model.

    Thank you very much



  • #2
    erepost is from SSC (FAQ Advice #12).

    Code:
    sysuse sp500.dta, clear
    tsset date
    sureg (open L1.open L2.open L1.high L2.high L3.high) (high L1.open L2.open L1.high L2.high)
    mat open  = e(b)[1, "open:"]
    mat open_varcov  = e(V)["open:","open:"]
    reg (open L1.open L2.open L1.high L2.high L3.high)
    erepost b = open, rename
    erepost V = open_varcov, rename
    Res.:

    Code:
    . mat l e(b)
    
    e(b)[1,6]
              open:       open:       open:       open:       open:       open:
                 L.         L2.          L.         L2.         L3.            
              open        open        high        high        high       _cons
    y1  -.41142769   .07164233    1.339624   .09486599  -.08107551  -29.703504
    
    . mat l e(V)
    
    symmetric e(V)[6,6]
                        open:       open:       open:       open:       open:       open:
                           L.         L2.          L.         L2.         L3.            
                        open        open        high        high        high       _cons
     open:L.open   .01683253
    open:L2.open   .00257293   .00841899
     open:L.high  -.00711145   .00016995   .00633798
    open:L2.high  -.01267201  -.00870173   .00080332   .02092494
    open:L3.high   .00023364  -.00245486  -.00008377  -.00030074   .00266221
      open:_cons   .38166722   .11286329  -.21235015  -.29784833  -.09083142   134.19027

    Comment

    Working...
    X