Announcement

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

  • #16
    Dear Sebastian,

    I am sorry because of late response. I have to specify the if year1!=0 because the year that event occurs must be removed from the sample. I wonder this invades any conditions of system GMM?

    I remove the industry dummies, so my code is as follows:

    Code:
    xtabond2 lnTobin L.lnTobin PerFD After AfterFD PerInD Dual bsize lnage Firmsize blev y2001-y2017 if year1!=0, gmm(lnTobin AfterFD PerFD PerInD Dual bsize Firmsize blev,lag(2 3) collapse) iv(After lnage i.year ) small two ro
    Code:
    Dynamic panel-data estimation, two-step system GMM
    ------------------------------------------------------------------------------
    Group variable: firmid                          Number of obs      =       344
    Time variable : year                            Number of groups   =        56
    Number of instruments = 43                      Obs per group: min =         1
    F(26, 55)     =     11.35                                      avg =      6.14
    Prob > F      =     0.000                                      max =         8
    ------------------------------------------------------------------------------
                 |              Corrected
         lnTobin |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
    -------------+----------------------------------------------------------------
         lnTobin |
             L1. |   .4734852   .1297546     3.65   0.001     .2134512    .7335192
                 |
           PerFD |   .5645718   3.363079     0.17   0.867     -6.17519    7.304333
           After |  -.0027537   .4622232    -0.01   0.995    -.9290697    .9235623
         AfterFD |  -.3128727   4.150518    -0.08   0.940    -8.630696    8.004951
          PerInD |  -.1983627   .6952249    -0.29   0.776    -1.591625    1.194899
            Dual |  -.3554203   .3166148    -1.12   0.266    -.9899307      .27909
           bsize |  -.0238799   .4893503    -0.05   0.961     -1.00456       .9568
           lnage |  -.0695415   .0642189    -1.08   0.284     -.198239     .059156
        Firmsize |   .0818586   .0629028     1.30   0.199    -.0442014    .2079186
            blev |  -.3559817   .6415577    -0.55   0.581    -1.641692    .9297286
           y2001 |   .1022979    .290608     0.35   0.726    -.4800937    .6846894
           y2002 |   .0350753   .1996421     0.18   0.861    -.3650165     .435167
           y2003 |   .1023763   .1420151     0.72   0.474    -.1822283     .386981
           y2004 |   .1239395   .1132694     1.09   0.279    -.1030573    .3509364
           y2005 |  -.0250942   .1333774    -0.19   0.851    -.2923884    .2421999
           y2006 |   .0896985   .1292487     0.69   0.491    -.1693217    .3487187
           y2007 |   .1409684   .0799136     1.76   0.083     -.019182    .3011189
           y2008 |  -.2957929   .0979695    -3.02   0.004    -.4921282   -.0994576
           y2010 |   .0729287   .0598755     1.22   0.228    -.0470645     .192922
           y2011 |  -.0455456    .105985    -0.43   0.669    -.2579442    .1668531
           y2012 |   .0167791   .1440798     0.12   0.908    -.2719633    .3055214
           y2013 |   .0371139   .1754091     0.21   0.833    -.3144138    .3886417
           y2014 |  -.0223063   .1416805    -0.16   0.875    -.3062403    .2616277
           y2015 |    .020678   .1324196     0.16   0.876    -.2446967    .2860527
           y2016 |   .0695865   .1330808     0.52   0.603    -.1971133    .3362863
           y2017 |   .2288556   .1426889     1.60   0.114    -.0570994    .5148106
           _cons |  -1.162248   1.807782    -0.64   0.523    -4.785124    2.460628
    ------------------------------------------------------------------------------
    Instruments for first differences equation
      Standard
        D.(After lnage 2000b.year 2001.year 2002.year 2003.year 2004.year
        2005.year 2006.year 2007.year 2008.year 2009.year 2010.year 2011.year
        2012.year 2013.year 2014.year 2015.year 2016.year 2017.year)
      GMM-type (missing=0, separate instruments for each period unless collapsed)
        L(2/3).(lnTobin AfterFD PerFD PerInD Dual bsize Firmsize blev) collapsed
    Instruments for levels equation
      Standard
        After lnage 2000b.year 2001.year 2002.year 2003.year 2004.year 2005.year
        2006.year 2007.year 2008.year 2009.year 2010.year 2011.year 2012.year
        2013.year 2014.year 2015.year 2016.year 2017.year
        _cons
      GMM-type (missing=0, separate instruments for each period unless collapsed)
        DL.(lnTobin AfterFD PerFD PerInD Dual bsize Firmsize blev) collapsed
    ------------------------------------------------------------------------------
    Arellano-Bond test for AR(1) in first differences: z =  -2.64  Pr > z =  0.008
    Arellano-Bond test for AR(2) in first differences: z =   0.75  Pr > z =  0.455
    ------------------------------------------------------------------------------
    Sargan test of overid. restrictions: chi2(16)   =  11.38  Prob > chi2 =  0.785
      (Not robust, but not weakened by many instruments.)
    Hansen test of overid. restrictions: chi2(16)   =  16.58  Prob > chi2 =  0.413
      (Robust, but weakened by many instruments.)
    
    Difference-in-Hansen tests of exogeneity of instrument subsets:
      GMM instruments for levels
        Hansen test excluding group:     chi2(8)    =   7.02  Prob > chi2 =  0.534
        Difference (null H = exogenous): chi2(8)    =   9.56  Prob > chi2 =  0.298
    
    
    .
    Code:
    sum year if e(sample)
    
    Variable | Obs Mean Std. Dev. Min Max
    -------------+--------------------------------------------------------
    year | 344 2009.651 3.825699 2001 2017
    
    .

    My code is right or wrong? Please give me comments. Thank you very much in advance.

    Celine.
    Last edited by Celine Tran; 28 Nov 2018, 20:20.

    Comment


    • #17
      If you really want to exclude the year 2009, then you should specify your time dummies as y2001-y2008 y2010-y2017 (excluding y2009), both in the list of independend variables and instruments. Please also see once again my 3rd point in my comment #7 above.
      https://www.kripfganz.de/stata/

      Comment


      • #18
        Dear Sebastina,

        Thank you. I correct the code as your suggestions. Here is my result.


        Code:
        xtabond2 lnTobin L.lnTobin PerFD After AfterFD PerInD Dual bsize lnage Firmsize blev y2001-y2017 if year1!=0, gmm(lnTobin AfterFD PerFD PerInD Dual bsize Firmsize blev,lag(2 3) equation (diff) collapse) gmm (lnTobin AfterFD PerFD PerInD Dual bsize Firmsize blev, lag (1 1) equation(level) collapse) iv(After lnage i.year ) small two ro
        Code:
        Warning: Two-step estimated covariance matrix of moments is singular.
          Using a generalized inverse to calculate optimal weighting matrix for two-step estimation.
          Difference-in-Sargan/Hansen statistics may be negative.
        
        Dynamic panel-data estimation, two-step system GMM
        ------------------------------------------------------------------------------
        Group variable: firmid                          Number of obs      =       394
        Time variable : year                            Number of groups   =        56
        Number of instruments = 43                      Obs per group: min =         2
        F(26, 55)     =     16.45                                      avg =      7.04
        Prob > F      =     0.000                                      max =         9
        ------------------------------------------------------------------------------
                     |              Corrected
             lnTobin |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
        -------------+----------------------------------------------------------------
             lnTobin |
                 L1. |   .5631121   .1362169     4.13   0.000     .2901273    .8360969
                     |
               PerFD |  -.4183396    .552161    -0.76   0.452    -1.524895    .6882159
               After |  -.0101328   .1141634    -0.09   0.930    -.2389214    .2186558
             AfterFD |   .0187833   .7267292     0.03   0.979    -1.437615    1.475181
              PerInD |  -.1915648   .4737309    -0.40   0.688    -1.140943    .7578131
                Dual |  -.2512437   .1847844    -1.36   0.179      -.62156    .1190726
               bsize |   .0584874   .4193666     0.14   0.890    -.7819421    .8989168
               lnage |  -.0317295    .047689    -0.67   0.509    -.1273004    .0638414
            Firmsize |   .0011959   .0918502     0.01   0.990    -.1828761    .1852679
                blev |  -.2059146   .2428619    -0.85   0.400    -.6926207    .2807915
               y2001 |   .4756964   .2854743     1.67   0.101     -.096407      1.0478
               y2002 |   .2406719   .2241945     1.07   0.288    -.2086239    .6899678
               y2003 |   .2932337    .138493     2.12   0.039     .0156876    .5707798
               y2004 |   .3144981   .1414283     2.22   0.030     .0310695    .5979268
               y2005 |   .2081097   .0961442     2.16   0.035     .0154325    .4007869
               y2006 |   .3419826   .0667122     5.13   0.000     .2082883    .4756768
               y2007 |   .3872177    .064738     5.98   0.000     .2574799    .5169555
               y2009 |   .2473681   .0793398     3.12   0.003     .0883677    .4063685
               y2010 |   .3518446   .0741346     4.75   0.000     .2032756    .5004135
               y2011 |   .2441972   .0631648     3.87   0.000     .1176122    .3707822
               y2012 |   .2824629   .0807788     3.50   0.001     .1205787    .4443472
               y2013 |   .3526933   .0614641     5.74   0.000     .2295165    .4758702
               y2014 |   .2465046   .0829981     2.97   0.004     .0801727    .4128364
               y2015 |   .2762662   .0813318     3.40   0.001     .1132737    .4392587
               y2016 |   .2688194   .0886658     3.03   0.004     .0911292    .4465097
               y2017 |   .4319309   .1159354     3.73   0.000     .1995912    .6642706
               _cons |  -.1038067   1.675446    -0.06   0.951    -3.461475    3.253862
        ------------------------------------------------------------------------------
        Instruments for first differences equation
          Standard
            D.(After lnage 2000b.year 2001.year 2002.year 2003.year 2004.year
            2005.year 2006.year 2007.year 2008.year 2009.year 2010.year 2011.year
            2012.year 2013.year 2014.year 2015.year 2016.year 2017.year)
          GMM-type (missing=0, separate instruments for each period unless collapsed)
            L(2/3).(lnTobin AfterFD PerFD PerInD Dual bsize Firmsize blev) collapsed
        Instruments for levels equation
          Standard
            After lnage 2000b.year 2001.year 2002.year 2003.year 2004.year 2005.year
            2006.year 2007.year 2008.year 2009.year 2010.year 2011.year 2012.year
            2013.year 2014.year 2015.year 2016.year 2017.year
            _cons
          GMM-type (missing=0, separate instruments for each period unless collapsed)
            DL.(lnTobin AfterFD PerFD PerInD Dual bsize Firmsize blev) collapsed
        ------------------------------------------------------------------------------
        Arellano-Bond test for AR(1) in first differences: z =  -3.33  Pr > z =  0.001
        Arellano-Bond test for AR(2) in first differences: z =  -0.97  Pr > z =  0.333
        ------------------------------------------------------------------------------
        Sargan test of overid. restrictions: chi2(16)   =  15.46  Prob > chi2 =  0.491
          (Not robust, but not weakened by many instruments.)
        Hansen test of overid. restrictions: chi2(16)   =  13.21  Prob > chi2 =  0.658
          (Robust, but weakened by many instruments.)
        
        Difference-in-Hansen tests of exogeneity of instrument subsets:
          GMM instruments for levels
            Hansen test excluding group:     chi2(8)    =   8.22  Prob > chi2 =  0.412
            Difference (null H = exogenous): chi2(8)    =   4.99  Prob > chi2 =  0.759
          gmm(lnTobin AfterFD PerFD PerInD Dual bsize Firmsize blev, collapse eq(diff) lag(2 3))
            Hansen test excluding group:     chi2(0)    =   0.00  Prob > chi2 =      .
            Difference (null H = exogenous): chi2(16)   =  13.21  Prob > chi2 =  0.658
          gmm(lnTobin AfterFD PerFD PerInD Dual bsize Firmsize blev, collapse eq(level) lag(1 1))
            Hansen test excluding group:     chi2(8)    =   8.22  Prob > chi2 =  0.412
            Difference (null H = exogenous): chi2(8)    =   4.99  Prob > chi2 =  0.759
        In addition, as I mention earlier, I want to investigate the effect of crisis in my model. However, actually, my event I wanna control is a corporate event, not crisis. I am very sorry about that. At that time, I though it is the same logic and it is easy to explain what I want to do by using crisis as an example. However, yesterday, I realise that because each firm in my sample has different year that event occurs. For example, firm A has the announcement year at 2010, firm B has the announcement year at 2012. And five years before and after the announcement year are collected and pool in the sample. Although my time period is 10 years but calendar year spreads from 2000 to 2017. As a result, I have strong unbalance panel data. Hence, maybe the system GMM does not work with my sample. Also, I can not specify year dummies as your suggestion above

        More importantly, I wonder if I can use panel regression (Pool OLS, Fixed effect) for this sample? Do you have any suggestions? I provide the number of observation for each year.

        Code:
        bysort year: count
        
        ----------------------------------------------------------------------------------------------------------------------------
        -> year = 2000
            2
        ----------------------------------------------------------------------------------------------------------------------------
        -> year = 2001
            5
        ----------------------------------------------------------------------------------------------------------------------------
        -> year = 2002
           14
        ----------------------------------------------------------------------------------------------------------------------------
        -> year = 2003
           16
        ----------------------------------------------------------------------------------------------------------------------------
        -> year = 2004
           24
        ----------------------------------------------------------------------------------------------------------------------------
        -> year = 2005
           34
        ----------------------------------------------------------------------------------------------------------------------------
        -> year = 2006
           41
        ----------------------------------------------------------------------------------------------------------------------------
        -> year = 2007
           48
        ----------------------------------------------------------------------------------------------------------------------------
        -> year = 2008
           46
        ----------------------------------------------------------------------------------------------------------------------------
        -> year = 2009
           52
        ----------------------------------------------------------------------------------------------------------------------------
        -> year = 2010
           53
        ----------------------------------------------------------------------------------------------------------------------------
        -> year = 2011
           42
        ----------------------------------------------------------------------------------------------------------------------------
        -> year = 2012
           43
        ----------------------------------------------------------------------------------------------------------------------------
        -> year = 2013
           33
        ----------------------------------------------------------------------------------------------------------------------------
        -> year = 2014
           29
        ----------------------------------------------------------------------------------------------------------------------------
        -> year = 2015
           24
        ----------------------------------------------------------------------------------------------------------------------------
        -> year = 2016
           15
        ----------------------------------------------------------------------------------------------------------------------------
        -> year = 2017
            8
        
        .

        One again, I am sorry about the wrong information. I look forward to hearing from you.

        Thank you very much in advance.

        Celine.

        Comment


        • #19
          The unbalanced nature of your data set should not be a problem. The 3rd point in my comment #7 was actually primarily related to the specification of the equation() suboption in the iv(After lnage i.year) option.

          Other than that, your test statistics all look fine and I do not see any problem any more.
          https://www.kripfganz.de/stata/

          Comment


          • #20
            Dear Sebastian,

            Thank you very much for your help.

            Regards,
            Celine.

            Comment


            • #21
              Originally posted by Eric de Souza View Post
              This may help you start:
              Stata comes with an built-in command called xtabond for dynamic panel data modelling. The command that we shall use has been developed by David Roodman of the Center for Global Development. It is called xtabond2 which can be downloaded from withing Stata with the command ssc install xtabond2.
              1. Before using xtabond2 do not forget to xtset your data:
              xtset panelid timeseriesid
              where panelid is the variable identifying the “individual” and timeseriesid is the variable identifying the date.
              2. xtabond2 first requires the name of the dependent variable followed by the list of explanatory variables. For instance (the data comes from:abdata.dta (-webuse abdata.dta-)
              xtabond2 n L.n L2.n w L.w L(0/2).(k ys) yr*
              n is the dependent variable (firm’s employment in log)
              the other variables are the explanatory variables (the constant term is assumed)
              L.n is n lagged once; L2.n is n lagged twice; w is firm’s wage level in log; L.w is w lagged once;
              L(0/2) is short for lagged zero times, once and twice; the variables concerned follow in parentheses after a full-stop. Consequently, L(0/2).(k ys) stands for k, L.k, L2.k, y, L.y and L2.y.
              yr* stands for all the variables in the dataset begining with yr.
              After the names of the dependent variable and the explanatory variable follows a comma. After the comma follow the options.
              3. It is almost always useful to put robust and small.
              xtabond2 n L.n L2.n w L.w L(0/2).(k ys) yr*, robust small
              4. The default is the one-step GMM estimator. If one wants a two-step GMM estimator, add twostep.
              5. The default is the the Blundell-Bond system estimator which adds moment conditions on the levels. If one wants only the difference estimator, add noleveleq.
              6. Now comes the list of instruments, both IV style instruments (the same variable for all the observations) and GMM style instruments (different variables for different observations). Note that there must be at least as many instruments as there are explanatory variables. Exogenous variables are their own instruments and must be listed here, either under ivstyle (strictly exogenous) or under gmmstyle (predetermined or endogenous).
              6a. gmmstyle
              For example, gmmstyle(L.(n w k)) states that all lagged values of L.n, L.w and L.k are to be treated as GMM instruments. To be clear, this means for n that L2.n, L3.n, and so on are the GMM instruments. Similarly, for w and for k.
              For example, gmmstyle(L2.n L.(w k)) states that all lagged values of L2.n, L.w and L.k are to be treated as GMM instruments. Thus, for n, L3.n, L4.n, and so on are the GMM instruments, and for w and k, from the second lag on.
              6b. ivstyle
              For example, ivstyle(L(0/2).ys yr*) states that ys, L.ys, L2.ys and all the yr variables are to be considered as exogenous instruments.

              Putting everything together we get:
              xtabond2 n L(1/2).n L(0/1).w L(0/2).(k ys) yr*, gmmstyle(L2.n L.(w k)) ivstyle(L(0/2).ys yr*) robust small

              7. We can, and mostly should, impose limits on the lags used as instruments in order to reduce the number of instruments.
              xtabond2 n L(1/2).n L(0/1).w L(0/2).(k ys) yr*,
              gmmstyle(L2.n L.(w k), laglimits(1 3)) ivstyle(L(0/2).ys yr*)
              robust small.

              The above command says to take as GMM instruments, L2.n, L.w and L.k lagged once, twice and three times.
              Note that gmmstyle(L2.n) is equivalent to gmmstyle(n, laglimits(3 .), the dot indicating to go backwards till the start of the sample

              I am a naive researcher. I want to know how to define control variables in xtabond2 command in Stata?
              Last edited by Harun Rosid; 04 Nov 2019, 21:27.

              Comment


              • #22
                Depends how you define a "control variable". Is it a strictly exogenous variable with respect to the idiosyncratic error term? Is it allowed to be correlated with the unobserved unit-specific effects?

                You might find some useful information on dynamic panel data GMM estimation in my recent London Stata Conference presentation:
                https://www.kripfganz.de/stata/

                Comment


                • #23
                  Hello, I have N=118 and T=20. I have ran Fixed effects and its better than Random according to Hausman however I have presence of Heteroscedasticity and serial correlation so I need to use One step System GMM.

                  I have these e.g y= ROA x=ASSETQ ASSETST CAPSTR CRED DEP EFFIC LIQ SIZE REP DIVRSF SYSTEMR CONC MCGDP SMVOL BLGDP BAGDP BAMC CAR PROD TAX DEREG CRISIS RGDP INFL MONMR LTR FEDFR PRIMR UNEMPL

                  how do I set up the syntax?? in Arellano bover/blunderr bond?? Until SYSTEMR they are considered Bank specific. Until CRISIS they are considered Industry specific. Until UNEMPL they are considered Macroeconomic.

                  Comment


                  • #24
                    Hi Sebastian,

                    I am a new research student and still learning about STATA. I read the article of Roodman "How to do Xtabond2" but I still do not understand the "equation (diff or level) for? I try to search in this forum about the explanation, but I could not find it. Maybe I need to search more.

                    Appreciate your reply

                    Regards, Annur

                    Comment


                    • #25
                      Maybe my presentation at last year's London Stata Conference can be of help?
                      https://www.kripfganz.de/stata/

                      Comment


                      • #26
                        Hi Sebastian,

                        Thank you very much

                        Comment


                        • #27
                          Hi Sebastian,

                          I have an unbalanced panel data for manufacturing sectors in many countries between 1990 and 2013. I am studying how the Total Factor Productivity (TFP) varies with FDI, openness, human capital. I use a GMM to run my regression. FDI and openness are endogenous variables. According to the literature, I am using as instruments, two-period lagged levels and first differences of the explanatory variables (FDI and openness) and one-period lagged TFP. The variable human capital is considered as exogenous. I am adding year and country fixed effects.
                          Would you please tell me if my command is true?

                          Code:
                          xtabond2 tfp_mgtrendrobust lagTFP lropen_constant  lfdi  seconary_school_gross  year* _Icountry_*,gmmstyle(lropen_constant  lfdi,lag(2 2) equation(level) collapse ) gmmstyle(lropen_constant  lfdi,lag(2 2) equation(diff) collapse ) gmmstyle(tfp_mgtrendrobust, lag(1 1)) ivstyle( seconary_school ) iv(year* _Icountry_* , eq (level))robust small two
                          Is that correct to add the country and the year fixed effects at the level equation? Or shall I include the country FE for the difference equation?

                          I have another problem: When I am adding year FE, I have omitted coefficients in the regression table. I have tried several solutions, but I still have the same problem.

                          Thanks in advance,
                          Aya



                          Comment


                          • #28
                            Hi Sebastian,

                            I have an unbalanced panel data for manufacturing sectors in many countries between 1990 and 2013. I am studying how the Total Factor Productivity (TFP) varies with FDI, openness, human capital. I use a GMM to run my regression.

                            Comment


                            • #29
                              Yes, you can specify the year and country dummies as instruments for the level model. Notice that xtabond2 has a couple of problems that might be relevant in your case:
                              1. ivstyle(seconary_school) is not the same as ivstyle(seconary_school, eq(diff)) ivstyle(seconary_school, eq(level)). Your specification is not necessarily wrong but almost all people actually aim for the specification with explicit reference to the equations.
                              2. Due to the dynamic nature of the model, some time dummies are necessarily omitted. With xtabond2, such omitted coefficients cause the degrees of freedom of the overidentification tests to be incorrect, and therefore also the p-values, which is a bug.
                              My recommendation would be to use my xtdpdgmm command instead of xtabond2 to avoid some of these issues (although I am obviously biased).
                              https://www.kripfganz.de/stata/

                              Comment


                              • #30
                                Hi Sebastian,

                                Thank you a lot for you reply.
                                I was wondering about the omitted and empty coefficients for the year and the country dummies as in your comment #11 above you mentioned that we shouldn't have empty or omitted variables.

                                I have one more clarification: I have created the variable lagTFP as when I have used L.tfpmgtrendrobust, it didn't work. Is that due to the unbalanced type of the panel? Would this affect the results?

                                As I have said earlier I would like to use as instruments the following " two-period lagged levels and first differences of the explanatory variables (FDI and openness) and one-period lagged TFP".
                                Code:
                                 
                                 gmmstyle(lropen_constant  lfdi,lag(2 2) equation(level) collapse ) gmmstyle(lropen_constant  lfdi,lag(2 2) equation(diff) collapse ) gmmstyle(tfp_mgtrendrobust, lag(1 1))
                                Is that the right way to use them?

                                Many thanks,
                                Aya

                                Comment

                                Working...
                                X