Statalist


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

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


From   philippe van kerm <philippe.vankerm@ceps.lu>
To   "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu>
Subject   RE : st: Command related to putting categories into separate columns
Date   Sat, 19 Jul 2008 13:44:29 +0200

You may also want to check -dummieslab- from theSSC archive:

ssc install dummiesab

Philippe



________________________________________
De : owner-statalist@hsphsun2.harvard.edu [owner-statalist@hsphsun2.harvard.edu] de la part de Olalekan Uthman [uthlekan@yahoo.com]
Date d'envoi : samedi 19 juillet 2008 9:05
 : statalist@hsphsun2.harvard.edu
Objet : Re: st: Command related to putting categories into separate columns

Hi,

Try

tab education, gen(education)

OR

xi i.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/

*
*   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