Announcement

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

  • LSDV, problem with dummy variables and significance

    Hello,

    my data: panel data, 260 observations; 20 Regions and time period: 2004 to 2016.

    I have found endogeneity between corruption and GDP growth and I have chosen FE over RE because of the results of the Hausman test. Also, I chose LSDV over FE-2SLS because I would like to see the dummy coefficients.

    Hence, I am running a LSDV model where I want to see the effect that the Corruption level (coded as Cor) of each Region(coded as countrynum) has on Y(which is GDP growth rate).

    I do not understand why the model is significant with i.countrynum, but it becomes insignificant when I include i.Year. Also, when using i.countrynum, why would my variable of corruption become insignificant when I use log(corruption) instead of Corruption?

    Also, I have run testparm on i.countrynum and i.year and the p values are close to 0.

    Code:
     . reg  Y I logYlevel_1 n H Cor i.countrynum, robust
    
    Linear regression                               Number of obs     =        240
                                                    F(24, 215)        =       4.04
                                                    Prob > F          =     0.0000
                                                    R-squared         =     0.2233
                                                    Root MSE          =     .02424
    
    ------------------------------------------------------------------------------
                 |               Robust
               Y |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
    -------------+----------------------------------------------------------------
               I |   .0421328   .0235268     1.79   0.075      -.00424    .0885055
     logYlevel_1 |  -.2725869   .0477639    -5.71   0.000    -.3667323   -.1784415
               n |  -.0011075   .0002068    -5.36   0.000    -.0015151      -.0007
               H |  -.5249337   .1279176    -4.10   0.000     -.777067   -.2728005
             Cor |   152.1827     43.705     3.48   0.001     66.03756    238.3279
                 |
      countrynum |
              2  |  -.0568746    .018295    -3.11   0.002     -.092935   -.0208142
              3  |  -.1177966   .0196517    -5.99   0.000    -.1565313    -.079062
              4  |   -.132077   .0269762    -4.90   0.000    -.1852487   -.0789053
              5  |   .0762482   .0194006     3.93   0.000     .0380084    .1144879
              6  |   .0528407   .0149889     3.53   0.001     .0232966    .0823847
              7  |   .0857303   .0238629     3.59   0.000     .0386951    .1327655
              8  |   .0685547   .0154954     4.42   0.000     .0380124     .099097
              9  |   .0485808   .0342438     1.42   0.157    -.0189157    .1160773
             10  |   .0277995     .01135     2.45   0.015     .0054279    .0501711
             11  |  -.0446546   .0128474    -3.48   0.001    -.0699775   -.0193316
             12  |   .0164898   .0176551     0.93   0.351    -.0183094     .051289
             13  |   -.129616   .0228253    -5.68   0.000    -.1746061    -.084626
             14  |  -.0697799   .0127563    -5.47   0.000    -.0949234   -.0446365
             15  |  -.1306724   .0235665    -5.54   0.000    -.1771235   -.0842214
             16  |   .0428457   .0137236     3.12   0.002     .0157956    .0698958
             17  |   .1167549    .021726     5.37   0.000     .0739316    .1595782
             18  |   .0173388   .0115789     1.50   0.136    -.0054839    .0401616
             19  |   .0970503   .0240081     4.04   0.000     .0497288    .1443717
             20  |   .0306902   .0163222     1.88   0.061    -.0014819    .0628623
                 |
           _cons |   2.812614   .4884072     5.76   0.000     1.849934    3.775293
    ------------------------------------------------------------------------------
    Code:
    . reg  Y I logYlevel_1 n H logCor i.countrynum,robust
    
    Linear regression                               Number of obs     =        225
                                                    F(24, 200)        =       4.83
                                                    Prob > F          =     0.0000
                                                    R-squared         =     0.2391
                                                    Root MSE          =      .0232
    
    ------------------------------------------------------------------------------
                 |               Robust
               Y |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
    -------------+----------------------------------------------------------------
               I |   .0438102    .023208     1.89   0.061    -.0019535    .0895738
     logYlevel_1 |  -.2952572   .0474944    -6.22   0.000    -.3889112   -.2016031
               n |  -.0010141   .0001769    -5.73   0.000     -.001363   -.0006652
               H |  -.5967442   .1222761    -4.88   0.000      -.83786   -.3556284
          logCor |  -.0001871    .002452    -0.08   0.939    -.0050222     .004648
                 |
      countrynum |
              2  |  -.0776557   .0163377    -4.75   0.000     -.109872   -.0454395
              3  |  -.1267072   .0195275    -6.49   0.000    -.1652135   -.0882009
              4  |  -.1387356   .0270324    -5.13   0.000    -.1920407   -.0854305
              5  |   .0833008   .0189025     4.41   0.000      .046027    .1205746
              6  |   .0572389   .0149254     3.83   0.000     .0278075    .0866703
              7  |   .0958031   .0238787     4.01   0.000     .0487167    .1428895
              8  |   .0765805   .0158141     4.84   0.000     .0453967    .1077642
              9  |   .0565331   .0340127     1.66   0.098    -.0105365    .1236026
             10  |    .030444    .011336     2.69   0.008     .0080905    .0527975
             11  |  -.0304818   .0129706    -2.35   0.020    -.0560585   -.0049051
             12  |   .0196087   .0175451     1.12   0.265    -.0149885    .0542058
             13  |   -.139783   .0227806    -6.14   0.000    -.1847039   -.0948621
             14  |  -.0761153   .0127299    -5.98   0.000    -.1012175   -.0510132
             15  |  -.1402884   .0235798    -5.95   0.000    -.1867854   -.0937915
             16  |   .0473936   .0139128     3.41   0.001      .019959    .0748281
             17  |   .1254732    .021914     5.73   0.000      .082261    .1686854
             18  |   .0189846   .0122194     1.55   0.122    -.0051108    .0430799
             19  |   .1095675   .0269841     4.06   0.000     .0563576    .1627774
             20  |   .0338714   .0162419     2.09   0.038     .0018441    .0658987
                 |
           _cons |   3.049778   .4834469     6.31   0.000     2.096471    4.003085
    ------------------------------------------------------------------------------
    Code:
    . reg  Y I logYlevel_1 n H Cor i.countrynum i.Year, robust
    
    Linear regression                               Number of obs     =        240
                                                    F(35, 204)        =      19.07
                                                    Prob > F          =     0.0000
                                                    R-squared         =     0.7447
                                                    Root MSE          =     .01427
    
    ------------------------------------------------------------------------------
                 |               Robust
               Y |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
    -------------+----------------------------------------------------------------
               I |  -.0017374   .0152018    -0.11   0.909    -.0317101    .0282353
     logYlevel_1 |  -.1344197    .043968    -3.06   0.003    -.2211097   -.0477297
               n |  -.0000933   .0003057    -0.31   0.761    -.0006961    .0005095
               H |   .1089849   .1461164     0.75   0.457     -.179107    .3970768
             Cor |   42.22968   27.68753     1.53   0.129    -12.36074    96.82009
                 |
      countrynum |
              2  |  -.0151863   .0160518    -0.95   0.345     -.046835    .0164625
              3  |  -.0482293   .0157838    -3.06   0.003    -.0793496    -.017109
              4  |  -.0381451   .0174077    -2.19   0.030    -.0724672    -.003823
              5  |   .0448873   .0187381     2.40   0.018     .0079421    .0818325
              6  |   .0300398   .0107687     2.79   0.006     .0088075    .0512721
              7  |   .0336804   .0214411     1.57   0.118    -.0085941     .075955
              8  |   .0259668    .011634     2.23   0.027     .0030284    .0489052
              9  |   .0567836   .0316731     1.79   0.074     -.005665    .1192323
             10  |   .0101893   .0064318     1.58   0.115    -.0024919    .0228706
             11  |  -.0263025   .0101509    -2.59   0.010    -.0463165   -.0062884
             12  |   .0268867   .0158145     1.70   0.091    -.0042941    .0580675
             13  |  -.0394516   .0159554    -2.47   0.014    -.0709102    -.007993
             14  |  -.0212305   .0097003    -2.19   0.030    -.0403562   -.0021048
             15  |  -.0406477   .0160236    -2.54   0.012    -.0722408   -.0090546
             16  |    .026545   .0117709     2.26   0.025     .0033367    .0497533
             17  |   .0621137   .0196756     3.16   0.002       .02332    .1009073
             18  |  -.0060011   .0064424    -0.93   0.353    -.0187033     .006701
             19  |    .049247   .0188249     2.62   0.010     .0121307    .0863634
             20  |   .0361759   .0169272     2.14   0.034     .0028012    .0695507
                 |
            Year |
           2006  |   .0145628   .0034744     4.19   0.000     .0077125    .0214131
           2007  |   .0062804   .0040101     1.57   0.119    -.0016263     .014187
           2008  |  -.0235486    .005161    -4.56   0.000    -.0337243    -.013373
           2009  |  -.0631985   .0054573   -11.58   0.000    -.0739584   -.0524386
           2010  |  -.0056302   .0071231    -0.79   0.430    -.0196746    .0084142
           2011  |  -.0116207   .0053297    -2.18   0.030     -.022129   -.0011123
           2012  |  -.0420052    .006943    -6.05   0.000    -.0556944   -.0283159
           2013  |  -.0412766   .0104555    -3.95   0.000    -.0618912   -.0206619
           2014  |  -.0257527   .0091024    -2.83   0.005    -.0436995   -.0078059
           2015  |  -.0074938   .0120268    -0.62   0.534    -.0312067    .0162191
           2016  |  -.0120389   .0093528    -1.29   0.199    -.0304795    .0064017
                 |
           _cons |   1.349846   .4464339     3.02   0.003     .4696303    2.230063
    ------------------------------------------------------------------------------
    Code:
     reg  Y I logYlevel_1 n H Cor  i.Year, robust
    
    Linear regression                               Number of obs     =        240
                                                    F(16, 223)        =      36.46
                                                    Prob > F          =     0.0000
                                                    R-squared         =     0.7030
                                                    Root MSE          =     .01472
    
    ------------------------------------------------------------------------------
                 |               Robust
               Y |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
    -------------+----------------------------------------------------------------
               I |   .0002541   .0022204     0.11   0.909    -.0041216    .0046298
     logYlevel_1 |   .0047408   .0051855     0.91   0.362    -.0054781    .0149596
               n |  -.0002482   .0002666    -0.93   0.353    -.0007736    .0002772
               H |  -.0516428   .0513114    -1.01   0.315    -.1527602    .0494745
             Cor |   .9710216   20.83673     0.05   0.963    -40.09107    42.03312
                 |
            Year |
           2006  |   .0150445   .0029372     5.12   0.000     .0092562    .0208328
           2007  |   .0066831   .0030496     2.19   0.029     .0006734    .0126929
           2008  |  -.0241049   .0040395    -5.97   0.000    -.0320654   -.0161444
           2009  |  -.0608203   .0044387   -13.70   0.000    -.0695674   -.0520731
           2010  |   .0056591   .0052307     1.08   0.280    -.0046489    .0159672
           2011  |  -.0011653   .0038145    -0.31   0.760    -.0086823    .0063518
           2012  |  -.0292677   .0043704    -6.70   0.000    -.0378802   -.0206552
           2013  |  -.0219385   .0081194    -2.70   0.007     -.037939    -.005938
           2014  |  -.0047909   .0041872    -1.14   0.254    -.0130425    .0034608
           2015  |   .0144844   .0063197     2.29   0.023     .0020304    .0269385
           2016  |   .0083592   .0044414     1.88   0.061    -.0003933    .0171117
                 |
           _cons |  -.0385648   .0492351    -0.78   0.434    -.1355904    .0584608
    ------------------------------------------------------------------------------
    Last edited by Simona Battipaglia; 01 Mar 2019, 11:07.

  • #2
    Simona:
    if -hausman- outcome pointed you to -fe-, OLS estimates are inconsistent, as -fe- specification (unlike OLS and -re- specification) allows correlation between the vector of regressors and the indfividual error term.
    As you have a N>T panel dataset, you can deal with endogeneity (I guess that you have a reverse causation problem, in that an increase in GDP can contribute to explain an increased corruption rate) via -xtivreg-.
    Last edited by Carlo Lazzaro; 01 Mar 2019, 11:13.
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      Hello Carlo, thank you for the prompt reply.

      Shouldn't -fe- and OLS with dummy variables lead to the same set of results? I was reading that to employ -fe- one could either use 'within' or 'between' estimations; or ordinary least squares with dummies.

      Comment


      • #4
        Simona:
        -fe- specification focuses on the within variation only.
        Yes, you can use LSDV (but you would be more comfortable with -areg-) instead of -xtreg,fe-.
        If you compared -xtreg, fe- to -areg-, you would find the same point estimates but different cluster-robust standard errors, because -xtreg- fe is devised for N>T (and this seems to be your case), whereas -areg- consider the cross-sectional dimension as fixed and the T dimension as unbounded (ie, it can go to infinity):
        Code:
        use "http://www.stata-press.com/data/r15/nlswork.dta"
        
        . xtreg ln_wage age grade, fe vce(cluster idcode)
        note: grade omitted because of collinearity
        
        Fixed-effects (within) regression               Number of obs     =     28,508
        Group variable: idcode                          Number of groups  =      4,708
        
        R-sq:                                           Obs per group:
             within  = 0.1026                                         min =          1
             between = 0.0879                                         avg =        6.1
             overall = 0.0774                                         max =         15
        
                                                        F(1,4707)         =     884.05
        corr(u_i, Xb)  = 0.0314                         Prob > F          =     0.0000
        
                                     (Std. Err. adjusted for 4,708 clusters in idcode)
        ------------------------------------------------------------------------------
                     |               Robust
             ln_wage |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
        -------------+----------------------------------------------------------------
                 age |   .0181349   .0006099    29.73   0.000     .0169392    .0193306
               grade |          0  (omitted)
               _cons |   1.148225   .0177149    64.82   0.000     1.113496    1.182955
        -------------+----------------------------------------------------------------
             sigma_u |  .40637763
             sigma_e |  .30349389
                 rho |  .64195114   (fraction of variance due to u_i)
        ------------------------------------------------------------------------------
        
        . areg ln_wage age grade, absorb(idcode) vce(cluster idcode)
        note: grade omitted because of collinearity
        
        Linear regression, absorbing indicators         Number of obs     =     28,508
        Absorbed variable: idcode                       No. of categories =      4,708
                                                        F(   1,   4707)   =     738.07
                                                        Prob > F          =     0.0000
                                                        R-squared         =     0.6636
                                                        Adj R-squared     =     0.5971
                                                        Root MSE          =     0.3035
        
                                     (Std. Err. adjusted for 4,708 clusters in idcode)
        ------------------------------------------------------------------------------
                     |               Robust
             ln_wage |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
        -------------+----------------------------------------------------------------
                 age |   .0181349   .0006675    27.17   0.000     .0168262    .0194436
               grade |          0  (omitted)
               _cons |   1.148225   .0193878    59.22   0.000     1.110216    1.186234
        ------------------------------------------------------------------------------
        
        .
        In sum, I would not trade -xtreg, fe- for LSDV for your research.
        Kind regards,
        Carlo
        (Stata 19.0)

        Comment


        • #5
          Yes, in my case N and T are fixed and N>T, as I have 20 Regions and 12 years.

          However, my main problem with -xtreg,fe- is that it will not give me any regional dummies: I wish to see the effect that each corruption level has on GDP according to the region considered. xtreg,fe will only give me a coefficient for corruption, not allowing me to carry out any region-specific analysis.

          Is there a way to circumvent this limitation using -xtreg,fe-?

          Comment


          • #6
            Simona:
            if you -xtset- your data with -countrynum- as your -panelvar- there's no way to get what you're after with -xtreg-.
            However, I would test whether -i.region- is actually jointly siginificant via -testparm-.
            I would also check whethe any difference in standard errors come alive replacing -vce(cluster countrynum)- vs -robust-.
            Kind regards,
            Carlo
            (Stata 19.0)

            Comment


            • #7
              Countruynum is the name I assigned to Region in my STATA dataset.

              Yes, i.Region is jointly significant with -testparm-. Also, this is the result of using -vce(cluster countrynum)- vs -robust- :

              Code:
              . reg  Y I logYlevel_1 n H logCor i.countrynum i.Year, vce(cluster countrynum)
              
              Linear regression                               Number of obs     =        225
                                                              F(15, 19)         =          .
                                                              Prob > F          =          .
                                                              R-squared         =     0.8060
                                                              Root MSE          =     .01205
              
                                          (Std. Err. adjusted for 20 clusters in countrynum)
              ------------------------------------------------------------------------------
                           |               Robust
                         Y |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
              -------------+----------------------------------------------------------------
                         I |    -.00687   .0130774    -0.53   0.605    -.0342413    .0205012
               logYlevel_1 |  -.1637987    .069088    -2.37   0.028    -.3084016   -.0191958
                         n |   -.000445   .0001914    -2.32   0.031    -.0008457   -.0000443
                         H |   .1631749   .1458059     1.12   0.277    -.1420003    .4683501
                    logCor |  -.0002807   .0013247    -0.21   0.834    -.0030534    .0024919
                           |
                countrynum |
                        2  |  -.0369487   .0119648    -3.09   0.006    -.0619913   -.0119062
                        3  |  -.0574128    .022403    -2.56   0.019    -.1043029   -.0105227
                        4  |  -.0399012   .0220189    -1.81   0.086    -.0859872    .0061848
                        5  |   .0586012   .0211458     2.77   0.012     .0143426    .1028598
                        6  |   .0362731    .016201     2.24   0.037     .0023641    .0701822
                        7  |   .0484423   .0220126     2.20   0.040     .0023694    .0945151
                        8  |   .0314022   .0165094     1.90   0.072    -.0031524    .0659569
                        9  |   .0789674    .027515     2.87   0.010     .0213778     .136557
                       10  |   .0132492   .0080055     1.66   0.114    -.0035064    .0300049
                       11  |   -.023504    .007107    -3.31   0.004     -.038379   -.0086289
                       12  |   .0376311    .014412     2.61   0.017     .0074665    .0677958
                       13  |  -.0444245   .0213328    -2.08   0.051    -.0890745    .0002255
                       14  |  -.0241366   .0098121    -2.46   0.024    -.0446736   -.0035997
                       15  |  -.0441093    .020928    -2.11   0.049     -.087912   -.0003065
                       16  |   .0352565   .0136266     2.59   0.018     .0067358    .0637772
                       17  |   .0774824   .0315017     2.46   0.024     .0115486    .1434162
                       18  |  -.0063099   .0057191    -1.10   0.284    -.0182802    .0056603
                       19  |   .0747764   .0340542     2.20   0.041     .0035001    .1460527
                       20  |   .0491966   .0177441     2.77   0.012     .0120577    .0863355
                           |
                      Year |
                     2006  |   .0144926   .0031307     4.63   0.000     .0079399    .0210452
                     2007  |   .0079708   .0040212     1.98   0.062    -.0004457    .0163872
                     2008  |   -.023337   .0045414    -5.14   0.000    -.0328424   -.0138317
                     2009  |  -.0650689   .0056674   -11.48   0.000     -.076931   -.0532069
                     2010  |  -.0089428   .0077109    -1.16   0.261    -.0250819    .0071963
                     2011  |  -.0161013   .0065752    -2.45   0.024    -.0298634   -.0023391
                     2012  |  -.0466071   .0082453    -5.65   0.000    -.0638647   -.0293494
                     2013  |  -.0403161   .0094988    -4.24   0.000    -.0601973   -.0204349
                     2014  |  -.0319613   .0100236    -3.19   0.005    -.0529409   -.0109817
                     2015  |  -.0210098   .0115769    -1.81   0.085    -.0452405    .0032209
                     2016  |  -.0208224   .0110433    -1.89   0.075    -.0439363    .0022915
                           |
                     _cons |   1.639096   .6815818     2.40   0.027     .2125288    3.065663
              ------------------------------------------------------------------------------
              I was thinking of creating an interaction variable of i.countrynum##i.Corr to see how corruption affects GDP in each region, but I get the following error:
              Code:
              . reg  Y I logYlevel_1 n H logCor i.countrynum##i.Cor, vce(cluster countrynum)
              Cor:  factor variables may not contain noninteger values

              Also, my other option was fe-2sls with IV, but how can I include regional dummies here?
              Code:
              . xtivreg  Y  I logYlevel_1 n H (Cor=Cor_1), fe vce (robust)
              
              Fixed-effects (within) IV regression            Number of obs     =        240
              Group variable: countrynum                      Number of groups  =         20
              
              R-sq:                                           Obs per group:
                   within  = 0.0580                                         min =         12
                   between = 0.0025                                         avg =       12.0
                   overall = 0.0031                                         max =         12
              
              
                                                              Wald chi2(5)      =      60.43
              corr(u_i, Xb)  = -0.9829                        Prob > chi2       =     0.0000
              
                                          (Std. Err. adjusted for 20 clusters in countrynum)
              ------------------------------------------------------------------------------
                           |               Robust
                         Y |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
              -------------+----------------------------------------------------------------
                       Cor |    684.125   424.5716     1.61   0.107    -148.0199     1516.27
                         I |   .0538684   .0297298     1.81   0.070    -.0044009    .1121378
               logYlevel_1 |  -.3220061   .0492637    -6.54   0.000    -.4185612   -.2254509
                         n |  -.0011211   .0002102    -5.33   0.000    -.0015331   -.0007092
                         H |   -.525527   .1906069    -2.76   0.006    -.8991097   -.1519443
                     _cons |   3.302093   .5097957     6.48   0.000     2.302912    4.301274
              -------------+----------------------------------------------------------------
                   sigma_u |  .09488182
                   sigma_e |  .02628081
                       rho |  .92874613   (fraction of variance due to u_i)
              ------------------------------------------------------------------------------
              Instrumented:   Cor
              Instruments:    I logYlevel_1 n H Cor_1
              ------------------------------------------------------------------------------

              Comment


              • #8
                Simona:
                - impose vce(cluster countrynum)- standard errors instead of -robust- (in your case, the latter accounts for heteroskedasticity only);
                - the error message Stata gave you back highlights that -Corr- is a continuous variable: hence, the right prefix for interaction is -c.Corr-;
                - you cannot add -i.countrynum- in -xtivreg-.
                Kind regards,
                Carlo
                (Stata 19.0)

                Comment


                • #9
                  Thank you a lot, this solves my issues. Last quick questions:
                  (Code 1) Why do you think it does not give me the F value and it says that Cor_1 was omitted due to collinearity?
                  (Code 2) When I use logCor_1 do you think I should also use i.countrynum##log.Cor_1 as an interaction variable? (i.e. taking the log of Cor_1 in the interaction variable too).

                  CODE 1:
                  Code:
                   .. reg  Y I logYlevel_1 n H Cor_1 i.countrynum##c.Cor_1, vce(cluster countrynum)
                  note: Cor_1 omitted because of collinearity
                  
                  Linear regression                               Number of obs     =        240
                                                                  F(3, 19)          =          .
                                                                  Prob > F          =          .
                                                                  R-squared         =     0.2637
                                                                  Root MSE          =     .02472
                  
                                                    (Std. Err. adjusted for 20 clusters in countrynum)
                  ------------------------------------------------------------------------------------
                                     |               Robust
                                   Y |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
                  -------------------+----------------------------------------------------------------
                                   I |   .0365884   .0306241     1.19   0.247    -.0275086    .1006855
                         logYlevel_1 |  -.2474381   .0467237    -5.30   0.000    -.3452321   -.1496442
                                   n |  -.0011733   .0002165    -5.42   0.000    -.0016263   -.0007202
                                   H |  -.4874395   .1834852    -2.66   0.016    -.8714785   -.1034006
                               Cor_1 |  -161.4213   142.4776    -1.13   0.271    -459.6302    136.7877
                                     |
                          countrynum |
                                  2  |  -.0501705   .0129413    -3.88   0.001    -.0772568   -.0230841
                                  3  |  -.0898434   .0179068    -5.02   0.000    -.1273228   -.0523641
                                  4  |  -.0968075   .0288289    -3.36   0.003    -.1571472   -.0364678
                                  5  |   .0680847   .0224992     3.03   0.007     .0209934     .115176
                                  6  |    .053158   .0098136     5.42   0.000     .0326179    .0736981
                                  7  |   .0795701   .0291519     2.73   0.013     .0185545    .1405856
                                  8  |   .0618069   .0151432     4.08   0.001     .0301118    .0935021
                                  9  |   .0476486    .043157     1.10   0.283    -.0426801    .1379773
                                 10  |   .0137737   .0058058     2.37   0.028     .0016219    .0259254
                                 11  |   -.038588   .0095693    -4.03   0.001    -.0586167   -.0185593
                                 12  |  -.0179813   .0192962    -0.93   0.363    -.0583688    .0224062
                                 13  |  -.1142631   .0228427    -5.00   0.000    -.1620734   -.0664527
                                 14  |   -.057898   .0124624    -4.65   0.000     -.083982    -.031814
                                 15  |  -.1203658   .0236727    -5.08   0.000    -.1699133   -.0708183
                                 16  |   .0594621   .0128023     4.64   0.000     .0326666    .0862576
                                 17  |   .1069109   .0192747     5.55   0.000     .0665685    .1472534
                                 18  |   .0091617   .0060297     1.52   0.145    -.0034586    .0217819
                                 19  |   .0830108   .0219416     3.78   0.001     .0370865     .128935
                                 20  |   .0416802   .0178126     2.34   0.030     .0043979    .0789625
                                     |
                               Cor_1 |          0  (omitted)
                                     |
                  countrynum#c.Cor_1 |
                                  2  |  -356.0312   116.0747    -3.07   0.006    -598.9783   -113.0841
                                  3  |  -3658.799   320.8234   -11.40   0.000    -4330.291   -2987.308
                                  4  |  -820.2335   102.1209    -8.03   0.000    -1033.975    -606.492
                                  5  |   534.9296   340.5779     1.57   0.133    -177.9082    1247.767
                                  6  |  -852.6263   198.9749    -4.29   0.000    -1269.086   -436.1671
                                  7  |   164.5561    355.334     0.46   0.649    -579.1665    908.2788
                                  8  |   113.5844   176.6486     0.64   0.528    -256.1454    483.3141
                                  9  |   154.8111   454.0002     0.34   0.737    -795.4222    1105.044
                                 10  |   2414.596   201.0459    12.01   0.000     1993.803     2835.39
                                 11  |   100.7837    133.044     0.76   0.458    -177.6806    379.2481
                                 12  |   4110.705   471.6797     8.72   0.000     3123.468    5097.942
                                 13  |  -570.4537   235.2751    -2.42   0.025     -1062.89   -78.01729
                                 14  |   -2344.33    420.936    -5.57   0.000    -3225.359   -1463.301
                                 15  |    271.184   194.0802     1.40   0.178    -135.0306    677.3986
                                 16  |  -2941.497   247.8525   -11.87   0.000    -3460.258   -2422.735
                                 17  |   120.5839   127.1993     0.95   0.355    -145.6474    386.8152
                                 18  |   773.0106   129.9175     5.95   0.000     501.0902    1044.931
                                 19  |   484.8941   96.97564     5.00   0.000     281.9218    687.8664
                                 20  |  -2484.266   335.0651    -7.41   0.000    -3185.565   -1782.966
                                     |
                               _cons |   2.557116   .4842542     5.28   0.000      1.54356    3.570672
                  ------------------------------------------------------------------------------------
                  CODE 2:
                  Code:
                   reg  Y I logYlevel_1 n H logCor_1 i.countrynum##c.logCor_1, vce(cluster countrynum)
                  note: logCor_1 omitted because of collinearity
                  
                  Linear regression                               Number of obs     =        226
                                                                  F(3, 19)          =          .
                                                                  Prob > F          =          .
                                                                  R-squared         =     0.2904
                                                                  Root MSE          =     .02463
                  
                                                       (Std. Err. adjusted for 20 clusters in countrynum)
                  ---------------------------------------------------------------------------------------
                                        |               Robust
                                      Y |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
                  ----------------------+----------------------------------------------------------------
                                      I |   .0506965   .0350493     1.45   0.164    -.0226625    .1240556
                            logYlevel_1 |  -.2943968   .0416382    -7.07   0.000    -.3815466   -.2072471
                                      n |  -.0010865   .0001631    -6.66   0.000    -.0014279   -.0007451
                                      H |  -.5479755   .1808103    -3.03   0.007    -.9264158   -.1695352
                               logCor_1 |  -.0057792   .0007038    -8.21   0.000    -.0072522   -.0043062
                                        |
                             countrynum |
                                     2  |  -.0472431   .0145622    -3.24   0.004    -.0777221    -.016764
                                     3  |  -.2925413   .0302311    -9.68   0.000    -.3558158   -.2292668
                                     4  |  -.3686013   .0133137   -27.69   0.000    -.3964671   -.3407355
                                     5  |   .2279211   .0205634    11.08   0.000     .1848813    .2709609
                                     6  |     .05094   .0248068     2.05   0.054    -.0009813    .1028612
                                     7  |   .2429294   .0639263     3.80   0.001     .1091301    .3767286
                                     8  |   .1003123   .0264645     3.79   0.001     .0449215    .1557032
                                     9  |   .0741503   .1273079     0.58   0.567    -.1923081    .3406087
                                    10  |   .1708723   .0159277    10.73   0.000     .1375353    .2042092
                                    11  |  -.0341304    .010389    -3.29   0.004    -.0558748    -.012386
                                    12  |   .3522598   .0445858     7.90   0.000     .2589407     .445579
                                    13  |  -.1609149   .0359776    -4.47   0.000    -.2362169   -.0856129
                                    14  |  -.0897557   .0147461    -6.09   0.000    -.1206197   -.0588916
                                    15  |  -.0896273   .0364351    -2.46   0.024    -.1658868   -.0133678
                                    16  |  -.0582273   .0266446    -2.19   0.042    -.1139951   -.0024594
                                    17  |   .1704991   .0169546    10.06   0.000     .1350128    .2059854
                                    18  |   .1172656   .0161991     7.24   0.000     .0833605    .1511707
                                    19  |   .3745472   .0236577    15.83   0.000     .3250312    .4240633
                                    20  |  -.0704424   .0293545    -2.40   0.027    -.1318821   -.0090026
                                        |
                               logCor_1 |          0  (omitted)
                                        |
                  countrynum#c.logCor_1 |
                                     2  |   .0013363   .0001116    11.97   0.000     .0011027      .00157
                                     3  |  -.0135285   .0017291    -7.82   0.000    -.0171477   -.0099094
                                     4  |  -.0216534   .0017192   -12.60   0.000    -.0252518   -.0180551
                                     5  |   .0119273   .0020235     5.89   0.000      .007692    .0161626
                                     6  |  -.0006912   .0015474    -0.45   0.660    -.0039299    .0025475
                                     7  |   .0128436   .0060754     2.11   0.048     .0001277    .0255595
                                     8  |   .0017106   .0023657     0.72   0.478    -.0032408     .006662
                                     9  |    .001879   .0075943     0.25   0.807     -.014016     .017774
                                    10  |   .0111726   .0011292     9.89   0.000     .0088091    .0135361
                                    11  |  -.0006734   .0012131    -0.56   0.585    -.0032125    .0018657
                                    12  |   .0282086    .004046     6.97   0.000     .0197403     .036677
                                    13  |  -.0018572   .0018343    -1.01   0.324    -.0056965    .0019821
                                    14  |  -.0010436   .0010634    -0.98   0.339    -.0032693    .0011821
                                    15  |   .0041497   .0013614     3.05   0.007     .0013002    .0069992
                                    16  |  -.0088771   .0015855    -5.60   0.000    -.0121956   -.0055586
                                    17  |   .0034638   .0007358     4.71   0.000     .0019237    .0050039
                                    18  |   .0077117   .0009826     7.85   0.000     .0056551    .0097683
                                    19  |   .0230985   .0006079    38.00   0.000     .0218261    .0243708
                                    20  |  -.0083791     .00161    -5.20   0.000    -.0117488   -.0050094
                                        |
                                  _cons |   2.961356   .4268072     6.94   0.000     2.068038    3.854674
                  ---------------------------------------------------------------------------------------

                  Comment


                  • #10
                    Simona:
                    -the answer to your first question is reported in -help j_robustsingular-:

                    Are you using a svy estimator or did you specify the vce(cluster clustvar) option?

                    The VCE you have just estimated is not of sufficient rank to perform the model test. As discussed in [R] test, the model test with clustered or survey data is distributed as
                    F(k,d-k+1) or chi2(k), where k is the number of constraints and d=number of clusters or d=number of PSUs minus the number of strata. Because the rank of the VCE is at most d and
                    the model test reserves 1 degree of freedom for the constant, at most d-1 constraints can be tested, so k must be less than d. The model that you just fit does not meet this
                    requirement.
                    - as far as your second question is concerned, your code #2 can be made more compact:
                    Code:
                    reg  Y I logYlevel_1 n H i.countrynum##c.logCor_1, vce(cluster countrynum)
                    *-logCor_1- is redundant, as it is already included in the -fvvarlist- notation that will automatically report the interaction along with the conditional main effect of the predictors included in the interaction*
                    As it is Always the case, log-transforming comes at the cost of back-transforming on the original scale (or explain your results in a meaningful way despite the transformation).
                    Kind regards,
                    Carlo
                    (Stata 19.0)

                    Comment


                    • #11
                      Unfortunately, I cannot find -help j_robustsingular- in STATA 14 or on Google.

                      I am not using survey data, but only vce(cluster countrynum). I understand that I have not enough degrees of freedom to perform an F test, but I think that I cannot remove vce(cluster countrynum) as this has basically solved all the problems I had with my model. However, is there a way to circumvent this issue (e.g. a proxy test for the normal F-test or a similar command to -vce(cluster clustvar)-?

                      Otherwise, if there is no way to avoid this problem, would you personally use such a model without being able to check it through an F test?

                      also, this may be of help to answer the last question:
                      Code:
                      . testparm i.countrynum#c.Cor_1
                      
                       ( 1)  1b.countrynum#c.Cor_1 = 0
                       ( 2)  2.countrynum#c.Cor_1 = 0
                       ( 3)  3.countrynum#c.Cor_1 = 0
                       ( 4)  4.countrynum#c.Cor_1 = 0
                       ( 5)  5.countrynum#c.Cor_1 = 0
                       ( 6)  6.countrynum#c.Cor_1 = 0
                       ( 7)  7.countrynum#c.Cor_1 = 0
                       ( 8)  8.countrynum#c.Cor_1 = 0
                       ( 9)  9.countrynum#c.Cor_1 = 0
                       (10)  10.countrynum#c.Cor_1 = 0
                       (11)  11.countrynum#c.Cor_1 = 0
                       (12)  12.countrynum#c.Cor_1 = 0
                       (13)  13.countrynum#c.Cor_1 = 0
                       (14)  14.countrynum#c.Cor_1 = 0
                       (15)  15.countrynum#c.Cor_1 = 0
                       (16)  16.countrynum#c.Cor_1 = 0
                       (17)  17.countrynum#c.Cor_1 = 0
                       (18)  18.countrynum#c.Cor_1 = 0
                       (19)  19.countrynum#c.Cor_1 = 0
                       (20)  20.countrynum#c.Cor_1 = 0
                             Constraint 1 dropped
                             Constraint 2 dropped
                             Constraint 4 dropped
                             Constraint 5 dropped
                             Constraint 6 dropped
                             Constraint 8 dropped
                             Constraint 9 dropped
                             Constraint 11 dropped
                             Constraint 12 dropped
                             Constraint 13 dropped
                             Constraint 15 dropped
                             Constraint 16 dropped
                             Constraint 17 dropped
                             Constraint 18 dropped
                             Constraint 19 dropped
                      
                             F(  5,    19) =   21.70
                                  Prob > F =    0.0000
                      Last edited by Simona Battipaglia; 02 Mar 2019, 05:44.

                      Comment


                      • #12
                        Simona:
                        - you will surely be able to find
                        Code:
                        j_robustsingular
                        Just copy and paste it in Stata Command window (pleaase note that on this list starting and ending hyphens are usually used to separate a given code or variable from text).

                        You should not remove -vce(cluster)- option; simply ignore the F-test, and check whether you model is misspecified via
                        Code:
                        estat ovtest
                        Kind regards,
                        Carlo
                        (Stata 19.0)

                        Comment


                        • #13
                          Thank you a lot for your time, your advices were extremely helpful!

                          Comment

                          Working...
                          X