[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
st: using egen for categorical variable indicating groups
Hi,
I am trying to generate categorical variable indicating income groups. My
income variable is y. Here is what I am doing:
qui sum y
local max=r(max)
kdensity y [aw=wt], n(100) nograph
local width=r(scale)
egen ygroup=cut(y), at(0(`width')`max') icodes
But I get this error when I run the last line:
{ required
I am not sure where I am missing brackets. I have also tried the following
but it didn't help.
egen ygroup=cut(y), {at(0(`width')`max')} icodes
Any help would be appreciated.
Cheers,
Shehzad
*
* 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/