Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: converting string to numerals


From   ramesh <[email protected]>
To   [email protected]
Subject   st: converting string to numerals
Date   Wed, 20 Nov 2013 11:07:35 -0800 (PST)

Hello statalist,
I have a very basic question about coding string variables. My variable is
expressed as strongly disagree, disagree, neither disagree nor agree, agree,
and strongly agree. I want to code them -2 if strongly disagree, -1 if
disagree, 0 if neither disagree nor agree, 1 if agree, and 2 if strongly
agree. I used encode(var), gen(var1), but it coded the scales randomly. Is
there any direct way to preserve the order in data coding?

Thanks,
Ramesh 



--
View this message in context: http://statalist.1588530.n2.nabble.com/converting-string-to-numerals-tp7580454.html
Sent from the Statalist mailing list archive at Nabble.com.
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index