Announcement

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

  • Tow stage Least Square (2SLS) estimation - dynamic panel models

    Hi experts and researchers,


    I have four models ( dynamic panel models ) :

    1- linear model
    GDP = β1 FDX + β2 INF + β4 GOV + β5 GFCF + β6 TRD + β7 LBOR

    2- model with an interactive term
    GDP = β1 FDX + β2 INF + β3 FDX * INF + β4 GOV + β5 GFCF + β6 TRD + β7 LBOR

    3- non-linear model :
    GDP = β1 FDX + β2 FDX2+ β3 INF + β4 GOV + β5 GFCF + β6 TRD + β7 LBOR

    4- non-linear with interactive term
    GDP = β1 FDX + β2 FDX2+ β3 INF + β4 FDX * INF + β5 FDX2 * INF + β6 GOV + β7 GFCF + β8 TRD + β9 LBOR

    Where GDP is the dependent variable, FDX is the endogenous variable and INF, GOV, GFCF, TRD and LBOR are the exogenous variables and lagged variables are used as the instrumental variables.


    What is the Tow Stage Least Square (2SLS) estimation command for each model, please?

    Can I use -xtivreg- with the fe option for the first model? if yes, what about the rest of the models ( 2, 3 and 4)


    I would be very grateful for any help


    Many Thanks

    Badiah

  • #2
    Any help!

    Comment


    • #3
      Badiah, given that your model specification and the selection of instrumental variables are correct (you should check that.), any variable involving FDX should be treated as endogenous and be instrumented with corresponding instrumental variables. For example, if the IV for FDX is the one-period lag of FDX (L.FDX), and then an IV for FDX2 would be (L.FDX)2, an IV for FDX2 * INF would be (L.FDX)2 * INF, etc. Before using the lagging operator (L.), you should declare panel structure using -xtset-. FYI, I'll give the code for the last model with fixed effects.

      Code:
      xtset panelvar timevar
      
      xtivreg GDP INF GOV GFCF TRD LBOR (FDX c.FDX#c.FDX c.FDX#c.INF c.FDX#c.FDX#c.INF = L.FDX cL.FDX#cL.FDX cL.FDX#c.INF cL.FDX#cL.FDX#c.INF), fe

      Comment


      • #4
        As an aside, the model does not seem to be dynamic. There are no lagged variables on the right-hand side, especially no lagged dependent variable. If you do not need them, fine, but then it's better to call it a static model.

        Furthermore, all of those models are still "linear in the parameters", which is what we usually call a linear model.
        https://twitter.com/Kripfganz

        Comment


        • #5
          Fei Wang Hi Fei, thank you very much for your help, your code is exactly what I'm looking for. I'm gonna apply it.

          Comment


          • #6
            Sebastian Kripfganz Hi Sebastian, thank you so much for your kindly responses. Yes, my models have lagged dependent variables.

            all of those models are still "linear in the parameters", which is what we usually call a linear model. Many thanks for your explanation, that's really helpful

            Comment


            • #7
              The code does not seem to have a lagged dependent variable included. If you do want to include a lagged dependent variable, be aware that the 2SLS-FE estimator can be severely biased when the time dimension of your sample is short. In the latter case, a GMM approach might be called for:
              https://twitter.com/Kripfganz

              Comment


              • #8
                Sebastian Kripfganz, Hi Sebastian, thank you so much for your kindly responses. In fact, yes, I have executed two-step system GMM including lagged dependent variable

                Where GDP is the dependent variable, FDX is the endogenous variable and INIGDPPC, INF, GOV, GFCF, TRD and LBOR are the exogenous variables and lagged variables are used as the instrumental variables.

                Code:
                xtabond2 rgdpg rgdpg_lag1 c.ihs_inigdppc c.fdxstwo c.fdxstwo##c.fdxstwo c.fdxstwo##c.ihs_inf c.fdxstwo##c.fdxstwo##c.ihs_inf c.ihs_inf c.ihs_gfcf c.ihs_gov c.ihs_trd ihs_lbor y*, gmm(c.fdxstwo c.fdxstwo##c.fdxstwo c.fdxstwo##c.ihs_inf c.fdxstwo##c.fdxstwo##c.ihs_inf, lag(. 2) collapse eq(diff)) iv(c.ihs_inf c.fdxstwo##c.ihs_inf c.fdxstwo##c.fdxstwo##c.ihs_inf ihs_gfcf ihs_gov ihs_trd ihs_lbor, eq(diff)) gmm(rgdpg_lag1 ihs_inigdppc , lag(1 3) collapse eq(level)) twostep robust
                IF my xtabond2 code is correct, now, I would like to execute 2SLS for robustness. However, you suggested that: "be aware that the 2SLS-FE estimator can be severely biased when the time dimension of your sample is short." yes I have T= 8, N = 43
                I follow the previous literature in using 2SLS after GMM as robustness and they also have dynamic panel data. I wonder if there is another 2SLS command for dynamic panel data? Correct me please if there is any mistake!

                I have very little experience in panel data analysis, any advice would be really helpful

                Thank you in advance!



                Comment


                • #9
                  You can use 2SLS for robustness analyses but you need to be careful in how you interpret the results. If the results differ between your GMM and 2SLS estimates, then this does not imply that the GMM results are not robust because the 2SLS estimator is biased. If the results do not differ, this also does not imply that the GMM results are robust. It might actually indicate a problem because we would expect the results to be different.

                  I suggest that you follow along the lines of the literature in your field. That should be the best guideline for your work.
                  https://twitter.com/Kripfganz

                  Comment


                  • #10
                    Sebastian Kripfganz Thank you so much

                    Comment


                    • #11
                      Fei Wang Hi Fei, I tried your code but stata give this message:

                      Code:
                      xtivreg rgdpg rgdpg_lag1 ihs_inigdppc ihs_inf ihs_gov ihs_gfcf ihs_trd ihs_lbor (c.fdxstwo c.fdxstwo##c.fdxstwo c.fdxstwo##c.ihs_inf c.fdxstwo##c.fdxstwo##c.ihs_inf = cL.fdxs two cL.fdxstwo##cL.fdxstwo cL.fdxstwo##c.ihs_inf cL.fdxstwo##cL.fdxstwo##c.ihs_inf), fe
                      depvars may not be interactions
                      r(198);
                      Could you help, please

                      Thank you in advance

                      Badiah

                      Comment


                      • #12
                        Originally posted by Badiah Eljahimi View Post
                        Fei Wang Hi Fei, I tried your code but stata give this message:

                        Code:
                        xtivreg rgdpg rgdpg_lag1 ihs_inigdppc ihs_inf ihs_gov ihs_gfcf ihs_trd ihs_lbor (c.fdxstwo c.fdxstwo##c.fdxstwo c.fdxstwo##c.ihs_inf c.fdxstwo##c.fdxstwo##c.ihs_inf = cL.fdxs two cL.fdxstwo##cL.fdxstwo cL.fdxstwo##c.ihs_inf cL.fdxstwo##cL.fdxstwo##c.ihs_inf), fe
                        depvars may not be interactions
                        r(198);
                        Could you help, please

                        Thank you in advance

                        Badiah
                        It seems xtivreg doesn't allow endogenous regressors to be in the form of interactions. Then you may generate them first. For example, gen fdxstwosq = fdxstwo^2, and replace c.fdxstwo#c.fdxstwo with fdxstwosq.

                        Comment


                        • #13
                          Fei Wang Hi Fei, Thank you very much it works well

                          Comment

                          Working...
                          X