Hi everyone,

I was wondering if there was any way to create a variable that groups every 10 observations so that it looks like this:

Code:
* Example generated by -dataex-. To install: ssc install dataex
clear
input int date float(year dummy)
15341 2002 1
15342 2002 1
15343 2002 1
15344 2002 1
15347 2002 1
15348 2002 1
15349 2002 1
15350 2002 1
15351 2002 1
15354 2002 1
15355 2002 2
15356 2002 2
15357 2002 2
15358 2002 2
15361 2002 2
15362 2002 2
15363 2002 2
15364 2002 2
15365 2002 2
15368 2002 2
15369 2002 3
15370 2002 3
15371 2002 3
15372 2002 3
15375 2002 3
15376 2002 3
15377 2002 3
15378 2002 3
15379 2002 3
15382 2002 3
end
format %tdnn/dd/CCYY date
and so on (I have about 1500 observations)

Maybe this is only possible through loops? I've been trying to use command tsspell but I'm unsure of how to specify the condition in cond().

Thanks a bunch.