Announcement

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

  • State specific linear trends

    I want to run a diff-in-diff model including state-specific linear trends. The code I am currently running is the following

    Code:
    preserve
    keep if (state == 2|state == 5|state == 6|state == 8) & year >= 1984
    reg log_GON time_decr treated_decr did_decr i.year i.state c.year#i.state, cluster(state)
    restore
    where time_decr is the post dummy, treated_decr is the treatment dummy and did_decr is the diff-in-diff term (time_decr*treated_decr).

    Then I added time and state fixed effects using factor notation as i.state and i.year and I am trying to include state-specific linear trends. My treatment group is made of one only state (#2), while my control group is made of states #5, #6, #8. Adding the term c.year#i.state I think I am adding all the interactions between years and states, so it seems right to me.

    Still I have some doubts: the first one is about the use of i. or c. From what I got c. should be used with continuous variables, while i. with binary variables. Is it right? Would it make sense in my case? And more in general, do you think my specification make sense?

    If you need I can provide a sample of my dataset.


  • #2
    You didn't get a quick answer. You'll increase your chances of a useful answer by following the FAQ on asking questions - provide Stata code in code delimiters, readable Stata output, and sample data using dataex.

    First, you don't need to preserve and restore - just use the stuff after your if statement as a condition on the reg. If you're using panel data, then the panel data procedures (xtreg in this case) may be easier to work with. You are right, but the difference is more than that. With c., Stata treats the variable as continuous so year is a variable like any other. If you use i. then Stata treats the variable as a set of dummies which is a much more flexible specification than assuming year has a linear influence.

    You should see Stata will also do the did_decr using factor variable notation. Whether your model makes sense is really a substantive issue on which we can't say much.

    Comment


    • #3
      Thanks for your suggestions.

      I actually changed my specification a bit to

      Code:
      reg log_GON did_decr state_dummy5 state_dummy6 state_dummy8 i.year c.year#2.state if state == 2|state == 5|state == 6|state == 8 & year >= 1984, cluster(state)
      using your suggestions and the answer by Andy here https://stats.stackexchange.com/ques...e-time-periods.



      Comment

      Working...
      X