Dear users,
I'm looking for a way to transform a string variable (in the example
below, strvar) in float variable, with the same value labels as the
former string variable, as does the command -sencode-.
However, I do not want the values of the value labels 1,2,3 .... n, as
-sencode- does.
I would like the numbers to be the same as of another variable (in the
example below, variable "values"), eg:
clear
input str4 strvar float values
"adm" +1
"desl" -1
end
sencode strvar, replace
replace strvar = -1 if strvar == 2
labmm strvar 1 "adm" -1 "desl"
ps: here, -sencode- and -labmm- are from ssc (the later, is part of -labutil2-)
Thank you for any help
Pedro Nakashima.
*
* 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/