Announcement

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

  • -xtoverid- with factor variables

    Dear Statalisters,

    I am running an -xtivreg- regression and want to run a test for overidentifying restrictions of my instruments. However, when I include year and regional dummies I get an error ('o. operator not allowed'). Is there any way to get a test result with year and regional dummies included?

    Thank you,

    Ben

  • #2
    Ben:
    re-run your -xtivreg- code with the -xi:- prefx:
    Code:
    xi: xtivreg...
    Kind regards,
    Carlo
    (StataNow 18.5)

    Comment


    • #3
      Carlo Lazzaro This did not resolve the problem in my case:

      Code:
      xi: xtivreg growth_GDP_PPP_total L1.GDP_PPP_total (HIV_mean_prev = intercourse_young MC_mean_prev) i.year, fe vce(robust) first
      
      i.year            _Iyear_2000-2017    (naturally coded; _Iyear_2000 omitted)
      note: _Iyear_2017 omitted because of collinearity.
      
      First-stage within regression
      
      Fixed-effects (within) regression               Number of obs     =      9,360
      Group variable: pcode                           Number of groups  =        585
      
      R-squared:                                      Obs per group:
           Within  = 0.2727                                         min =         16
           Between = 0.2118                                         avg =       16.0
           Overall = 0.1961                                         max =         16
      
                                                      F(18,584)         =      25.93
      corr(u_i, Xb) = 0.2724                          Prob > F          =     0.0000
      
                                           (Std. err. adjusted for 585 clusters in pcode)
      -----------------------------------------------------------------------------------
                        |               Robust
          HIV_mean_prev | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
      ------------------+----------------------------------------------------------------
             GDP_PPP_pc |
                    L1. |  -2.28e-09   9.95e-10    -2.29   0.022    -4.24e-09   -3.29e-10
                        |
            _Iyear_2001 |          0  (omitted)
            _Iyear_2002 |   .0145072   .0010388    13.97   0.000     .0124669    .0165474
            _Iyear_2003 |   .0136352   .0009434    14.45   0.000     .0117823    .0154882
            _Iyear_2004 |   .0123409   .0008724    14.15   0.000     .0106274    .0140545
            _Iyear_2005 |   .0112193   .0008063    13.91   0.000     .0096357     .012803
            _Iyear_2006 |     .00999   .0007538    13.25   0.000     .0085096    .0114705
            _Iyear_2007 |   .0083624    .000707    11.83   0.000     .0069737     .009751
            _Iyear_2008 |   .0068532   .0006416    10.68   0.000      .005593    .0081134
            _Iyear_2009 |   .0052991    .000595     8.91   0.000     .0041305    .0064676
            _Iyear_2010 |   .0043683   .0005611     7.79   0.000     .0032663    .0054704
            _Iyear_2011 |   .0037011   .0005181     7.14   0.000     .0026835    .0047187
            _Iyear_2012 |   .0030242   .0004388     6.89   0.000     .0021623    .0038861
            _Iyear_2013 |   .0024491   .0003241     7.56   0.000     .0018126    .0030856
            _Iyear_2014 |    .001748   .0002393     7.31   0.000      .001278    .0022179
            _Iyear_2015 |   .0010987   .0001655     6.64   0.000     .0007736    .0014239
            _Iyear_2016 |    .000934   .0001122     8.32   0.000     .0007136    .0011545
            _Iyear_2017 |          0  (omitted)
      intercourse_young |   .0006827   .0001443     4.73   0.000     .0003992    .0009662
           MC_mean_prev |  -.0237311    .008609    -2.76   0.006    -.0406394   -.0068227
                  _cons |    .020765   .0094452     2.20   0.028     .0022143    .0393156
      ------------------+----------------------------------------------------------------
                sigma_u |  .05794944
                sigma_e |  .00955902
                    rho |  .97351079   (fraction of variance due to u_i)
      -----------------------------------------------------------------------------------
      
      Fixed-effects (within) IV regression            Number of obs     =      9,945
      Group variable: pcode                           Number of groups  =        585
      
      R-squared:                                      Obs per group:
           Within  =      .                                         min =         17
           Between = 0.0001                                         avg =       17.0
           Overall = 0.0013                                         max =         17
      
      
                                                      Wald chi2(18)     =    8809.77
      corr(u_i, Xb) = -0.9120                         Prob > chi2       =     0.0000
      
                                       (Std. err. adjusted for 585 clusters in pcode)
      -------------------------------------------------------------------------------
                    |               Robust
      growth_GDP_~c | Coefficient  std. err.      z    P>|z|     [95% conf. interval]
      --------------+----------------------------------------------------------------
      HIV_mean_prev |   1.169931   .5388254     2.17   0.030     .1138526    2.226009
                    |
         GDP_PPP_pc |
                L1. |  -6.84e-09   5.65e-09    -1.21   0.226    -1.79e-08    4.23e-09
                    |
        _Iyear_2001 |  -.0113497   .0095876    -1.18   0.236     -.030141    .0074416
        _Iyear_2002 |  -.0133502   .0093628    -1.43   0.154    -.0317009    .0050004
        _Iyear_2003 |  -.0103881   .0096831    -1.07   0.283    -.0293667    .0085905
        _Iyear_2004 |   .0346119   .0090814     3.81   0.000     .0168127    .0524111
        _Iyear_2005 |   .0127591   .0076496     1.67   0.095    -.0022338    .0277519
        _Iyear_2006 |   .0119533   .0068143     1.75   0.079    -.0014025    .0253091
        _Iyear_2007 |   .0170139   .0060632     2.81   0.005     .0051302    .0288976
        _Iyear_2008 |    .003268    .005477     0.60   0.551    -.0074667    .0140026
        _Iyear_2009 |  -.0041081   .0041524    -0.99   0.322    -.0122466    .0040303
        _Iyear_2010 |   .0214887   .0037074     5.80   0.000     .0142224    .0287549
        _Iyear_2011 |   .0108508   .0031416     3.45   0.001     .0046934    .0170083
        _Iyear_2012 |   .0109207   .0027969     3.90   0.000     .0054389    .0164026
        _Iyear_2013 |   .0003144   .0046848     0.07   0.946    -.0088677    .0094965
        _Iyear_2014 |    .010545   .0019608     5.38   0.000      .006702    .0143881
        _Iyear_2015 |   .0005979   .0008697     0.69   0.492    -.0011066    .0023024
        _Iyear_2016 |   .0004288   .0004465     0.96   0.337    -.0004463     .001304
        _Iyear_2017 |          0  (omitted)
              _cons |  -.0529305   .0268426    -1.97   0.049     -.105541     -.00032
      --------------+----------------------------------------------------------------
            sigma_u |  .07681249
            sigma_e |  .05178834
                rho |  .68748865   (fraction of variance due to u_i)
      -------------------------------------------------------------------------------
      Instrumented: HIV_mean_prev
       Instruments: L.GDP_PPP_pc _Iyear_2001 _Iyear_2002 _Iyear_2003 _Iyear_2004
                    _Iyear_2005 _Iyear_2006 _Iyear_2007 _Iyear_2008 _Iyear_2009
                    _Iyear_2010 _Iyear_2011 _Iyear_2012 _Iyear_2013 _Iyear_2014
                    _Iyear_2015 _Iyear_2016 intercourse_young MC_mean_prev
      r; t=0.95 17:32:27
      
      . xtoverid
      o. operator not allowed
      r(101); t=0.02 17:32:31
      Do you have any ideas?

      Comment


      • #4
        Michael:
        in this case you should remove the omitted variable manually.
        Kind regards,
        Carlo
        (StataNow 18.5)

        Comment

        Working...
        X