Announcement

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

  • Cointegration: xtcointreg and stata's display command show different values

    Hello everyone!

    I am using the user-written command "xtcointreg" to conduct a panel data FMOLS study on the relationship between CO2 emissions and trade openness, controlling for GDP.

    The command gives me a result, however when I use stata's "di" command to get the beta coefficient, the number displayed is different compared to the xtcointreg beta. I checked and the display does not come from any previous regression, since I ran 2 xtcointregs followed by di in a row and the display result changes.

    Has this happened to anyone? If yes, have you figured out why and which one is the right value?

    Code:
    xtcointreg lnco2cap lngdp_cap env_exp_gdp, dic(aic)
    di _b[lngdp_cap]
    The beta I get from xtcointreg for lngdp_cap is -0.46, the di command gives me -2.28. Please see screenshot below.

    Thank you.



    Click image for larger version

Name:	stata.png
Views:	1
Size:	37.0 KB
ID:	1692213

  • #2
    xtcointreg is from SSC (FAQ Advice #12). Just poor coding. The authors of the command use cointreg (the Stata Journal) in their internal routines, running an estimation for each panel and then finally combine all these estimates. They do not clear the last estimate from cointreg which is what you get with display. So you probably should ignore this as it is just an input into the command's final output.

    Code:
    webuse grunfeld, clear
    xtcointreg inv mvalue kstock , dic(aic)
    di _b[mvalue]
    di "`e(cmdline)'"
    `e(cmdline)'

    Res.:

    Code:
    . xtcointreg inv mvalue kstock , dic(aic)
    Method of estimation: FMOLS
    Number
    
    Cave[2,2]
              beta  t-stat
    mvalue    0.10   27.82
    kstock    0.22   44.98
    
    .
    . di _b[mvalue]
    .00445047
    
    .
    . di "`e(cmdline)'"
    cointreg invest mvalue kstock if company==10, est()  eqt(0) eqd() xt(0) diff stage(1) dlead(1) dlag(1) dic() dmax(0) dvar() dvce()  dof(0) vic
    > () vlag(0)  kern() bwid(0) bmeth() blag(0)  level(95)
    
    .
    . `e(cmdline)'
    
    Cointegration regression (FMOLS):
    
    VAR lag(user)          =    0                   Number of obs     =         19
    Kernel                 =    bartlett            R2                =   .4205631
    Bandwidth(neweywest)   =    24.7532             Adjusted R2       =   .3481335
                                                    S.e.              =   1.238936
                                                    Long run S.e.     =   .3989271
    ------------------------------------------------------------------------------
          invest |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
    -------------+----------------------------------------------------------------
          mvalue |   .0044505   .0099843     0.45   0.656    -.0151183    .0240192
          kstock |   .4395949   .0294264    14.94   0.000     .3819203    .4972695
           _cons |   .1523191   .7609267     0.20   0.841     -1.33907    1.643708
    ------------------------------------------------------------------------------
    
    .

    Comment


    • #3
      Thank you very much!

      Comment

      Working...
      X