Hello Stata community;
I have this data at hand:
As you can see for the time variable called "mois", I do have it in the form of day/month/year. I do want to get rid of the day part (since it is always the first day of the month), I want to leave to month and the year part and destring them in such a way so that I could be able to apply a tsset command on that monthly time variable and draw a time graph showing the evolution of inflation.
Any help please?
I have this data at hand:
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input str7 mois float inflationen "1/1/20" .8 "1/2/20" .6 "1/3/20" .6 "1/4/20" .2 "1/5/20" .1 "1/6/20" .1 "1/7/20" .2 "1/8/20" .1 "1/9/20" -.2 "1/10/20" -.6 "1/11/20" -1 "1/12/20" -1.2 "1/1/21" -.7 "1/2/21" -.5 "1/3/21" -.4 "1/4/21" -1.1 "1/5/21" -.7 "1/6/21" -.4 "1/7/21" -.3 "1/8/21" -.4 "1/9/21" .2 "1/10/21" .1 "1/11/21" .6 "1/12/21" .8 "1/1/22" .5 "1/2/22" .9 "1/3/22" 1.2 "1/4/22" 2.4 "1/5/22" 2.4 "1/6/22" 2.3 "1/7/22" 2.6 "1/8/22" 3 "1/9/22" 3 "1/10/22" 3.8 "1/11/22" 3.8 "1/12/22" 4 "1/1/23" 4.4 "1/2/23" 3.3 "1/3/23" 3.3 "1/4/23" 3.5 "1/5/23" 3.2 "1/6/23" 3.3 "1/7/23" 3.3 "1/8/23" 3.1 "1/9/23" 3 "1/10/23" 3.3 "1/11/23" 2.9 "1/12/23" 2.6 "1/1/24" 2.1 "1/2/24" 2.8 "1/3/24" 2.7 "1/4/24" 2.5 "1/5/24" 2.9 "1/6/24" 2.9 "1/7/24" 2.7 "1/8/24" 3 "1/9/24" 2.5 end
As you can see for the time variable called "mois", I do have it in the form of day/month/year. I do want to get rid of the day part (since it is always the first day of the month), I want to leave to month and the year part and destring them in such a way so that I could be able to apply a tsset command on that monthly time variable and draw a time graph showing the evolution of inflation.
Any help please?
Comment