From the course: Advanced and Specialized Statistics with Stata

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Date and time variables

Date and time variables - Stata Tutorial

From the course: Advanced and Specialized Statistics with Stata

Start my 1-month free trial

Date and time variables

- [Instructor] In this session, we're going to explore how to deal with date information in Stata. Date information often comes in string format that needs to be converted to a numeric format. Date formats can also take many different shapes. For example, in some countries, the month is written before the day, followed by the year. Or in other parts of the world, the sequence might be day, month, year. Alternatively, sometimes date information is already in the numerical format. But it could be spread across multiple variables. For example, one variable for year, one for month, and one for day. Well, they need to piece all this together. Finally, you should be aware that the Stata date is simply a number which counts the number of days since the first of January 1960. In other words, Stata will interpret the number one to be the second of January 1960. Here's an example of a small data sets with date information. The…

Contents