Announcement

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

  • cmp with panel data

    David Roodman. Excuse me, Sir, a quick question. How can I use cmp command to run a two-way fixed model drawing from panel data? Is the command below correct? Does it account for the panel structure of the data? Please note that Y1 appears two times, once as dependent and once as an independent variable.

    Code:
    cmp (Y1 = X1 X2 X3 X4 i.shock_dummy i.year i.country) ///
        (Y2 = Y1 X1 X2 X3 X5 i.shock_dummy i.year i.country), ///
        ind($cmp_cont $cmp_cont)

  • #2
    Yes, that works, as long as it doesn't generate more dummies than your version of Stata can handle.
    --David

    Comment


    • #3
      Seems to me that the specification in #1 is a standard instrumental variable regression. If you hit Stata's limits -xtivreg- and -xtivreg2- can do the job too.

      Comment


      • #4
        David Roodman. Thank you. But does this account for the panel structure of the data?

        Comment


        • #5
          Joro Kolev. Thank you for the suggestion. I tried ivreg but it did not yield the same results. Please see the command below.
          Code:
          xtivreg Y2 = Y1 X1 X2 X3 X5 i.shock_dummy i.year i.country (Y1 = X1 X2 X3 X4 i.shock_dummy i.year i.country), fe

          Comment


          • #6
            Well, the two models are not quite the same because the cmp command line puts X5 in the Y2 equation but not the Y1 equation, whereas all the standard iv commands will include all the Y2 variables in the Y1 equation too.

            Comment


            • #7
              David Roodman. Many thanks for the elaboration. Then, I will go with the cmp command because of the model specification. One more question if you may allow me: Does the cmp command in my original post account for the panel structure of my data? Thanks again.

              Comment


              • #8
                "account for panel structure" is a bit vague. If you think the panel structure only affects your outcome and endogenous variables in the way implied the dummy sets you've included, then yes it accounts for the panel structure. Including dummies for both the time and cross-section dimensions is a normal thing to do. One might also cluster standard errors by one or the other dimension (or both, perhaps using boottest). And one in principle might make the model dynamic, so that lagged variables appear on the right side--but that is a major change.
                Last edited by David Roodman; 30 Oct 2020, 07:21.

                Comment

                Working...
                X