Announcement

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

  • Sarah Magd
    replied
    Dear Prof. Sebastian Kripfganz,
    1- I have included the first difference of a variable in the main equation of my regression. Can I include this variable in level as an instrumental variable in the differential equation?
    2- if we include the logarithmic transformation of a variable, can we include its level form as an instrument?
    so the two questions are related to whether we can use a different variable as an instrument or do we have to use the same variable as an instrument in the gmm?

    Leave a comment:


  • Sebastian Kripfganz
    replied
    1. As far as I can tell from glancing over the two command lines, the only difference seems to be that the first command has the additional options overid noconstant. Thus, it calculates additional incremental overidentification statistics that can be displayed with the postestimation command estat overid, difference. And it constrained the constant to be zero.

    2. The Sargan-Hansen tests after the one-step system GMM estimation are based on a weighting matrix which is not optimal. Those tests are asymptotically invalid. I would not expect too much from them either with your very small number of groups.

    Normally, you would start with the difference GMM estimator and then use the system GMM estimator as a robustness check, or to improve on the estimates if you suspect identification problems with the difference GMM estimator.

    Leave a comment:


  • Sarah Magd
    replied
    Dear Prof. Sebastian Kripfganz,
    Thank you very much for your reply. I have two other questions.

    1. May you please clarify what the difference is between the following two commands?


    1.1. xtdpdgmm L(0/1).ln_energy_total_cap_mwh ln_gdpc ln_industry_gdp ln_real_oilpr ln_fd_1 hc ln_Total_2 , model(diff) collapse gmm(l.ln_energy_total_cap_mwh ln_gdpc ln_industry_gdp ln_real_oilpr, lag(1 3)) gmm( ln_fd_1 hc ln_Total_2 , lag(1 3)) gmm(ln_energy_total_cap_mwh ln_gdpc ln_industry_gdp ln_real_oilpr, lag(1 1) diff model(level)) gmm( ln_fd_1 hc ln_Total_2 , lag(0 0) diff model (level)) two vce(r) overid noconstant


    1.2. xtdpdgmm L(0/1).ln_energy_total_cap_mwh ln_gdpc ln_industry_gdp ln_real_oilpr ln_fd_1 hc ln_Total_2, collapse gmm (l.ln_energy_total_cap_mwh ln_gdpc ln_industry_gdp ln_real_oilpr, lag(1 3) model(diff)) gmm(ln_fd_1 hc ln_Total_2, lag(1 3) model(diff)) gmm(l.ln_energy_total_cap_mwh ln_gdpc ln_industry_gdp ln_real_oilpr, lag(1 1) diff) gmm(ln_fd_1 hc ln_Total_2, lag(0 0) diff) two vce(r)

    #########################
    2. my sample size is 332 observations with the time period from 2005 to 2017. when I estimate the two-step GMM model, it passes the Hansen test. However, I get the following result for the Hansen test from the one-step GMM model (i.e., the system GMM). I do not understand why I have this result with the one-step model. Would you please guide me on this?

    Sargan-Hansen test of the overidentifying restrictions
    H0: overidentifying restrictions are valid

    1-step moment functions, 1-step weighting matrix chi2(21) = 99.5061
    note: * Prob > chi2 = 0.0000

    1-step moment functions, 2-step weighting matrix chi2(21) = 28.0000
    note: * Prob > chi2 = 0.1402
    ###########################

    Also, given my sample size, should I use the difference GMM model for robustness checks?
    Last edited by Sarah Magd; 26 Apr 2022, 08:21.

    Leave a comment:


  • Sebastian Kripfganz
    replied
    Originally posted by Sarah Magd View Post
    I have grouped my variables into endogenous and predetermined variables. However, I have been asked to test for the exogeneity and predeterminant of these variables (in other words, to provide evidence that my variables are correctly specified and grouped). Could you please guide us on how we can test whether the grouping of variables is correct or not with xtdpdgmm? We would highly appreciate it if you could provide an example with a code.
    In my 2019 London Stata Conference presentation, I demonstrate starting on slide 90 how to empirically classify the variables as endogenous, predetermined, or strictly exogenous. You would begin with classifying all variables as endogenous. Then you can add further instruments which are valid if the variables are predetermined. Incremental overidentification tests can be used to check whether those additional instruments are valid, and therefore if the variables are indeed predetermined. Later, you can do the same for strict exogeneity, by adding the respective additional instruments and checking the incremental overidentification tests again.

    In your example with the system and difference GMM estimator, I would recommend to use the same lag orders for both. Using lag(1 3) for the system GMM estimator but lag(1 5) for the difference GMM estimator gives the impression to a reader of your analysis that you are cherry picking results. Furthermore, it is highly unusual to not include a regression constant when using the system GMM estimator. This might explain the observed differences. Aside from that, the difference GMM estimator might suffer from an identification problem if the true value (not the estimated value) of the lagged dependent variable's coefficient is close to 1. You could try adding the nl(noserial) option to the difference GMM estimator. This gives you the Ahn-Schmidt estimator, which could be of help avoiding this identification problem of the difference GMM estimator.

    Leave a comment:


  • Sarah Magd
    replied
    Dear Prof. Sebastian Kripfganz,
    I am estimating a two-step system GMM model with l.Y X2 X3 X4 being my endogenous variables. The results of this model are consistent with the literature. However, when I estimate a two-step difference GMM model, the results become inconsistent, especially for the lagged dependent variable. Could you please help me figure out the problem?
    My sample ranges from 2005 to 2017.

    ################################################## ################################################## #########
    #Two step sys GMM model
    ################################################## ################################################## ##########
    . xtdpdgmm L(0/1).Y X1 X2 X3 X4 X5 X6, model(diff) collapse gmm(l.Y X2 X3 X4, lag(1 3)) gmm( X1 X5 X6, lag(1 3)) gmm(Y X2 X3 X4, l
    > ag(1 1) diff model(level)) gmm(X1 X5 X6, lag(0 0) diff model (level)) two vce(r) overid noconstant


    Moment conditions: linear = 28 Obs per group: min = 10
    nonlinear = 0 avg = 11.85714
    total = 28 max = 12

    (Std. Err. adjusted for 28 clusters in iso_num)
    ------------------------------------------------------------------------------
    | WC-Robust
    Y | Coef. Std. Err. z P>|z| [95% Conf. Interval]
    -------------+----------------------------------------------------------------
    Y |
    L1. | .8335899 .0610488 13.65 0.000 .7139365 .9532433

    X1 | -.0820382 .0266326 -3.08 0.002 -.1342371 -.0298393
    X2 | .0649644 .0245804 2.64 0.008 .0167876 .1131411
    X3 | -.0943125 .0459489 -2.05 0.040 -.1843707 -.0042544
    X4 | -.0172625 .0110394 -1.56 0.118 -.0388993 .0043742
    X5 | -.0656854 .0300032 -2.19 0.029 -.1244907 -.0068801
    X6 | .1170248 .0508016 2.30 0.021 .0174555 .2165942
    ------------------------------------------------------------------------------
    Instruments corresponding to the linear moment conditions:
    1, model(diff):
    L1.L.Y L2.L.Y L3.L.Y L1.X2 L2.X2 L3.X2 L1.X3 L2.X3 L3.X3 L1.X4 L2.X4 L3.X4
    2, model(diff):
    L1.X1 L2.X1 L3.X1 L1.X5 L2.X5 L3.X5 L1.X6 L2.X6 L3.X6
    3, model(level):
    L1.D.Y L1.D.X2 L1.D.X3 L1.D.X4
    4, model(level):
    D.X1 D.X5 D.X6

    . estat overid

    Sargan-Hansen test of the overidentifying restrictions
    H0: overidentifying restrictions are valid

    2-step moment functions, 2-step weighting matrix chi2(21) = 27.4217
    Prob > chi2 = 0.1573

    2-step moment functions, 3-step weighting matrix chi2(21) = 28.0000
    Prob > chi2 = 0.1402

    . estat serial, ar(1/3)

    Arellano-Bond test for autocorrelation of the first-differenced residuals
    H0: no autocorrelation of order 1: z = -3.7914 Prob > |z| = 0.0001
    H0: no autocorrelation of order 2: z = 1.6378 Prob > |z| = 0.1015
    H0: no autocorrelation of order 3: z = 0.9998 Prob > |z| = 0.3174

    ################################################## ################################################## #########
    #Difference GMM model
    ################################################## ################################################## ##########

    . xtdpdgmm L(0/1).Y X1 X2 X3 X4 X5 X6, model(diff) collapse gmm(l.Y X2 X3 X4, lag(1 5)) gmm( X1 X5 X6, lag(1 3)) two vce(r) overid
    > noconstant

    Generalized method of moments estimation

    Fitting full model:
    Step 1 f(b) = .00222498
    Step 2 f(b) = .86843655

    Fitting reduced model 1:
    Step 1 f(b) = .00147315

    Fitting reduced model 2:
    Step 1 f(b) = .70379905

    Group variable: iso_num Number of obs = 332
    Time variable: year Number of groups = 28

    Moment conditions: linear = 29 Obs per group: min = 10
    nonlinear = 0 avg = 11.85714
    total = 29 max = 12

    (Std. Err. adjusted for 28 clusters in iso_num)
    ------------------------------------------------------------------------------
    | WC-Robust
    Y | Coef. Std. Err. z P>|z| [95% Conf. Interval]
    -------------+----------------------------------------------------------------
    Y |
    L1. | .0188738 .1174797 0.16 0.872 -.2113823 .2491298
    |
    X1 | -.1169446 .0221783 -5.27 0.000 -.1604133 -.073476
    X2 | .7521403 .1463045 5.14 0.000 .4653888 1.038892
    X3 | -.0511113 .1211055 -0.42 0.673 -.2884738 .1862512
    X4 | -.0011518 .0082276 -0.14 0.889 -.0172776 .014974
    X5 | .0371346 .0451025 0.82 0.410 -.0512648 .1255339
    X6 | -.3401888 .1308523 -2.60 0.009 -.5966546 -.0837231
    ------------------------------------------------------------------------------
    Instruments corresponding to the linear moment conditions:
    1, model(diff):
    L1.L.Y L2.L.Y L3.L.Y L4.L.Y L5.L.Y L1.X2 L2.X2 L3.X2 L4.X2 L5.X2 L1.X3
    L2.X3 L3.X3 L4.X3 L5.X3 L1.X4 L2.X4 L3.X4 L4.X4 L5.X4
    2, model(diff):
    L1.X1 L2.X1 L3.X1 L1.X5 L2.X5 L3.X5 L1.X6 L2.X6 L3.X6

    . estat overid

    Sargan-Hansen test of the overidentifying restrictions
    H0: overidentifying restrictions are valid

    2-step moment functions, 2-step weighting matrix chi2(22) = 24.3162
    Prob > chi2 = 0.3309

    2-step moment functions, 3-step weighting matrix chi2(22) = 28.0000
    Prob > chi2 = 0.1757

    . estat serial, ar(1/3)

    Arellano-Bond test for autocorrelation of the first-differenced residuals
    H0: no autocorrelation of order 1: z = -2.2317 Prob > |z| = 0.0256
    H0: no autocorrelation of order 2: z = -0.8144 Prob > |z| = 0.4154
    H0: no autocorrelation of order 3: z = 1.2586 Prob > |z| = 0.2082
    Last edited by Sarah Magd; 26 Apr 2022, 02:58.

    Leave a comment:


  • Sarah Magd
    replied
    Dear Prof. Sebastian Kripfganz,
    I have grouped my variables into endogenous and predetermined variables. However, I have been asked to test for the exogeneity and predeterminant of these variables (in other words, to provide evidence that my variables are correctly specified and grouped). Could you please guide us on how we can test whether the grouping of variables is correct or not with xtdpdgmm? We would highly appreciate it if you could provide an example with a code.

    Leave a comment:


  • Sebastian Kripfganz
    replied
    I am unable to replicate this error message. I do not see how the option teffects can cause such a problem. Would it be possible for you to send me your data set by e-mail, so that I can investigate further?

    Leave a comment:


  • Tiyo Ardiyono
    replied
    Sorry, this is the error
    Attached Files

    Leave a comment:


  • Tiyo Ardiyono
    replied
    Dear Sebastian,

    I just found this problem recently. When I run the code below, xtdpdgmm produces the following error. While the second approach runs smoothly.

    Code:
    xtset id time
    global var ="grev i.sector"
    xtdpdgmm L(0/1).gempf $var, coll model(diff) gmm(gempf, lag(2 5)) gmm(grev, lag(2 5)) iv(i.sector, model(level)) two overid vce(robust) small teffect
    Error:


    Second approach (replacing teffect with quarter manually)
    Code:
    xtset id time
    global var ="grev i.sector q12019-q32021"
    xtdpdgmm L(0/1).gempf $var, coll model(diff) gmm(gempf, lag(2 5)) gmm(grev, lag(2 5)) iv(i.sector q12019-q32021, model(level)) two overid vce(robust) small
    [/CODE]
    Last edited by Tiyo Ardiyono; 17 Apr 2022, 23:50.

    Leave a comment:


  • Sebastian Kripfganz
    replied
    The test results do not provide much guidance regarding the matter of time effects. In general, time effects are typically recommended to capture some shocks that effect all groups equally. In the model with time effects, you could check whether the coefficients of the time dummies are jointly statistically significant. If they are not, you could possible remove them.

    Leave a comment:


  • Sarah Magd
    replied
    Dear Prof. Kripfganz,
    As you mentioned, my sample has only 28 groups which is relatively small and 11 years. Now, I am not sure whether I should control for the time-fixed effects or not.
    Could you please guide me on this issue?

    If I control for the time fixed effects (with the "teffects" option):
    Group variable: iso_num Number of obs = 332
    Time variable: year Number of groups = 28

    Moment conditions: linear = 36
    nonlinear = 0
    total = 36

    . estat overid

    Sargan-Hansen test of the overidentifying restrictions
    H0: overidentifying restrictions are valid
    2-step moment functions, 2-step weighting matrix chi2(17) = 9.4441 Prob > chi2 = 0.9253
    2-step moment functions, 3-step weighting matrix chi2(17) = 28.0000 Prob > chi2 = 0.0449

    . estat serial, ar(1/3)

    Arellano-Bond test for autocorrelation of the first-differenced residuals
    H0: no autocorrelation of order 1: z = -3.7625 Prob > |z| = 0.0002
    H0: no autocorrelation of order 2: z = -0.3943 Prob > |z| = 0.6934
    H0: no autocorrelation of order 3: z = 1.2813 Prob > |z| = 0.2001
    ################################################## ################################################## ##############

    If I do not control for the time fixed effects:

    Group variable: iso_num Number of obs = 332
    Time variable: year Number of groups = 28

    Moment conditions: linear = 28
    nonlinear = 0
    total = 28


    . estat serial, ar(1/3)

    Arellano-Bond test for autocorrelation of the first-differenced residuals
    H0: no autocorrelation of order 1: z = -3.9181 Prob > |z| = 0.0001
    H0: no autocorrelation of order 2: z = 1.7074 Prob > |z| = 0.0877
    H0: no autocorrelation of order 3: z = 1.0675 Prob > |z| = 0.2858

    . estat overid

    Sargan-Hansen test of the overidentifying restrictions
    H0: overidentifying restrictions are valid
    2-step moment functions, 2-step weighting matrix chi2(21) = 26.0563 Prob > chi2 = 0.2043
    2-step moment functions, 3-step weighting matrix chi2(21) = 28.0000 Prob > chi2 = 0.1402
    Last edited by Sarah Magd; 01 Apr 2022, 08:20.

    Leave a comment:


  • Sebastian Kripfganz
    replied
    Originally posted by Sarah Magd View Post
    Can we use xtdpdgmm or xtabond2 to estimate a dynamic panel threshold model?
    If the threshold is known, you can simply incorporate interaction terms of your variables of interest with a threshold indicator variable into your model. This would then still be estimable with these commands. You cannot use these commands to estimate an unknown threshold.

    Leave a comment:


  • Sarah Magd
    replied
    Dear Prof. Kripfganz,

    Can we use xtdpdgmm or xtabond2 to estimate a dynamic panel threshold model?

    Leave a comment:


  • Sebastian Kripfganz
    replied
    I am afraid there is not much I can say. You seem to have a challenging data set.

    Leave a comment:


  • Sarah Magd
    replied
    Dear Prof. Kripfganz,
    Thanks a lot for your reply.
    I have tried what you have recommended. The results of the tests became:

    . estat serial, ar(1/3)

    Arellano-Bond test for autocorrelation of the first-differenced residuals
    H0: no autocorrelation of order 1: z = -1.4629 Prob > |z| = 0.1435
    H0: no autocorrelation of order 2: z = 1.2267 Prob > |z| = 0.2199
    H0: no autocorrelation of order 3: z = -1.1418 Prob > |z| = 0.2535

    . estat overid

    Sargan-Hansen test of the overidentifying restrictions
    H0: overidentifying restrictions are valid

    2-step moment functions, 2-step weighting matrix chi2(46) = 6.7936 Prob > chi2 = 1.0000

    2-step moment functions, 3-step weighting matrix chi2(46) = 28.0000 Prob > chi2 = 0.9833

    ################################################## #########################
    Now, the problem is that AR(1) is insignificant. what would you suggest in this case?

    Leave a comment:

Working...
X