Announcement

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

  • How to run model with 3SLS, with fixed effects?

    Hi All,


    how to conduct the following model in stata? It's simultaneous equations with two way fixed effects.

    two fixed effects: id and year

    Two equations:

    y1=x1+x2+x3+y2

    y2=y1+x2+x3+y1




    Thanks!



  • #2
    The second equation cannot be correct. Also, what are your N and T dimensions?

    Comment


    • #3
      Originally posted by Jeff Wooldridge View Post
      The second equation cannot be correct. Also, what are your N and T dimensions?
      sorry, the second equation is y2=x1+x2+x3+y1

      N is id. T is year.

      Comment


      • #4
        Sorry. I meant, how large are N and T? But before that, your model is not identified. You have all three exogenous variables in both equations, so neither equation is identified. You need an exclusion restriction in each equation for system estimation. If you are only interested in one of the equations, you need to impose an exclusion restriction on it.

        Comment


        • #5
          Originally posted by Jeff Wooldridge View Post
          Sorry. I meant, how large are N and T? But before that, your model is not identified. You have all three exogenous variables in both equations, so neither equation is identified. You need an exclusion restriction in each equation for system estimation. If you are only interested in one of the equations, you need to impose an exclusion restriction on it.
          N is from 1 to 14k, T is from 1 to 157.

          Sorry, I am kind of confused. Does it mean that I need to include some variables in equation 2, which do not appear in equation 1?





          Thanks!

          Comment


          • #6
            Yes. And vice versa. If your theory doesn’t give you clear exclusion restrictions then a simultaneous equations model is not appropriate. And we can’t help because you’ve used x and y.

            Comment


            • #7
              Hi,

              I think Katie's problem has not been solved yet. Consider a similar case using multiple instruments for multiple endogenous regressors (e.g. in a Cobb-Douglas production function with multiple endogenous input factors):

              One could estimate a model with say two endogenous regressors and 2 exogenous instruments (just identified) using ivreg3:
              Code:
              reg3 (y x1 x2 x3) (x2 x4 x1) (x3 x5 x1)
              where x1 is strictly exogenous;
              x2 and x3 are endogenous;
              x4 and x5 are exogenous instruments

              So to improve the model fixed effects for panel data would be nice
              Is it also correct to include x1 in all first stage regressions? I am not sure about that.

              Maybe you could use the least squares dummy variable (LSDV) estimator by including something like i.id in your model. But I think you lose a considerable amound of degrees of freedom here compared to the fixed effects estimator.

              Furthermore, to adequately test for weak instruments, there is the user-written program weakivtest, but it only works for ivregress and ivreg2 which do not offer multiple first stage equations for multiple endogenous variables. Does anyone have an idea?

              Comment


              • #8
                It's a bit dangerous outside the basic model to simply include dummy variables to capture the fixed effects. Unless it's been show to be consistent that should not be assumed. Katie, I think, had no exclusion restrictions, and so an SEM is not appropriate.

                My main gripe with reg3 is that it has no option for robust standard errors. One would like standard errors that are robust to system heteroskedasticity or serial correlation (like newey-west) or cluster correlation. reg3 is behind the times. Virtually every estimation method can be combined with robust standard errors. I don't see there's a way to do traditional 3SLS with the gmm command without basically programming the entire thing yourself. I would add that to a Stata 17 wish list.

                Comment


                • #9
                  Hi Tim,
                  Assuming that the model is actually identified, ie. one has excluded restrictions cross all equations, I think the inclusion of fixed effects can be done as follows:
                  s1. Demean (or rather absorbe) the effect of all fixed effects on all exogenous and endogenous variables.
                  s2, Estimate the 3sls using the demeaned variables
                  s3. Adjust for the degrees of freedom.
                  This is, at least, what in principle is done by ivreg2, when using many fixed effects.
                  Fernando

                  Comment


                  • #10
                    @Jeff: That's a valid point with reg3 and robust standard errors. But it's the only command to specify individual first stage regressions for multiple endogenous variables. ivreg2 and others combine all endogenous regressors and instruments in one single system in brackets, which is a little too simple I guess. Or did I miss something?

                    @Fernando: Hm, is demeaning really appropriate? I think you lose the same amount of df as with LSDV. But if this works that might be a way to "estimate around" the true model. And how do I ex post adjust the df?

                    For Katie's case there is indeed no external instrument. To remind you: you need at least one regressor not included in both equations to identify a system of simultaneous equations if you do not want to go into advanced approaches like Arellano/Bond or Lewbel.

                    Comment


                    • #11
                      Hi Tim,
                      When i was working on my own version of models with high order fixed effects, I actually play around with this problem, at least in the case of Instrumental variables, and it works empirically. I didnt test it for 3sls, but I do not see why it wouldnt work.
                      Regarding the DF, I think that depends. I believe strongly that one should adjust all VCV matrices as follows:
                      e(Vnew)=e(Vold)*(n-k)/(n-k-NFE)
                      where NFE is the number of degrees of freedom lost due to the fixed effects.

                      However, when I was working on this, I realize that ivreg2 did not used this correction factor, so I cannot be sure what is the correct practice.
                      Fernando

                      Comment


                      • #12
                        Your df correction seems reasonable. But for the typical panel case of large N and small T there are a lot of FE to be estimated, similar to the LSDV estimator (which Jeff scrutinzes). So this could increase standard errors a lot! Do you have experience in practical application? And maybe you have a citation hint for that correction

                        Comment


                        • #13
                          Hi Tim
                          Yes, when N is large and T is small, the adjustment will make the standard errors quite large. But that is what HAS to be done. The difference with the LSDV is that if you do not include the dummies (but rather "absorb" them) there is less computational burden, but you still need to adjust for the degrees of freedom.
                          I can suggest two references:
                          https://www.stata-journal.com/articl...article=st0409
                          This is my version of the more popular "reghdfe", where I suggest how to account for the number of fixed effects that cannot be estimated. There are some references there that you could cite too.
                          You could also look under the Frisch Waugth Theorem literature, for more formal references adjusting for the degrees of freedom.
                          One more note. My proposed adjustment of fixed effects is valid for cases where you have many fixed effects, but not necessarily when you have panel data. Kind of the difference in how "areg" estimates the standard errors adjusted for absorbed fixed effects vs how "xtreg,fe" adjustes the standard errors.

                          Best
                          Fernando

                          Comment


                          • #14
                            hi everyone,

                            I have a triangular simultaneous equation model, (N=24, T=9)


                            Two equations:

                            y1=x1+x2+x3 (TFP growth model for country i ,y1: TFPgrowth; x1: domestic R&D capital stock(t-1), x2:foreign R&D capital stock (t-1), x3: environmental variables ), x2 and x3 are correlated

                            y2=y1hat+z1+z2+z3+z4+x2 (gravity export model, y2: bilateral export from country i to country j; y1hat: predicted TFP growth model, z1: GDP for country i, z2 :GDP for country j, z3: distance, z4: environmental variables and dummy variables, x2:foreign R&D capital stock (t-1)


                            I regressed this model using the IV-2SLS estimation but I could not find valid instruments.

                            how can I measure this type of model?

                            thanks in advance

                            best regards

                            gamze
                            Last edited by gamze saglam; 05 Jul 2021, 16:09.

                            Comment


                            • #15
                              Is there a problem for consistence in estimating by GMM 3SLS a simultaneous three equations model for a panel data, for instance, with T=17 years and N=10 cross-section units? Is there a problem for estimation consistence here as a result of T being bigger than N?
                              Last edited by Moises Resende; 29 Oct 2021, 06:20.

                              Comment

                              Working...
                              X