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 tonumerical


From   David Kantor <[email protected]>
To   [email protected]
Subject   Re: st: Is there a simple way to change the storage type from str tonumerical
Date   Mon, 12 Jul 2004 11:59:58 -0400

You should look at
-destring-

I hope this helps.
--David

At 10:25 PM 7/11/2004 -0800, Maoyong wrote:
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
[...]
David Kantor
Institute for Policy Studies
Johns Hopkins University
[email protected]
410-516-5404

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