Saturday, October 06, 2007

Period effect in Stata

If the time variable is age, how to get Stata to estimate period effect? For a long time, a thought the only way was to use a discrete-time approach: create person-year data format, then estimate either LOGIT or CLOGLOG model. The problem with this approach is: when dealing with large data sets, it becomes impossible to expand the data 10 to 20 times or even more (depends on the duration and the time scale). The only feasible way to get period effect is to use aML's multiple clock capability.

By carefully reading the manual, I realize there is a way to do this. In my schizophenia case, I do the following:
  • stset dura_cal, f(event) origin(time birth) id(id)
  • stsplit p, at(0, 16, 26) after(time=1949)
Now the STSPLIT command with the "after()" option has correctly splited in data into four segments that represent "before 1949", "1949-1965", "1966-1976", and "after 1976". A simple Cox model can be used to see if the rate of schizophenia is particularly higher in any of the periods:
  • xi: stcox i.p

No comments:

Counter