This relates to Q #25 on the assignment this week; reformatting "dob" as a date format. Attempting using generate command from info on lecture slide 73, but just generates missing values (.) for all observations. Also tried without specifying a top year, and tried "MD19Y" with the same result of 1267 missing values generated. How to handle this?
Try "DM19Y"
Re: reformatting dob as date format without top year
Additional to Kristen's advise, make sure that the order of your date as string is the same as your line of code (e.g August-19-87 should be specified "MDY"; 19-Aug-87 should be specified as "DMY"
Re: reformatting dob as date format without top year
How do we know which is the top year? Can't understand that. Can't find it by using sum or tab either.
Re: reformatting dob as date format without top year
Good question!
I understand how this might be confusing. I played a little bit with the "Top year" and it basically doesn't matter which year you type as long as is equal or higher to the max year in your data set. So, I think it is safe if you type the current year since it is not possible to have future dates (or it shouldn't). Try to play around with different years to see how your data would be affected.
It might be confusing in this setting because you don't know much about the data. But, in a real world scenario you would be familiar with the oldest and newest record in your data set -ideally-.
Let us know if you have more questions.
-Eduardo
Re: reformatting dob as date format without top year
OK, that was well explained and makes sense. Thanks.