[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
st: egen, cut and labels
When using egen with the cut option, is it possible to get nice value
labels for the resulting variable? Let's say I have some fake data:
clear
set obs 100
gen x = uniform()
egen bins = cut(x), at(0(.1)1)
I would like to get value labels like "[0,.1)" and "[.1,.2)" ... and
"[0.9,1]". The labels option does not really do this. For the fake
data this is really trivial, but for a longer list this would be
complicated.
DVM
*
* 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/