Announcement

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

  • Test for different time trend for different groups?

    I have panel data (`y`) at different time points (`t`) for individuals (`i`) in 2 different groups (`g`).

    I am trying to test if the coefficient of `t` on `y` is larger for individuals in group 2. In other words, is the time trend more steep for a given group?

    How would I go about doing that?

    There is likely auto-correlation at the `i` level. Data looks like this

    ```
    | y | t | i | g |
    |---|---|---|---|
    | 2 | 1 | 1 | 1 |
    | 4 | 1 | 2 | 1 |
    | 6 | 1 | 3 | 2 |

    ```

  • #2
    Something like:
    Code:
    xtset i t
    xtreg y i.g##c.t, fe vce(cluster i)
    margins g, dydx(t)
    The direct comparison of the time trend in group 2 vs group 1 will be found in the coefficient of 2.g#c.t.

    The code itself does not depend on the number of groups, though the output will reflect that and in the presence of more than 2 groups the interpretation depends on whether the desired comparison is between group 2 and group 1 or some other contrast among groups.

    Comment


    • #3
      Is this still valid if individuals are auto-correlated?

      Comment


      • #4
        Well, maybe you want Newey-West standard errors. See -help newey-.

        Comment

        Working...
        X