Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: RE: Converting string variable name into numbers


From   Michael Horowitz <[email protected]>
To   [email protected]
Subject   Re: st: RE: Converting string variable name into numbers
Date   Fri, 13 May 2005 12:26:43 -0400 (EDT)

I tried that and it said "type mismatch"

On Fri, 13 May 2005, Jose Valderrama wrote:

> Hi Michael,
>
> g language2=language=="English"
>
> -----Mensaje original-----
> De: [email protected]
> [mailto:[email protected]] En nombre de Michael
> Horowitz
> Enviado el: Viernes, 13 de Mayo de 2005 11:15 a.m.
> Para: [email protected]
> Asunto: st: Converting string variable name into numbers
>
> I am currently working with a survey dataset that includes responses
> from
> participants regarding their dominant language.  The answers are string
> variables, since they are "english", "spanish", etc.  Basically the data
> looks like this
>
> Obs1		English
> Obs2		Spanish
> Obs3		French
> Obs4		English
>
>
> I would like to create dummy variables where every "english" response
> gets
> coded a 1 and other responses are coded a 0, do the same thing for
> "spanish", etc. .
>
> Any ideas?  Thank you in advance for the assistance.
>
> Michael Horowitz
>
> ************************************************************************
> *******
>
> Michael Horowitz
> 78 Kirkland Street, #1
> Cambridge, MA 02138
>
> *
> *   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/
>
> *
> *   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/
>

*******************************************************************************

Michael Horowitz
78 Kirkland Street, #1
Cambridge, MA 02138

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