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: RE: RE: Tostring (string from a numerical variable)
From
"Martin Weiss" <[email protected]>
To
<[email protected]>
Subject
st: RE: RE: Tostring (string from a numerical variable)
Date
Wed, 17 Mar 2010 17:52:20 +0100
<>
Your problem might be due to other factors than the "negative sign"?
*************
clear*
set obs 1
gen double myvar=2.4345390539587
tostring myvar, gen(mystrvar)
*************
The -force- option does take care of business, but does entail a loss of
information.
HTH
Martin
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Martin Weiss
Sent: Mittwoch, 17. März 2010 17:42
To: [email protected]
Subject: st: RE: Tostring (string from a numerical variable)
<>
Use the -force- option, risking information loss. Although negative numbers
as such do not seem to pose much of a problem for my Stata 11:
*************
clear*
inp x
-1
-2
0
3
4
5
end
tostring x, generate(strx)
l
*************
HTH
Martin
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of carmen gamarra
Sent: Mittwoch, 17. März 2010 17:36
To: stata list
Subject: st: Tostring (string from a numerical variable)
Hi people,
I wanna generate a variable string from a numerical variable that has
negative signe (in front of the number). Is this possible? Because Stata
gives me the following message.
(tostring var_1, generate( var_1str)) var_1 cannot be converted
reversibly; no generate.
What must I do? Thanks in advance
carmen
_________________________________________________________________
*
* 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/
*
* 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/
*
* 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/