Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: egen, cut and labels


From   "Dimitriy V. Masterov" <dvmaster@umich.edu>
To   Statalist <statalist@hsphsun2.harvard.edu>
Subject   st: egen, cut and labels
Date   Fri, 26 Oct 2007 17:24:39 -0400

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/



© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index