I want to be able to take the time variable in an xtset data set (or else create a new variable) and have it be coded 1, 2, ..., T. This is easy to do if, say, time is coded as year, e.g. if the coding is 1976, 1977, ..., 1984, all I have to do is subtract 1975 from each value. But, there are so many different ways of coding time that I want something that will always work. Maybe use the group function of egen, but it would be nice if it could somehow take into account uneven intervals, e.g. 1975, 1976, 1978, 1979.. i.e. I don't want 1978 coded as 3, I would want it coded as 4. (This would be a situation where no case has data for 1977).
I am working on a routine where the help file explicitly states that time needs to be coded 1, 2, 3, ..., T. But, everybody keeps on ignoring the warning so I want the program just to be able to recode time for the user.
I am working on a routine where the help file explicitly states that time needs to be coded 1, 2, 3, ..., T. But, everybody keeps on ignoring the warning so I want the program just to be able to recode time for the user.
Comment