Announcement

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

  • instrumental variable with panel data

    Goodmorning, I have a doubt about the interpretation of results.
    I typed
    Code:
     xtivreg depvar 1var 2var (endogenousvar= iv1 iv2), fe first
    However when the results are dysplayed I red among the instruments variables also the independet variables.
    In my case:
    Code:
    . xtivreg EmpRat IntRt1 L.IMFlending FrtRt LifeExp MoneyExp SendEnrl Inf InflowForgnInvLag ForgnInvOutLag GovConsLag GrTrade PolStab (IMFintervLag=Un
    > scLag UnscLag2 L3.Unsc) Lyp_all, fe first
    
    First-stage within regression
    
    Fixed-effects (within) regression               Number of obs     =        406
    Group variable: Countryid                       Number of groups  =         39
    
    R-sq:                                           Obs per group:
         within  = 0.1707                                         min =          2
         between = 0.5889                                         avg =       10.4
         overall = 0.3581                                         max =         15
    
                                                    F(16,351)         =       4.51
    corr(u_i, Xb)  = -0.6382                        Prob > F          =     0.0000
    
    -----------------------------------------------------------------------------------
         IMFintervLag |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
    ------------------+----------------------------------------------------------------
               IntRt1 |   4.06e-20   8.18e-20     0.50   0.620    -1.20e-19    2.01e-19
                      |
           IMFlending |
                  L1. |   .0003112   .0000552     5.63   0.000     .0002026    .0004198
                      |
                FrtRt |   .2780529   .1224215     2.27   0.024     .0372809    .5188249
              LifeExp |  -3.91e-18   5.59e-18    -0.70   0.485    -1.49e-17    7.09e-18
             MoneyExp |  -1.01e-17   5.47e-18    -1.85   0.065    -2.09e-17    6.42e-19
             SendEnrl |  -5.92e-19   5.11e-18    -0.12   0.908    -1.06e-17    9.45e-18
                  Inf |  -7.60e-19   9.59e-18    -0.08   0.937    -1.96e-17    1.81e-17
    InflowForgnInvLag |   .0041211   .0059112     0.70   0.486    -.0075048    .0157469
       ForgnInvOutLag |  -.0073391    .006467    -1.13   0.257     -.020058    .0053798
           GovConsLag |  -.0010917   .0022934    -0.48   0.634    -.0056022    .0034188
              GrTrade |   .3313871   .1641654     2.02   0.044     .0085154    .6542587
              PolStab |   .0028417   .0592084     0.05   0.962    -.1136062    .1192897
              Lyp_all |   .0462816     .01259     3.68   0.000     .0215203    .0710428
              UnscLag |   .0553762   .0770477     0.72   0.473    -.0961571    .2069095
             UnscLag2 |   .0932983    .079729     1.17   0.243    -.0635083     .250105
                      |
                 Unsc |
                  L3. |    .087662   .0738128     1.19   0.236    -.0575089    .2328329
                      |
                _cons |  -.5603178   .3502308    -1.60   0.111    -1.249133    .1284971
    ------------------+----------------------------------------------------------------
              sigma_u |  .29805667
              sigma_e |  .30855754
                  rho |  .48269456   (fraction of variance due to u_i)
    -----------------------------------------------------------------------------------
    F test that all u_i=0: F(38, 351) = 2.48                     Prob > F = 0.0000
    
    Fixed-effects (within) IV regression            Number of obs     =        406
    Group variable: Countryid                       Number of groups  =         39
    
    R-sq:                                           Obs per group:
         within  = 0.1564                                         min =          2
         between = 0.1225                                         avg =       10.4
         overall = 0.1538                                         max =         15
    
                                                    Wald chi2(14)     =  107811.97
    corr(u_i, Xb)  = -0.1297                        Prob > chi2       =     0.0000
    
    -----------------------------------------------------------------------------------
               EmpRat |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
    ------------------+----------------------------------------------------------------
         IMFintervLag |  -2.036931   2.095433    -0.97   0.331    -6.143904    2.070042
               IntRt1 |  -6.73e-19   4.53e-19    -1.49   0.137    -1.56e-18    2.15e-19
                      |
           IMFlending |
                  L1. |  -.0005973   .0007468    -0.80   0.424     -.002061    .0008664
                      |
                FrtRt |   3.847822   .8421164     4.57   0.000     2.197305     5.49834
              LifeExp |   5.11e-19   3.15e-17     0.02   0.987    -6.13e-17    6.23e-17
             MoneyExp |   7.52e-17   3.71e-17     2.03   0.042     2.55e-18    1.48e-16
             SendEnrl |  -1.64e-18   2.81e-17    -0.06   0.954    -5.68e-17    5.35e-17
                  Inf |  -3.89e-17   5.28e-17    -0.74   0.461    -1.42e-16    6.46e-17
    InflowForgnInvLag |   .0803051   .0336882     2.38   0.017     .0142774    .1463327
       ForgnInvOutLag |   -.067039   .0391689    -1.71   0.087    -.1438088    .0097307
           GovConsLag |   .0013152   .0128427     0.10   0.918     -.023856    .0264864
              GrTrade |   .6603426   1.150045     0.57   0.566    -1.593704    2.914389
              PolStab |  -.0886509   .3265736    -0.27   0.786    -.7287234    .5514216
              Lyp_all |   .5510124   .1188344     4.64   0.000     .3181012    .7839235
                _cons |   46.06358   2.129946    21.63   0.000     41.88897     50.2382
    ------------------+----------------------------------------------------------------
              sigma_u |  10.303229
              sigma_e |  1.7010581
                  rho |  .97346542   (fraction of variance due to u_i)
    -----------------------------------------------------------------------------------
    F  test that all u_i=0:     F(38,353) =   295.98          Prob > F    = 0.0000
    -----------------------------------------------------------------------------------
    Instrumented:   IMFintervLag
    Instruments:    IntRt1 L.IMFlending FrtRt LifeExp MoneyExp SendEnrl Inf
                    InflowForgnInvLag ForgnInvOutLag GovConsLag GrTrade PolStab Lyp_all
                    UnscLag UnscLag2 L3.Unsc
    -----------------------------------------------------------------------------------
    Honestly I don't understand what stata does. Does it uses as instruments all variables or only the ones that I have imposed? Why in the first stage there are coefficient for all the variables and why in the second stage, amog the instruments variables I read the name of all variable?
    thax for your help. I hope I would be clear.


  • #2
    Enrico:
    see -ivreg- entry in Stata .pdf manual for clarifications.
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      Hi Carlo thanx for your answer. I've already search help xtivreg on stata but it remain not clear for me.

      Comment


      • #4
        Enrico:
        1) the first stage option reports the result of the endogenous variable regressed onto all the exogenous predictors (instruments included);
        2) in the second stage regression are reported the results that follow from instrumenting the endogenous regressor. Despite Stata gathers together all the exogenous regressors under -Instruments-, the endogenous regressor is actually instrumented according to your instruction :
        Code:
        (endogenousvar= iv1 iv2)
        As you have an overidentified model (2 instruments vs 1 endogenous regressor), test of overidentifying restrictions should follow.
        Kind regards,
        Carlo
        (Stata 19.0)

        Comment


        • #5
          Enrico:
          as you can see in the folowing toy-example with -ivregress-, the footnote after the second stage outcome tables is identical (but the way the listed variables are ordered differs, as instruments of the endogenous regressor are reported at the end of the list) regadless of the number of instruments:
          Code:
          . use "C:\Program Files\Stata16\ado\base\a\auto.dta"
          (1978 Automobile Data)
          
          . ivregress 2sls price (mpg = trunk) length i.foreign, first
          
          First-stage regressions
          -----------------------
          
                                                          Number of obs     =         74
                                                          F(   3,     70)   =      41.24
                                                          Prob > F          =     0.0000
                                                          R-squared         =     0.6387
                                                          Adj R-squared     =     0.6232
                                                          Root MSE          =     3.5515
          
          ------------------------------------------------------------------------------
                   mpg |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
          -------------+----------------------------------------------------------------
                length |  -.2206762   .0310106    -7.12   0.000    -.2825249   -.1588276
                       |
               foreign |
              Foreign  |  -1.127666    1.10474    -1.02   0.311    -3.331001    1.075669
                 trunk |   .0044306   .1421115     0.03   0.975    -.2790018     .287863
                 _cons |   63.04382   4.927405    12.79   0.000     53.21642    72.87122
          ------------------------------------------------------------------------------
          
          
          Instrumental variables (2SLS) regression          Number of obs   =         74
                                                            Wald chi2(3)    =       0.29
                                                            Prob > chi2     =     0.9628
                                                            R-squared       =          .
                                                            Root MSE        =      26546
          
          ------------------------------------------------------------------------------
                 price |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
          -------------+----------------------------------------------------------------
                   mpg |  -7793.364   239748.1    -0.03   0.974      -477691    462104.3
                length |  -1624.471   52749.26    -0.03   0.975    -105011.1    101762.2
                       |
               foreign |
              Foreign  |  -5961.074   269678.3    -0.02   0.982    -534520.9    522598.7
                 _cons |   479205.8   1.51e+07     0.03   0.975    -2.91e+07    3.01e+07
          ------------------------------------------------------------------------------
          Instrumented:  mpg
          Instruments:   length 1.foreign trunk
          
          . ivregress 2sls price (mpg = trunk length) i.foreign, first
          
          First-stage regressions
          -----------------------
          
                                                          Number of obs     =         74
                                                          F(   3,     70)   =      41.24
                                                          Prob > F          =     0.0000
                                                          R-squared         =     0.6387
                                                          Adj R-squared     =     0.6232
                                                          Root MSE          =     3.5515
          
          ------------------------------------------------------------------------------
                   mpg |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
          -------------+----------------------------------------------------------------
               foreign |
              Foreign  |  -1.127666    1.10474    -1.02   0.311    -3.331001    1.075669
                 trunk |   .0044306   .1421115     0.03   0.975    -.2790018     .287863
                length |  -.2206762   .0310106    -7.12   0.000    -.2825249   -.1588276
                 _cons |   63.04382   4.927405    12.79   0.000     53.21642    72.87122
          ------------------------------------------------------------------------------
          
          
          Instrumental variables (2SLS) regression          Number of obs   =         74
                                                            Wald chi2(2)    =      30.73
                                                            Prob > chi2     =     0.0000
                                                            R-squared       =     0.2402
                                                            Root MSE        =     2553.6
          
          ------------------------------------------------------------------------------
                 price |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
          -------------+----------------------------------------------------------------
                   mpg |  -410.0987   74.26281    -5.52   0.000    -555.6511   -264.5462
                       |
               foreign |
              Foreign  |   2340.526   746.1295     3.14   0.002     878.1395    3802.913
                 _cons |   14203.42   1514.389     9.38   0.000     11235.27    17171.56
          ------------------------------------------------------------------------------
          Instrumented:  mpg
          Instruments:   1.foreign trunk length
          
          .
          Kind regards,
          Carlo
          (Stata 19.0)

          Comment

          Working...
          X