I think you can get the desired result with a slight modification:
. gen long obs=_n
. expand 4
. sort obs
. egen animal = fill(1,2,3,4,1,2,3,4)
. label define critter 1 "cat" 2 "dog" 3 "rat" 4 "fish"
. label value animal critter
. decode animal, gen(str_animal)
-----Original Message-----
From: Wallace, John [mailto:[email protected]]
Sent: Wednesday, September 01, 2004 11:51 AM
To: '[email protected]'
Subject: st: egen fill() for string variables?
would a workaround such as the following work?
. expand 4
. egen animal = fill(1,2,3,4,1,2,3,4)
. label define critter 1 "cat" 2 "dog" 3 "rat" 4 "fish"
. label value animal critter
. decode animal, gen(str_animal)
*
* 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/