Announcement

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

  • Comparing coefficients in separate regressions from different time periods

    Dear all,

    I want to compare the coefficients of the variable x from 2 different time periods and see if they are statistically different from each other. I use the code:

    .reg emp x y z i.year if year>2003

    .estimate store m1

    .reg emp x y z i.year if year<2004

    .estimate store m2

    .suest m1 m2, cluster(region)


    But Stata gives me an error saying that " year: factor variable base conflict". Is this because regressions are run on different time periods? is there a way to fix it and then test if coefficients of x are the same?

    Could you suggest any alternative ways?

  • #2
    Try:

    Code:
    reg emp x y z i.year if year>2003
    estimate store m1
    gen yr= year
    reg emp x y z i.yr if year<2004
    estimate store m2
    suest m1 m2, cluster(region)

    Comment


    • #3
      Thank you Andrew for your help. It works perfectly for OLS.

      However, do you know how to do suest with -ivreg-?

      e.g.

      ivreg2 emp (x=x1) y z i.year year>2003

      ....

      Comment


      • #4
        suest does not work with ivreg2 (from SSC), but the following may help.

        https://www.statalist.org/forums/for...ferent-samples

        Comment


        • #5
          Thank you Andrew it worked well!

          Comment

          Working...
          X