Announcement

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

  • State-specific quadratic time trends

    Hi all,

    I am hoping to use state-specific trends within my regression. Currently I am only using linear trends, with the following code:

    Code:
     i.id##c.year
    I was hoping to instead use quadratic trends. I am currently trying to construct this in the following way:

    Code:
     year2 = year^2
    Code:
     i.id##c.year2
    I would really appreciate if someone could verify whether this is the correct way to include state-specific quadratic time trends.

    Thanks.

  • #2
    I think that if you include quadratic time trends, you must also include linear time trends. No need to manually code this

    Code:
     i.id##c.year##c.year

    Comment


    • #3
      When fitting trends in year, I usually centre the year in the middle of the data, and avoid using calendar years. This is because

      1. Year 0 (the year that didn't happen because BC and AD scales were devised before the idea of zero had reached Western Europe) is even notionally way outside most datasets.

      2. The intercept is then usually much easier to think about. Otherwise it can be ridiculously large or small, and even a value that isn't feasible.

      Tukey had a maxim "Estimate centercepts, not intercepts" but the only uses of the term I've encountered have been others citing him, implying that is oral tradition.

      See also https://journals.sagepub.com/doi/10....867X1501500215

      That's not your question, but the principle underlies this example:

      Code:
      webuse grunfeld, clear
      gen cyear = year - 1945
      gen invest_log = log(invest)
      reg invest_log  i.company##c.cyear##c.cyear
      predict invest_log_hat
      scatter invest_log_hat  year, ms(none) mla(company) mlabpos(0)
      The graph is a test of whether I got what I wanted.

      Click image for larger version

Name:	quadratic3.png
Views:	1
Size:	27.4 KB
ID:	1487278


      (Using logarithms isn't part of the answer, just a good idea with this example.)

      Comment

      Working...
      X