Announcement

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

  • #31
    Dear Sebastian,

    I continue to work with this command. Please the postestimate code is it same? and please some condition exist about the quality of model?

    thanks

    Comment


    • #32
      You can use the postestimation command estat overid for the Hansen overidentification test both after the first-stage and the second-stage estimation command. In your case, it will not be useful after the second stage because it is exactly identified. (You have exactly as many instruments as second-stage regressors.) The postestimation command estat serial for the Arellano-Bond serial correlation test only works after the first-stage estimation command.

      After the first stage, the Arellano-Bond test should reject the null of no serial correlation in the first-differenced errors of order 1; but should not reject the null for order 2 (and higher). The Hansen test should not reject the null that all overidentifying restrictions are valid, i.e. that the model is correctly specified.
      https://twitter.com/Kripfganz

      Comment


      • #33
        Hello Sebastian

        Please when I run the postestimation test with the estat overid command that you gave. the result is unsual

        Hansen's J-test for equation _second chi2(0) = 0.0000
        note: coefficients are exactly identified Prob > chi2 = .

        Please let me hnow if it is normal because I did not have information on probability and that is only postimation test that I receive.

        Futhermore, I need to have a marginal effect with some variable. Can you help me with command and tutorial to make it very well?

        very thanks professor

        Comment


        • #34
          Dear Sebastian, I have a panel dataset composed of 28 Ns and 20 Ts. I have a dynamic model to estimate. Is it appropriate to use your command?
          Thanks!

          Comment


          • #35
            pierre christian:
            Your second-stage model is exactly identified. You have 3 regressors (legor_fr legor_uk pro) and the same 3 instruments. That leaves 3-3=0 degrees of freedom for the overidentification test. Hence, it is not possible to carry out this test after the second stage and that is why the p-value is missing. You could do it after the first stage, e.g.
            Code:
            xtdpdgmm fdi L.fdi xconst gdp ipc pop gov invest rent trade, gmmiv(L.fdi, model(difference) lagrange(1 4) collapse) iv(xconst gdp ipc pop gov invest rent trade, difference model(difference)) twostep vce(robust) noserial aux
            
            estat overid
            
            xtseqreg fdi (L.fdi xconst gdp ipc pop gov invest rent trade) legor_fr legor_uk pro, first(, copy) iv(legor_fr legor_uk pro, model(level)) vce(robust)
            I am not sure what you have in mind when you say "marginal effect". In such a linear model, the marginal effect is just the coefficient of the respective variable.

            adam verdi:
            Your data set is relatively small, in particular in the cross-sectional dimension. You could use a dynamic model (and thus my command) if you make sure that you only utilize a very small number of instruments (in particular no GMM-type instruments). In any case, the results may not be very robust. With 20 time periods, you might even consider using the standard fixed-effects estimator if your dependent variable is not too persistent.
            https://twitter.com/Kripfganz

            Comment


            • #36
              Let me sent you one paper to show you something that i call margin effect. see on page 123. thr authors did "Marginal effects of fiscal rule index on bond spreads (based on specification)" on figure 3.
              I want to it in my work. for exemple the margin effect between FDI and xconst. please help me with the stata precedure
              Attached Files

              Comment


              • #37
                Please do not upload documents here that are subject to authors' or publisher's copyright restrictions.

                These authors have interaction effects in their model. The standard way in Stata to compute marginal effects after models with interaction effects would be to use the margins postestimation command. Unfortunately, the xtseqreg command currently does not support margins.

                In your model, you do not even have interaction effects. Without interaction effects, the marginal effect of xconst on fdi is really just the coefficient of xconst.
                https://twitter.com/Kripfganz

                Comment


                • #38
                  hello Sebastien,

                  Please if it exist the real difference between xtseqreg procedure and the combinate xtgmm and xtseqreg command. I am confuse. then you run xtseqreg command why do you know that all the model verification test is ok (autocorrelation 1 or 2; hausman test and hansen test). please clarify it to me.

                  thanks

                  Comment


                  • #39
                    As long as you are only using linear moment conditions, xtseqreg can do everything that xtdpdgmm does. The latter obtains the estimates by numerical optimization, while the former uses analytical solutions (which should not matter for practical purposes).

                    xtdpdgmm can utilize the nonlinear Ahn-Schmidt moment conditions. This is not possible with xtseqreg.

                    xtseqreg is primarily designed to estimate two-stage models that require a correction of the standard errors in the second stage. For the first stage, you can use either xtseqreg or xtdpdgmm, depending on whether you need the nonlinear moment conditions or not.

                    Both commands provide Arellano-Bond autocorrelation tests and Hansen tests as postestimation features. Please see for example help xtseqreg postestimation. The specification is not rejected if the AR(1) test rejects the null hypothesis of no first-order serial correlation but the AR(2) and all higher-order tests do not reject the null hypothesis of no second-order (or higher) serial correlation. The Hansen test should not reject the null hypothesis of joint validity of the overidentifying restrictions, i.e. the p-value should be larger than you chosen significance level.
                    https://twitter.com/Kripfganz

                    Comment


                    • #40
                      thanks professor,

                      Please when i run estat serial, ar(1/2) command, stata show me this message: estat serial not allowed after xtseqreg with two equations
                      r(198);
                      Please I am confuse

                      Comment


                      • #41
                        You need to run estat serial after the first command, i.e. directly after xtdpdgmm in my example in post #35. It tests for the serial correlation in the first stage.
                        https://twitter.com/Kripfganz

                        Comment


                        • #42
                          Hello professor,

                          please, when I run this command : xtseqreg llfdi (L(1/1).llfdi dejure dlmgdp ipc durban gov invest rent trade pro) legor_uk, gmmiv(L.llfdi, model(difference) lagrange(1 4) collapse equation(#1)) iv(dejure dlmgdp ipc durban gov invest rent trade pro, difference model(difference) equation(#1)) iv(rent dlmgdp legor_uk, model(level) equation(#2)) twostep vce(robust) both

                          After it i need to have inforamtion about estat serial test (estat serial, ar(2)) but stat told me that estat serial not allowed after xtseqreg with two equations.

                          Please can you help me with good synthax

                          when I use this syntax:xtdpdgmm llfdi L.lfdi gapinst dlmgdp ipc durban gov invest rent trade legor_uk pro, gmmiv(L.lfdi, model(difference) lagrange(1 4) collapse) iv(gapinst dlmgdp ipc durban gov invest rent trade pro, difference model(difference)) twostep vce(robust) noserial aux
                          estat serial, ar(1/2)
                          xtseqreg llfdi (L.lfdi gapinst dlmgdp ipc durban gov invest rent trade legor_uk pro) legor_uk, first(, copy) iv(legor_uk agepp rent dlmgdp, model(level)) vce(robust)


                          the message is cannot compute scores after xtdpdgmm

                          I am confuse please help me about two case

                          Comment


                          • #43
                            In your first case, xtseqreg only estimates the second stage. It is currently not possible to use estat serial after this second-stage estimation.

                            The second case should work in principle. Could you please double check whether you really have specified the option aux with xtdpdgmm. Without this option, you would indeed receive this error message from xtseqreg but with the option it should work. Please also make sure that you are using the latest version of xtseqreg:
                            Code:
                            adoupdate xtseqreg, update
                            If it still does not work, please show us a minimal example with full Stata output. For example, the following works:
                            Code:
                            . webuse psidextract
                            
                            . xtdpdgmm lwage L.lwage union, gmmiv(L.lwage, c m(d)) iv(union, m(d)) twostep vce(robust) noserial aux
                            
                            Generalized method of moments estimation
                            
                            Step 1
                            initial:       f(p) =  273.70538
                            alternative:   f(p) =  234.56398
                            rescale:       f(p) =  9.9241154
                            Iteration 0:   f(p) =  9.9241154  
                            Iteration 1:   f(p) =  .00507691  
                            Iteration 2:   f(p) =  .00194902  
                            Iteration 3:   f(p) =  .00194897  
                            
                            Step 2
                            Iteration 0:   f(p) =  .10513125  
                            Iteration 1:   f(p) =  .10145767  
                            Iteration 2:   f(p) =  .10144238  
                            Iteration 3:   f(p) =  .10144236  
                            
                            Group variable: id                           Number of obs         =      3570
                            Time variable: t                             Number of groups      =       595
                            
                            Moment conditions:     linear =       7      Obs per group:    min =         6
                                                nonlinear =       4                        avg =         6
                                                    total =      11                        max =         6
                            
                            ------------------------------------------------------------------------------
                                   lwage |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
                            -------------+----------------------------------------------------------------
                                /L.lwage |   .9488737   .0140053    67.75   0.000     .9214237    .9763236
                                  /union |  -.0612932   .0598509    -1.02   0.306    -.1785988    .0560124
                                  /_cons |   .4551424   .0879254     5.18   0.000     .2828118     .627473
                            ------------------------------------------------------------------------------
                            
                            . estat serial
                            
                            Arellano-Bond test for autocorrelation of the first-differenced residuals
                            H0: no autocorrelation of order 1:     z =   -4.7541   Prob > |z|  =    0.0000
                            H0: no autocorrelation of order 2:     z =    2.5067   Prob > |z|  =    0.0122
                            
                            . xtseqreg lwage (L.lwage union) ed, first(, copy) iv(occ ind) vce(robust)
                            note: first-stage standard errors may not be robust
                            
                            Group variable: id                           Number of obs         =      3570
                            Time variable: t                             Number of groups      =       595
                            
                            ------------------------------------------------------------------------------
                            Equation _first                              Equation _second
                            Number of obs         =      3570            Number of obs         =      3570
                            Number of groups      =       595            Number of groups      =       595
                            
                            Obs per group:    min =         6            Obs per group:    min =         6
                                              avg =         6                              avg =         6
                                              max =         6                              max =         6
                            
                                                                         Number of instruments =         3
                            
                                                                 (Std. Err. adjusted for clustering on id)
                            ------------------------------------------------------------------------------
                                         |               Robust
                                   lwage |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
                            -------------+----------------------------------------------------------------
                            _first       |
                                   lwage |
                                     L1. |   .9488737   .0140053    67.75   0.000     .9214237    .9763236
                                         |
                                   union |  -.0612932   .0598509    -1.02   0.306    -.1785988    .0560124
                                   _cons |   .4551424   .0879254     5.18   0.000     .2828118     .627473
                            -------------+----------------------------------------------------------------
                            _second      |
                                      ed |   .0005337   .0067663     0.08   0.937    -.0127281    .0137955
                                   _cons |  -.0047338    .085639    -0.06   0.956    -.1725832    .1631155
                            ------------------------------------------------------------------------------
                            Aside from that, you should not specify the same variable (legor_uk) both in the first and the second stage. In your case, you probably want to remove it from the first-stage specification. Furthermore, if legor_uk is your only regressor in the second stage and you are using it also as an instrument for itself (thus treating it as exogenous), then the additional instruments agepp rent dlmgdp are completely redundant.
                            https://twitter.com/Kripfganz

                            Comment


                            • #44
                              Please professor I have a same problem.

                              When I update xtseqreg that is the message that i receive from stat: adoupdate xtseqreg, update
                              (note: adoupdate updates user-written files; type -update- to check for updates to official Stata)

                              Checking status of specified packages...

                              [5] xtseqreg at http://fmwww.bc.edu/repec/bocode/x:
                              installed package is up to date

                              (no packages require updating)

                              Comment


                              • #45
                                To help you further, I need to see the exact output that Stata produced. If you cannot show me the estimation output with your data set for confidentiality reasons, please try to replicate the problem with a publicly available data set.
                                https://twitter.com/Kripfganz

                                Comment

                                Working...
                                X