An indicator variable, in the jargon I know,
takes on one of two possible values. I am
not clear whether that is what you really
want here.
What you may want is some variation on -floor(date/10)-.
Nick
[email protected]
kelly johnson
> I have a variable, date (in %d format). There are numerous
> observations with
> the same date, although the number of observations with the
> same date is not
> constant. (also, there are gaps in the days). I want to
> create an indicator
> variable to group date in increments of 10 days. (for the
> first 10 days, i
> want the variable to be 1, the next 10 days, the observation
> to be 2 and so
> forth. Any help would be appreciated (if tried the -egen- seq
> commands, but
> haven't been able to get it to condition on date. Thank you!
> Date Indicator
> 02Jan2005 1
> 03Jan2005 1
> 04Jan2005 1
> 05Jan2005 1
> 05Jan2005 1
> 05Jan2005 1
> 05Jan2005 1
> 05Jan2005 1
> 05Jan2005 1
> 05Jan2005 1
> 05Jan2005 1
> 05Jan2005 1
> 05Jan2005 1
> 05Jan2005 1
> 05Jan2005 1
> 05Jan2005 1
> 05Jan2005 1
> 06Jan2005 1
> 09Jan2005 1
> 09Jan2005 1
> 09Jan2005 1
> 09Jan2005 1
> 10Jan2005 1
> 10Jan2005 1
> 10Jan2005 1
> 10Jan2005 1
> 10Jan2005 1
> 10Jan2005 1
> 10Jan2005 1
> 10Jan2005 1
> 10Jan2005 1
> 11Jan2005 1
> 11Jan2005 1
> 11Jan2005 1
> 11Jan2005 1
> 11Jan2005 1
> 11Jan2005 1
> 12Jan2005 1
> 13Jan2005 1
> 13Jan2005 1
> 13Jan2005 1
> 14Jan2005 1
> 15Jan2005 2
> 16Jan2005 2
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/