From the course: Introduction to Stata

Unlock this course with a free trial

Join today to access over 25,300 courses taught by industry experts.

String variables

String variables

- [Instructor] In this session, we're going to explore string variables, and learn how can use Stata to manipulate string information. For Stata, a string is any data character that is not a number or missing value denoted by the full stop. String data is common and examples include geographical information, gender information, think M, think F, or possibly date information. Stata has a wide range of options to help you manipulate string information. And in this session, we'll explore how we can condition on string information and how we can convert string information to numeric information and back again. The Stata commands that we'll be using are the following, destring and tostring which convert string variables to numeric variables and back. They're useful if your string variables contains a lot of numbers. Encode and decode also convert string variables to numeric and back, but are more useful if your string…

Contents