The variables identifying time are “year” and “month” (see below):
I need to create a variable called “dm”, which identifies the year and month. For instance, 2014m1, 2014m2, 2014m3 … 2014m12.
However, I’'ve been unable to do it.
Could someone help?
Thank you very much.
Code:
* Example generated by -dataex-. For more info, type help dataex clear input str9 country str11 countrycode int year str10 month_name byte(month prescan2) "Argentina" "ARG" 2014 "January" 1 0 "Argentina" "ARG" 2014 "February" 2 0 "Argentina" "ARG" 2014 "March" 3 0 "Argentina" "ARG" 2014 "April" 4 0 "Argentina" "ARG" 2014 "May" 5 0 "Argentina" "ARG" 2014 "June" 6 1 "Argentina" "ARG" 2014 "July" 7 0 "Argentina" "ARG" 2014 "August" 8 0 "Argentina" "ARG" 2014 "September" 9 0 "Argentina" "ARG" 2014 "October" 10 0 "Argentina" "ARG" 2014 "November" 11 0 "Argentina" "ARG" 2014 "December" 12 0 end
0 Response to Creation of a variable to identify year and month (time series data)
Post a Comment