Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Is there a simple way to change the storage type from str to numerical


From   "Renzo Comolli" <[email protected]>
To   <[email protected]>
Subject   Re: st: Is there a simple way to change the storage type from str to numerical
Date   Mon, 12 Jul 2004 01:45:15 -0400

OR
 destring [varlist] , replace

Note that you must specify one of the two options



----------------------------------------------------------------------------
----
*From   "Maoyong Fan" <[email protected]> 
To   "statalist" <[email protected]> 
Subject   st: Is there a simple way to change the storage type from str to
numerical 
Date   Sun, 11 Jul 2004 22:25:00 -0800 

----------------------------------------------------------------------------
----

Dear Friends:

	  I want to change the storage type of a variable in my dataset from
str to numerical.  I have tried 

recast int admit_major, force
recast2 int admit_major, force

but get the error message 

admit_major:  int invalid
r(109); t=0.01 22:18:01

The variable admit_major is string type and looks like:

1
3 
4
5
.
.
.


To generate a new variable is a way out.  Could anyone give a simpler way
for this?	

Warm regards,

Maoyong				


*
*   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/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index