Announcement

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

  • How to do the first difference regression using xtreg () rather d.

    For example, I find a lot of people using xtreg d.y d.x1 d.x2 to run the first difference panel regression.
    However, if there is a command using xtreg y x (some code defining first difference) to run the first difference panel regression.

    What if I don't want the d. and gen d.variable to defien first difference, is there any other way.

  • #2
    If google xtreg, fd stata, you'll find several discussions of this issue.

    Comment


    • #3
      Originally posted by Phil Bromiley View Post
      If google xtreg, fd stata, you'll find several discussions of this issue.
      No thing there. They are either using d. or gen command.

      Comment


      • #4
        You can use -xtivreg2- to do this (without doing IV):

        Code:
        use http://fmwww.bc.edu/ec-p/data/macro/abdata.dta, clear
        tsset id year
        xtivreg2 ys k, fd robust cluster(id) small
        reg D.(ys k), cluster(id)
        Last edited by Dimitriy V. Masterov; 20 Feb 2018, 17:00.

        Comment


        • #5
          Also, the regular -xtivreg- can do it, but the syntax bugs me:

          Code:
          xtivreg ys (k = k), fd regress vce(cluster id) small
          xtivreg2 is from SSC.

          Comment

          Working...
          X