Announcement

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

  • XTSEQREG: new Stata command for sequential / two-stage (GMM) estimation of linear panel models

    Dear Statalisters,

    I have just released a new Stata command for the estimation of linear panel data models. The main purpose of the xtseqreg command is the implementation of the two-stage estimation procedure described in my working paper with Claudia Schwarz in the context of linear (dynamic) panel data models with time-invariant regressors. In that paper, we suggest to run in a first stage a regression of the dependent variable on the time-varying regressors only, and to subsequently regress the first-stage residuals on the time-invariant regressors in a second stage. Instruments can be used at both stages and efficient estimation can be achieved with two-step GMM. At the second stage, the usual standard errors are invalid and need to be corrected. The respective analytical standard-error correction is the main purpose of this new command. For full details about the methodology and its benefits, please have a look at the paper.

    Yet, the new command itself is much more flexible because it can also be used for IV/GMM estimation of a single stage only. It then mimics (part of) the behavior of existing commands for instrumental variable and GMM estimation of linear panel data models, in particular xtdpd and xtabond2 in the context of dynamic models. In part, the other commands achieve things that my command cannot deliver, but mine also adds some flexibility that the others do not offer. However, I want to emphasize that it is not my intention to introduce this new command as a competitor for the existing ones. The re-implementation of these GMM estimators was simply a necessary requirement to achieve the above-mentioned standard-error correction.

    The new command is currently only available for installation from my own website and not yet from SSC:
    Code:
    . net install xtseqreg, from(http://www.kripfganz.de/stata/)
    After the installation, detailed documentation of the syntax and available options can be found in the help files:
    Code:
    . help xtseqreg
    . help xtseqreg postestimation
    As always, comments and suggestions are welcome and highly appreciated.

    Here is a brief example for a two-stage estimation of a dynamic Mincer equation. At the first stage, the log-wages are regressed on the time-varying regressors. The estimator is a two-step difference-GMM estimator (Arellano/Bond) with collapsed GMM-type instruments for the 2 lags of the dependent variable, standard instruments for the strictly exogenous regressors, and Windmeijer-corrected robust standard errors.
    Code:
    . xtseqreg L(0/2).lwage exp exp2 occ ind union, gmmiv(L.lwage, model(difference) lagrange(1 4) collapse) iv(exp exp2 occ ind union, difference model(difference)) twostep vce(robust)
    
    Group variable: id                           Number of obs         =      2975
    Time variable: t                             Number of groups      =       595
    
                                                 Obs per group:    min =         5
                                                                   avg =         5
                                                                   max =         5
    
                                                 Number of instruments =        10
    
                                         (Std. Err. adjusted for clustering on id)
    ------------------------------------------------------------------------------
                 |              WC-Robust
           lwage |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
    -------------+----------------------------------------------------------------
           lwage |
             L1. |    .365887   .1722314     2.12   0.034     .0283197    .7034543
             L2. |   .1009276   .0732219     1.38   0.168    -.0425848    .2444399
                 |
             exp |   .0501576   .0282205     1.78   0.076    -.0051536    .1054688
            exp2 |   -.000206    .000148    -1.39   0.164     -.000496     .000084
             occ |  -.0428486   .0283624    -1.51   0.131    -.0984379    .0127406
             ind |   .0481791   .0305408     1.58   0.115    -.0116798     .108038
           union |    .006991   .0288093     0.24   0.808    -.0494742    .0634562
           _cons |   2.737719   1.088102     2.52   0.012     .6050775     4.87036
    ------------------------------------------------------------------------------
    With the following syntax, we can then run a second-stage instrumental-variables regression of the first-stage residuals on some time-invariant regressors. The first-stage results are automatically taken from the previous estimation. Just as an illustration, ed is assumed to be endogenous and instrumented with occ.
    Code:
    . xtseqreg lwage (L(1/2).lwage exp exp2 occ ind union) ed fem blk, iv(occ fem blk, model(level)) vce(robust)
    
    Group variable: id                           Number of obs         =      2975
    Time variable: t                             Number of groups      =       595
    
    ------------------------------------------------------------------------------
    Equation _first                              Equation _second
    Number of obs         =      2975            Number of obs         =      2975
    Number of groups      =       595            Number of groups      =       595
    
    Obs per group:    min =         5            Obs per group:    min =         5
                      avg =         5                              avg =         5
                      max =         5                              max =         5
    
    Number of instruments =        10            Number of instruments =         4
    
                                         (Std. Err. adjusted for clustering on id)
    ------------------------------------------------------------------------------
                 |               Robust
           lwage |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
    -------------+----------------------------------------------------------------
    _first       |
           lwage |
             L1. |    .365887   .1722314     2.12   0.034     .0283197    .7034543
             L2. |   .1009276   .0732219     1.38   0.168    -.0425848    .2444399
                 |
             exp |   .0501576   .0282205     1.78   0.076    -.0051536    .1054688
            exp2 |   -.000206    .000148    -1.39   0.164     -.000496     .000084
             occ |  -.0428486   .0283624    -1.51   0.131    -.0984379    .0127406
             ind |   .0481791   .0305408     1.58   0.115    -.0116798     .108038
           union |    .006991   .0288093     0.24   0.808    -.0494742    .0634562
           _cons |   2.737719   1.088102     2.52   0.012     .6050775     4.87036
    -------------+----------------------------------------------------------------
    _second      |
              ed |   .0634885   .0348497     1.82   0.068    -.0048158    .1317927
             fem |  -.0967082   .0575629    -1.68   0.093    -.2095295     .016113
             blk |  -.1531252   .1010073    -1.52   0.130     -.351096    .0448456
           _cons |  -.7936727   .4419754    -1.80   0.073    -1.659929    .0725831
    ------------------------------------------------------------------------------
    Instead of specifying both stages one after the other, with some more complicated syntax the same results can also be obtained with a single command line:
    Code:
    . xtseqreg lwage (L(1/2).lwage exp exp2 occ ind union) ed fem blk, gmmiv(L.lwage, model(difference) lagrange(1 4) collapse equation(#1)) iv(exp exp2 occ ind union, difference model(difference) equation(#1)) iv(occ fem blk, model(level) equation(#2)) twostep vce(robust) both
    As a postestimation command, estat overid provides Hansen's J-test for the validity of the overidentifying restrictions for both stages. (In the current example, the second stage is exactly identified.)
    Code:
    . estat overid
    
    Hansen's J-test for equation _first                    chi2(2)     =    0.2935
    H0: overidentifying restrictions are valid             Prob > chi2 =    0.8635
    
    Hansen's J-test for equation _second                   chi2(0)     =    0.0000
    note: coefficients are exactly identified              Prob > chi2 =         .
    The following command line exactly replicates the above results for the first stage with xtabond2, including Hansen's J-test:
    Code:
    . xtabond2 L(0/2).lwage exp exp2 occ ind union, gmmstyle(L.lwage, equation(diff) laglimits(1 4) collapse) ivstyle(exp exp2 occ ind union, equation(diff)) twostep robust
    Notice that the reported results for Hansen's J-test would differ between xtseqreg and xtabond2 if the one-step GMM estimator was used (the above example without option twostep) because xtabond2 silently still estimates the two-step estimator for this purpose while xtseqreg evaluates the first-step moment functions while still using an optimal weighting matrix (that would have been used in a second step).

    Finally, also notice that xtabond2 might in some situations report an incorrect number of instruments because it does not always detect a linear relationship between instruments specified for the first-differenced and those for the levels model. This can happen in particular with time dummies if they are specified for both the first-differenced and the levels model (which is something that actually should not be done). In the following example (output omitted), xtabond2 reports 17 instruments, while xtseqreg obtains the identical result but correctly reports only 13 instruments. (This can happen when xtabond2 is used with either the option h(1) or h(2). It does not happen with the default option h(3). The default weighting matrix of xtseqreg corresponds to h(2) of xtabond2.) This has an important consequence because the degrees of freedom used for Hansen's J-test depend on the number of instruments. Hence, the reported J-test by xtabond2 might be misleading.
    Code:
    . xtseqreg L(0/2).lwage exp2 occ ind union tdum4-tdum7, gmmiv(L.lwage, model(difference) lagrange(1 4) collapse) iv(exp2 occ ind union, difference model(difference)) iv(tdum4-tdum7, model(diff)) iv(tdum4-tdum7, model(level)) twostep vce(robust)
    . xtabond2 L(0/2).lwage exp2 occ ind union tdum4-tdum7, gmmstyle(L.lwage, equation(diff) laglimits(1 4) collapse) ivstyle(exp2 occ ind union, equation(diff)) ivstyle(tdum4-tdum7, equation(diff)) ivstyle(tdum4-tdum7, equation(level)) twostep robust h(2)
    You can read more about this last observation in another Statalist topic: System GMM - Time Dummies.

    Reference:
    • Kripfganz, S., and C. Schwarz (2015). Estimation of linear dynamic panel data models with time-invariant regressors. ECB Working Paper 1838, European Central Bank.

  • Liza Vieira
    replied
    Dear Sebastian,

    many thanks for the comments.

    I am going to address your alternative.

    Leave a comment:


  • Sebastian Kripfganz
    replied
    You already looked at all my usual recommendations. I am afraid I do not see anything obvious that could still be done here. With such a large sample size, the Arellano-Bond test might already pick up small deviations from the null hypothesis of no serial correlation. This could be due to any omitted variables. It then requires your judgement whether you worry much about such a small misspecification. If you can show that your results are robust to different specifications (e.g. different lag orders), and ideally the Hansen test does not reject the overidentifying restrictions, it might be okay to nevertheless accept this specification.

    An alternative might be to use higher-order starting lags, say lagrange(3 .) instead of lagrange(2 .) which would allow for second-order serial correlation in the first-differenced errors, although at the cost of using weaker instruments.

    Leave a comment:


  • Liza Vieira
    replied
    Dear Statalisters,

    I am using the command xtseqreg in my research.

    My data set is characterized by a large (N aproximately equal to 130 000) and small T (year 2000 to 2017) when compared to N. Additionally, I have a set of time-varying independent variables (ln_pub_c1 ln_pub_c2 ln_icts ln_dhdi ln_dwgi ln_dspc ln_dtop10 ln_dneig) and time-invariant variables (ln_distcap ln_contig ln_comlang_off ln_colony ln_comcol). My dependent variable is ln_pub_col.

    I have tried the diff-GMM and system-GMM specification and followed the sequential selection process adapted from Kiviet (2019,) as explained by Sebastian Kripfganz in his presentation at London Stata Conference in 2019.

    As an example, I show the code used in one of the specifications and the obtained output.

    HTML Code:
    xtseqreg L(0/3).ln_pub_col L(0/3).(ln_pub_c1 ln_pub_c2 ln_icts ln_dhdi ln_dwgi ln_dspc ln_dtop10 ln_dneig), gmmiv(ln_pub_col, model(difference) lagrange(2 .)) gmmiv(ln_pub_col, model(level) difference lagrange(1 .)) gmmiv(ln_pub_c1 ln_pub_c2 ln_icts ln_dhdi ln_dwgi ln_dspc ln_dtop10 ln_dneig, model(difference) lagrange(2 .)) gmmiv(ln_pub_c1 ln_pub_c2 ln_icts ln_dhdi ln_dwgi ln_dspc ln_dtop10 ln_dneig, model(level) difference lagrange(1 .)) twostep vce(robust) teffects
    
    Group variable: pair_n                       Number of obs         =    110764
    Time variable: year                          Number of groups      =      8372
    
                                                 Obs per group:    min =         1
                                                                   avg =  13.23029
                                                                   max =        15
    
                                                 Number of instruments =      2266
    
                                 (Std. Err. adjusted for 8,372 clusters in pair_n)
    ------------------------------------------------------------------------------
                 |              WC-Robust
      ln_pub_col |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
    -------------+----------------------------------------------------------------
      ln_pub_col |
             L1. |   .4688867   .0063557    73.77   0.000     .4564297    .4813436
             L2. |   .2857157   .0072898    39.19   0.000     .2714279    .3000035
             L3. |   .2246439   .0064371    34.90   0.000     .2120273    .2372605
                 |
       ln_pub_c1 |
             --. |  -.0027787   .0067151    -0.41   0.679    -.0159401    .0103827
             L1. |  -.0046365   .0046309    -1.00   0.317    -.0137129    .0044399
             L2. |   .0124372   .0039266     3.17   0.002     .0047412    .0201332
             L3. |  -.0027408   .0037742    -0.73   0.468    -.0101381    .0046565
                 |
       ln_pub_c2 |
             --. |  -.0253773   .0059413    -4.27   0.000    -.0370221   -.0137325
             L1. |   .0097872   .0043259     2.26   0.024     .0013086    .0182657
             L2. |   .0116265   .0037105     3.13   0.002     .0043541     .018899
             L3. |   .0096613   .0033984     2.84   0.004     .0030006     .016322
                 |
         ln_icts |
             --. |   .0001502   .0109222     0.01   0.989    -.0212568    .0215573
             L1. |  -.0197857   .0112639    -1.76   0.079    -.0418626    .0022911
             L2. |  -.0008872   .0068086    -0.13   0.896    -.0142318    .0124574
             L3. |   .0079444   .0050573     1.57   0.116    -.0019677    .0178565
                 |
         ln_dhdi |
             --. |   .0515274   .3173365     0.16   0.871    -.5704408    .6734956
             L1. |  -.2789475    .412341    -0.68   0.499    -1.087121     .529226
             L2. |   .4715926   .2849979     1.65   0.098     -.086993    1.030178
             L3. |  -.3044555   .1959573    -1.55   0.120    -.6885248    .0796138
                 |
         ln_dwgi |
             --. |   .0627715   .0237404     2.64   0.008     .0162412    .1093018
             L1. |  -.0416349   .0228634    -1.82   0.069    -.0864464    .0031766
             L2. |   .0023067   .0135162     0.17   0.864    -.0241846     .028798
             L3. |   .0129192   .0094862     1.36   0.173    -.0056733    .0315118
                 |
         ln_dspc |
             --. |   .0098149   .0047202     2.08   0.038     .0005635    .0190663
             L1. |    .006029   .0030625     1.97   0.049     .0000265    .0120314
             L2. |   .0115451   .0030407     3.80   0.000     .0055854    .0175047
             L3. |   .0034157   .0029659     1.15   0.249    -.0023974    .0092289
                 |
       ln_dtop10 |
             --. |   .0208839   .0030799     6.78   0.000     .0148473    .0269205
             L1. |   .0088835   .0017673     5.03   0.000     .0054198    .0123473
             L2. |  -.0003043   .0017246    -0.18   0.860    -.0036845     .003076
             L3. |   .0062354    .001771     3.52   0.000     .0027643    .0097064
                 |
        ln_dneig |
             --. |  -2.427052   .0530159   -45.78   0.000    -2.530961   -2.323143
             L1. |   .7764577   .0392983    19.76   0.000     .6994344    .8534809
             L2. |   .4338752   .0387189    11.21   0.000     .3579875    .5097629
             L3. |   .3515533   .0376412     9.34   0.000     .2777778    .4253288
                 |
            year |
           2004  |  -.0049636   .0049394    -1.00   0.315    -.0146446    .0047175
           2005  |   .0017011   .0053225     0.32   0.749    -.0087308     .012133
           2006  |  -.0053781   .0057684    -0.93   0.351    -.0166839    .0059277
           2007  |    .007022   .0056924     1.23   0.217    -.0041349    .0181789
           2008  |  -.0036337   .0053883    -0.67   0.500    -.0141946    .0069272
           2009  |    .001857   .0058449     0.32   0.751    -.0095987    .0133127
           2010  |  -.0038453   .0057092    -0.67   0.501    -.0150352    .0073446
           2011  |   .0010227   .0058642     0.17   0.862     -.010471    .0125164
           2012  |  -.0052501   .0061473    -0.85   0.393    -.0172985    .0067983
           2013  |  -.0173922   .0062736    -2.77   0.006    -.0296883   -.0050962
           2014  |   -.007815   .0066605    -1.17   0.241    -.0208694    .0052393
           2015  |   .0108063   .0069097     1.56   0.118    -.0027364     .024349
           2016  |   .0111071   .0073656     1.51   0.132    -.0033291    .0255433
           2017  |  -.0446102   .0077037    -5.79   0.000    -.0597092   -.0295112
                 |
           _cons |   .2825371   .0291722     9.69   0.000     .2253607    .3397135
    ------------------------------------------------------------------------------
    
    . estat serial
    
    Arellano-Bond test for autocorrelation of the first-differenced residuals
    H0: no autocorrelation of order 1:     z =  -55.4828   Prob > |z|  =    0.0000
    H0: no autocorrelation of order 2:     z =    6.0365   Prob > |z|  =    0.0000
    However, I found the same behaviour in all the specifications I have tried: the Arellano-Bond test for the second order is always rejected. To overcome this issue, I used the collapse option, reduced the number of lags of the instruments and also considered the nonlinear Ahn and Schmidt (1995) moment conditions. I also tried to include in the model different lags for both dependent and independent variables. Still, in all cases, the test continues to be rejected.

    Comments and help regarding these results are very welcome.

    Thanks in advance.

    Kiviet, J. F. (2019). Microeconometric dynamic panel data methods: Model specification and selection issues. MPRA Paper 95159, Munich Personal RePEc Archive.

    Ahn, S. C., and P. Schmidt (1995). Efficient estimation of models for dynamic panel data. Journal of Econometrics 68 (1): 5–27





    Leave a comment:


  • Sebastian Kripfganz
    replied
    The new version 1.2.3 of the xtseqreg package is now available on SSC - with the usual thanks to Kit Baum - and on my personal website.
    Code:
    adoupdate xtseqreg, update
    With this update, I primarily fixed a bug in the determination of the estimation sample when the sample was restricted with an if-condition. See the following discussion for details:
    https://www.statalist.org/forums/for...ferences-model

    Leave a comment:


  • Sebastian Kripfganz
    replied
    I am afraid I would need to see the exact code (and ideally also the first-stage output) that you used to figure out what might have caused this error message.

    If you classify your time-invariant variables as exogenous (with regard to the unit-specific effects), you can use a one-stage system-GMM approach and just instrument those variables by themselves in levels. Interactions with time dummies are possible but their effects are interpreted differently, as these are relative effects to the omitted base year, but the base effect would still not be estimated.

    Leave a comment:


  • Sam Obi
    replied
    Thank you Prof Kripfganz for the clarifications. My attempt to run the two stage estimation using xtdpdgmm in the first stage and xtseqreg commands in the second stage returns an error message, "option first( ) incorrectly specified". This is similar to what was reported in post #26 of this thread. I followed your recommendations in post #29 and post #57 that links to the detailed explanations that you gave on how to run xtdpdgmm, but still get the same error message repeatedly.

    My panel data set is unbalanced with long T=47, N=2397, n=51, and i am using stata 13.1 for the analysis. My interest in the two stage sysGMM approach is because of the time invariant variables in my model, and i think using the FOD-GMM over first diff estimator will serve my interest most, which rules out the use of xtseqreg in the first stage. Do you think there is something i could do differently that addresses the error problem? I am considering the one stage sys-GMM since my variables are properly classified as exogenous, predetermined & endogenous. How does this work with the time invariant variables? Would i need to interact them with time dummies for their coefficients to be estimated? What other options do i have in using your recommended estimation methods?

    Thank you so much for your time.

    Leave a comment:


  • Sebastian Kripfganz
    replied
    The xtseqreg command currently only supports the first-difference transformation of the model. However, if you need another transformation in the first stage of the procedure, e.g. forward-orthogonal deviations instead of first differences, you can use my xtdpdgmm command for that purpose:
    Code:
    . webuse psidextract
    . xtdpdgmm lwage L.lwage wks exp exp2, model(fod) gmmiv(L.lwage wks exp exp2, lag(1 4)) twostep vce(robust) auxiliary
    . xtseqreg lwage (L.lwage wks exp exp2) fem ed blk, first(, copy) iv(fem ed blk, model(level)) vce(robust)
    Note that you need to specify the auxiliary option with xtdpdgmm and the first(, copy) option for xtseqreg for the combination of these two commands to work.

    Leave a comment:


  • Sam Obi
    replied
    Please Professor Kripfganz, is there an option for other data transformation types in xtseqreg command aside using first difference? I am new to the stata forum, so not sure if this is the right way to ask my question.

    Thank you.

    Leave a comment:


  • Sebastian Kripfganz
    replied
    Using system GMM is not a panacea for the identification of coefficients of endogenous time-invariant regressors. You are obtaining a spurious estimate because the instruments for the level equation are somewhat correlated with the time-invariant regressor in finite samples. However, the usual assumption is that those instruments are (asymptotically) uncorrelated with all time-invariant variables. Hence, identification fails.

    If all your variables are endogenous (in particular, if all of them are allowed to be correlated with the unobserved time-invariant heterogeneity), then there is no hope to consistently estimate the coefficient of the observed endogenous time-invariant variable. You need to find valid external instruments.

    For more information, please see slides 82 to 86 of my presentation at this year's London Stata Conference, and my recent article in the Journal of Applied Econometrics:

    Leave a comment:


  • Mina Alizadeh
    replied
    Dear all,

    I apologize if I post this question here, I am not sure where exactly I should post my questions.
    I want to estimate the dynamic effect of schooling years on log of hourly wage (dynamic mincer equation). The key variable in this estimation is schooling years (s) and it is endogenous and time-invariant. In the model all variables considered endogenous except year dummies.
    The variables are:
    logw: logarithm of hourly wage
    s: schooling years
    pexper: potential experience
    pexper2: potential experience square

    years are from 2005-2010, I just used the dummy years from 2007-2010.

    Since schooling years is time-invariant and endogenous. It is not possible to use lag of schooling years as instrument for the difference equation (bc in the difference equation, schooling years disappears since it is time- invariant). Furthermore, in the level equation, it is also impossible to use lag of its difference as instrument.

    I searched a lot and found that the solution would be by using xtabond2 or xtseqreg or xdpdgmm. My question is if I want to use internal instrument not external, for schooling years, how this can be applied using xtabond2. I used the following code, however I am not sure if it gives a correct coefficient for schooling years.

    xtabond2 logw laglogw s pexper pexper2 yr2007-yr2010 if sex==1, gmm (logw pexper pexper2 , lag(2 .) eq(diff) collapse ) gmm(logw , lag(1 1) eq(level) collapse) iv(yr2007-yr2010, equation(level)) small robust two

    Leave a comment:


  • Suchita Srinivasan
    replied
    Thank you for this example, Sebastian, it is very strange that this happens. In this case, the coefficient are the same to the second decimal place, which might work, at least for some cases.

    Thanks for taking your time to clarify this, and answer my question! Much appreciated!

    Leave a comment:


  • Sebastian Kripfganz
    replied
    Thanks. That's really odd. I cannot tell exactly what is going on here but I can at least provide some suggestive evidence that there is a bug in xtabond2. Consider the following extremely simplified regression based on your data set, where the dependent variable is just regressed on a constant. I still add some dummy variables as instruments. However, in theory, these dummy variables do not have any effect on the constant because the constant is perfectly identified without these dummy variables. Hence, this regression is essentially just an OLS regression of the dependent variable on the constant. As you can see below, the OLS results from regress are indeed identical to xtseqreg while those from xtabond2 differ (while they should not):
    Code:
    . xtabond2 lnlabprod_v3 if (q13a ==1 & q11a == 0 & industry_same ==1), iv(i.q17a, eq(diff)) robust nodi
    Favoring speed over space. To switch, type or click on mata: mata set matafavor space, perm.
    Warning: Two-step estimated covariance matrix of moments is singular.
      Using a generalized inverse to calculate robust weighting matrix for Hansen test.
    
    Dynamic panel-data estimation, one-step system GMM
    ------------------------------------------------------------------------------
    Group variable: q1                              Number of obs      =      6094
    Time variable : time                            Number of groups   =      3112
    Number of instruments = 19                      Obs per group: min =         1
    Wald chi2(0)  =         .                                      avg =      1.96
    Prob > chi2   =         .                                      max =         3
    ------------------------------------------------------------------------------
                 |               Robust
    lnlabprod_v3 |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
    -------------+----------------------------------------------------------------
           _cons |   13.69559   .0258224   530.38   0.000     13.64498     13.7462
    ------------------------------------------------------------------------------
    Instruments for first differences equation
      Standard
        D.(0b.q17a 1.q17a 2.q17a 3.q17a 4.q17a 5.q17a 6.q17a 7.q17a 8.q17a 9.q17a
        10.q17a 11.q17a 12.q17a 13.q17a 14.q17a 15.q17a 16.q17a 17.q17a 18.q17a
        19.q17a 20.q17a)
    Instruments for levels equation
      Standard
        _cons
    ------------------------------------------------------------------------------
    Arellano-Bond test for AR(1) in first differences: z =  -5.88  Pr > z =  0.000
    Arellano-Bond test for AR(2) in first differences: z =      .  Pr > z =      .
    ------------------------------------------------------------------------------
    Sargan test of overid. restrictions: chi2(18)   =  24.97  Prob > chi2 =  0.126
      (Not robust, but not weakened by many instruments.)
    Hansen test of overid. restrictions: chi2(18)   =  18.71  Prob > chi2 =  0.410
      (Robust, but weakened by many instruments.)
    
    . xi: xtseqreg lnlabprod_v3 if (q13a == 1 & q11a == 0 & industry_same ==1), iv(i.q17a, diff m(diff)) vce(robust)
    i.q17a            _Iq17a_0-20         (naturally coded; _Iq17a_0 omitted)
    
    Group variable: q1                           Number of obs         =      6094
    Time variable: time                          Number of groups      =      3112
    
                                                 Obs per group:    min =         1
                                                                   avg =  1.958226
                                                                   max =         3
    
                                                 Number of instruments =        19
    
                                     (Std. Err. adjusted for 3,112 clusters in q1)
    ------------------------------------------------------------------------------
                 |               Robust
    lnlabprod_v3 |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
    -------------+----------------------------------------------------------------
           _cons |   13.69021   .0259178   528.22   0.000     13.63941      13.741
    ------------------------------------------------------------------------------
    
    . reg lnlabprod_v3 if (q13a == 1 & q11a == 0 & industry_same ==1), vce(cluster q1)
    
    Linear regression                               Number of obs     =      6,094
                                                    F(0, 3111)        =       0.00
                                                    Prob > F          =          .
                                                    R-squared         =     0.0000
                                                    Root MSE          =     2.4716
    
                                     (Std. Err. adjusted for 3,112 clusters in q1)
    ------------------------------------------------------------------------------
                 |               Robust
    lnlabprod_v3 |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
    -------------+----------------------------------------------------------------
           _cons |   13.69021    .025922   528.13   0.000     13.63938    13.74103
    ------------------------------------------------------------------------------
    I hope this convinces you that you can move forward with xtseqreg in your analysis.

    Leave a comment:


  • Suchita Srinivasan
    replied
    Thank you Sebastian, I sent you an email.

    Leave a comment:


  • Sebastian Kripfganz
    replied
    With your data example, both commands deliver identical output on my computer. Please feel free to send me the data set by e-mail.

    Leave a comment:

Working...
X