Statalist


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

st: Command related to putting categories into separate columns


From   "Ziad El-Khatib" <[email protected]>
To   [email protected]
Subject   st: Command related to putting categories into separate columns
Date   Fri, 18 Jul 2008 22:53:42 -0700

Hi!
I used to recall this command and I have been trying to figure it out
again for 10 days now, so gave up and will try to put it on the list
for tips?

I have variable 'education' with 4 levels of education: lev1, lev2,
lev3 and lev4
The one line command can create new variables: _lev1, _lev2, _lev3 and
_lev4  with values (0/1)

I know I could do gen _lev1=1 if education==lev1 etc... but I thought
it will be nice to just use one liner for it.

Thank you in advance and best regards
ziad
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



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