Dear all,
I want to calculate the GDP growth for the US. I downloaded quarterly GDP data from a database. The data looks as follows:
The date variable was a string variable (called 'name'), so I used
Now 'date' looks the same as name, only now as a long variable. However, if I use tsset date, it will start with all the Q1's from each year, and then use all the Q2's from each year. What I want is to maintain the correct ordering (so I guess if it looked as: '1977 Q1' instead of 'Q1 1977' things would work already.
I want to tsset the data so I can calculate quarterly growth figures. I know how to do so in Excel (using previous cells etc.), however, I was wondering how to do so in Stata.
Any tips?
Kind regards,
Thomas
I want to calculate the GDP growth for the US. I downloaded quarterly GDP data from a database. The data looks as follows:
Q1 1977 | 5799 |
Q2 1977 | 5913 |
Q3 1977 | 6017 |
Q4 1977 | 6018 |
Q1 1978 | 6039 |
Q2 1978 | 6274 |
:
encode name, generate(date)
I want to tsset the data so I can calculate quarterly growth figures. I know how to do so in Excel (using previous cells etc.), however, I was wondering how to do so in Stata.
Any tips?
Kind regards,
Thomas