Converting dates entered as strings into numeric dates that can be used by Stata is relatively simple. The commands vary somewhat based on the format in which the data were entered and how consistently that format was applied. Speaking Stata: On getting functions to do the work Nicholas J.
Cox couple of shelves of successive Stata manuals, starting with the manual for version 2, asingle volume published in 1988. A decade or so ago, you could put the manual in divide between numeric and string variables (Cox 2002c). Clearly, every organizing c 2002 Stata Changing a numeric to a string variable in Stata.
all you should want to do with them is (a) convert them to other numeric variables (b) change the display format; conversion to strings is rarely necessary or useful. Please read the fine manual and consider posting beginner questions like this on Statalist (although on any forum there We would like to show you a description here but the site wont allow us.
Stata Press, a division of StataCorp LLC, publishes books, manuals, and journals about Stata and general statistics topics for professional researchers of all disciplines.
Feb 19, 2016 Dear Stata folks, I have a need to convert Stata dates (currently in td format) to numeric variables showing year and month YYYYMM. I don't seem to find a way, so any help is very much appreciated. Converting string variables with numeric values. into numerical variables is to use a string function called real that translates numeric values stored as strings into numeric values Stata can recognize as such.
The first line of syntax reads in the dataset shown above. see the help or reference manual about the destring and encode Common tasks with string variables include matching a pattern or searching a location in a string, parsing or subsetting a string, concatenating strings, converting a string to a number etc. Read the Stata manual for a full list of string functions