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

st: Re: Splitting a numeric variable


From   "victor michael zammit" <[email protected]>
To   <[email protected]>
Subject   st: Re: Splitting a numeric variable
Date   Sat, 17 Aug 2002 17:24:09 -0700

It appears that you are dealing with a string variable, and you need to
change it to a numerical variable.The approach that works for me ,is to list
the string variable,( if it is less than six screens long,and if it is
longer, use a log file and then type the log file  and copy parts of the
list, at a time),then highlight the elements of the variable and then go to
Edit and click on "copy table" ,NOT "Copy",then type "clear" in Stata,bring
data editor to front, or type "edit",and then click on "paste" .The variable
now is numerical and you should be able to work ,without getting the "type
mismatch" error.Don't forget to save the newly turned numerical variable
,for further use,
Victor Michael Zammit




From: VISINTAINER PAUL <[email protected]>
To: <[email protected]>
Sent: Thursday, August 15, 2002 9:13 AM
Subject: st: Splitting a numeric variable


> I previously posted this message with an inappropriate subject line.  Here
> it is again.
>
>
> Quick question.
>
> I have a numeric variable (float) of the form:  19460515
>
> The variable actually refers to the date, May 15, 1946.  Truncating and
> concatenating functions appear to operate only on string variables.  What
> approach can I use to change this to the correct date?
>
> Thanks.
>
> Paul visintainer
>
> *
> *   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/
> *
> *   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/
>

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