This is probably out there but I have checked around to no avail. I have a dates variable and I want to generate a new date variable that is 20 years less. That is, for each date observation I generate a new variable with exactly 20 years back. Here is a MWE of the date var I have:
To convert to readable dates, I use
I get dates that are 60 years ahead. I want to get off the extra years and get a new var with correct dates.
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input long date 43466 43466 42736 42370 43466 43191 42552 42186 42917 41821 42186 43466 43466 43466 42675 43466 43466 43466 43466 43405 end
Code:
format date %td
Comment