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 - Stata Tutorial
From the course: Introduction to Stata
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…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
(Locked)
Recoding an existing variable4m 3s
-
(Locked)
Generating a new variable5m 15s
-
(Locked)
Naming and labeling variables5m 20s
-
(Locked)
Extended generate3m 26s
-
(Locked)
Indicator variables4m 6s
-
(Locked)
Keeping and dropping variables3m 8s
-
(Locked)
Saving data3m 6s
-
(Locked)
Merging and appending6m 54s
-
(Locked)
String variables5m 53s
-
(Locked)
Local macros and looping7m 12s
-
(Locked)
Manipulating data: Challenge45s
-
(Locked)
Manipulating data: Solution4m 6s
-
(Locked)
-
-
-
-
-
-
-