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

Re: st: variable


From   Roger Newson <roger.newson@kcl.ac.uk>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: variable
Date   Fri, 08 Apr 2005 16:22:01 +0100

At 16:04 08/04/2005, Jorge Tuesta wrote:
Dear statlisters


I have this variable:


Var01
--------
23012005
17022005
.
.
.

i'd like this variables:

var02        var03          var04
-------        --------          ----------
23              01            2005
17              02            2005
.                 .                .
.                 .                .

How can i do?
You do not say whether -Var01- is numeric or string. However, numeric variables can be converted to string using the -string()- function, strings can be converted to numeric using the -real()- function, and strings can be split into substrings using the -substr()- function. In Stata, type -whelp functions- to find more about functions.

I hope this helps.

Roger



--
Roger Newson
Lecturer in Medical Statistics
Department of Public Health Sciences
Division of Asthma, Allergy and Lung Biology
King's College London

5th Floor, Capital House
42 Weston Street
London SE1 3QD
United Kingdom

Tel: 020 7848 6648 International +44 20 7848 6648
Fax: 020 7848 6620 International +44 20 7848 6620
or 020 7848 6605 International +44 20 7848 6605
Email: roger.newson@kcl.ac.uk
Website: http://phs.kcl.ac.uk/rogernewson/

Opinions expressed are those of the author, not the institution.

*
* 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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index