I have a rather simple (yet silly) question.
Assume my data has a variable which is stored as a string with values such as: "1998q4", "2003q2", etc.
How can I transform it to a proper quarterly-time variable for stata? I tried using the date() function, but the generated variable is missing on all observations.
Assume my data has a variable which is stored as a string with values such as: "1998q4", "2003q2", etc.
How can I transform it to a proper quarterly-time variable for stata? I tried using the date() function, but the generated variable is missing on all observations.
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input str6 start "1998q4" "1999q3" "2003q4" "2009q2" "2003q1" end
Comment