Announcement

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

  • how to use stored estimates for contrasts in fixed effects regressions?

    Hello All,
    This must be a simple problem - but I have searched for a day and somehow cannot find the answer...
    I am trying to do across-sample contrasts in fixed effects regressions - but I cannot find the syntax for it:

    xtreg y x1 x2 if subsample==1, fe
    est store M1

    xtreg y x1 x2 if subsample ==2, fe
    est store M2

    I want to do something like
    test M1_x1 - M2_x2
    test M1_x2 - M2_x2

    I can manually calculate the difference, but was hoping there is a stata command for me to do this?
    Many Thanks.



    Last edited by kann sriki; 10 May 2019, 13:29.

  • #2
    Actually, you can't do this. The command that is usually used for cross-regression estimation, -suest- does not support -xtreg-.

    However, you can get what you want in a completely different way:

    Code:
    xtreg y i.subsample##c.(x1 x2), fe
    The coefficient of 2.subsample#x1 will be the difference between M1:x1 and M2:x1, and the coefficient of 2.subsample#x2 will be the difference between M1:x2 and M2:x2.

    I am assuming that your variable subsample takes on only the two values 1 and 2.

    Comment


    • #3
      Thanks!

      Comment

      Working...
      X