Announcement

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

  • Time Fixed Effects and XTHREG

    Hello everyone,

    Does anyone know how to include time fixed effects in the threshold regression using the xthreg command? I am following the Hansen(1999) and code developed by Wang(2016)

    I try to include i.year in my regression but STATA returns: "factor variables no allowed"

    Is there any other way to include time fixed effects using xthreg?

    Thanks.

  • #2
    Well, I'm not familiar with -xthreg-; it's not part of official Stata and not something I've ever needed to use. But my guess is that it was written before Stata introduced factor variables, or, for whatever reason, the people who wrote it did not choose to have it support factor variable notation.

    So to get year indicators into it, you will have to do a workaround that generates your own indicator variables. The simplest way is to use -xi:-, which is how Stata dealt with indicator variables before factor variables were introduced. So
    Code:
    xi: xthreg ... i.year ...
    Warning: Do not try to use -margins- after this. The indicators for year produced by -xi:- are not recognized by -margins- and those variables could be mishandled.

    Comment

    Working...
    X