Announcement

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

  • area specific linear time trend

    I have 2012-2018(Aug) monthly data, there are 80 (6*12+8) time periods. 52 areas in the data set

    I have Year and Month in the data. How do I control area specific trend?

    coding of the time variables:
    year_month: 1-80
    year:2012-2018
    year sequence: 1-7
    month_sequence:1-12


    is the below code correct for controlling area specific time trend?

    xtset area_id year_month

    xtreg Y X c.year_sequence*i.area_id c.month_sequence*i.area_id To approve a single suggestion, mouse over it and click "✔"
    Click the bubble to approve all of its suggestions.

    Log in
    to use Ginger

    Limited mode
    Is the below code correct for controlling
    ×


  • #2
    Katie:
    you should consider -fvvarlist- notation for creating interactions, too (instead that doing them by hand).
    As far as your code is concerned, you may want to try something along the following lines:
    Code:
    xtreg Y X c.year_sequence##i.area_id c.month_sequence##i.area_id
    Admittedly, I'm not clear why including both year and month sequences in the right-hand side of your regression equation, but you'll surely have good reasons to follow this approach.
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      Originally posted by Katie Zhang View Post
      I have 2012-2018(Aug) monthly data, there are 80 (6*12+8) time periods. 52 areas in the data set

      I have Year and Month in the data. How do I control area specific trend?

      coding of the time variables:
      year_month: 1-80
      year:2012-2018
      year sequence: 1-7
      month_sequence:1-12


      is the below code correct for controlling area specific time trend?

      xtset area_id year_month

      xtreg Y X c.year_sequence*i.area_id c.month_sequence*i.area_id To approve a single suggestion, mouse over it and click "✔"
      Click the bubble to approve all of its suggestions.

      Log in
      to use Ginger

      Limited mode
      Is the below code correct for controlling
      ×
      Hi Carlo, thanks for your reply.


      1. I am not sure whether including both year and month are correct. My goal is to control for specific area trend. what do you think is a correct way?

      I expect there is yearly trend and also within year, there is maybe variation.




      2. another question is in you code, you use ##

      is that necessary to use ##? because the area fixed effect is automatically included (xtset areaid year_month).


      I mean whether we should use # instead of ##?

      Log in
      to use Ginger

      Limited mode
      I mean whether
      ×

      Comment

      Working...
      X