Statalist


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

Re: st: Command related to putting categories into separate columns


From   Olalekan Uthman <uthlekan@yahoo.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Command related to putting categories into separate columns
Date   Sat, 19 Jul 2008 00:04:11 -0700 (PDT)

Hi,

tab education, gen(education)



Olalekan Uthman


--- On Sat, 7/19/08, Ziad El-Khatib <Ziad.El-Khatib@ki.se> wrote:
From: Ziad El-Khatib <Ziad.El-Khatib@ki.se>
Subject: st: Command related to putting categories into separate columns
To: statalist@hsphsun2.harvard.edu
Date: Saturday, July 19, 2008, 7:53 AM

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/


      

*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index