Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


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

st: about real() function?mistakes happened when transform strings to numeric


From   Nina YIN <yinnina.ccer@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   st: about real() function?mistakes happened when transform strings to numeric
Date   Tue, 10 Apr 2012 17:27:39 +0200

Dear all,

I am wondering whether you have met such situation:

When I try to transform a string variable into numeric one, I use, for
example, -gen rxndc=real(ndc)
Then I hope that it will change the type of the variable, and after
that, I could merge two datasets using rxndc which is the same type in
both datasets.
The strange thing is that, this command worked well in my laptop,
while in the university server, it failed, the numeric variable rxndc
wasn't consistent with the string one "ndc".
If you have any idea, could you kindly give me any suggestions?
Thanks in advance!

--
Best Regards,
Nina YIN
*
*   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   |   Site index