| |
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
st: Hello all in statland
Can anyone help me with this problem. I'm trying to convert an alpha
character to numbers in a stata data base that I have. here is an example.
. tab qes5
do you have
any fears
riding at
night? 1.
yes 2. no
8. no
answer Freq. Percent Cum.
na 26 24.76 24.76
na 78 74.29 99.05
8 1 0.95 100.00
Total 105 100.00
Notice that I want to replace na with number that are appropriate. I
have used "real" before but when I try to use it now, it comes back with
an error message.
Here is what I"ve used:
. gen qes5r = real(qes5)
type mismatch
r(109);
I know that the underlying numbers associated with these na's is correct
but I can't get them to be listed in the stata output.
. sum qes5
Variable | Obs Mean Std. Dev. Min Max
-------------+--------------------------------------------------------
qes5 | 105 1.809524 .7480132 1 8
Thanks in advance for any help here.
jon ebeling
*
* 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/