Andreas Kuhn's way is very good.
Mine can be improved.
Nick
[email protected]
So long as you are using stubs
Jan Feb Mar Apr May Jun Jul Aug Sep
Oct Nov Dec, try this:
di "`c(Mons)'"
tokenize `c(Mons)'
forval i = 1/12 {
forval j = 1/7 {
rename ``m''X`j' X`j'`m'
}
}
reshape long X1 X2 X3 X4 X5 X6 X7, j(Month) i(State)
Nick
[email protected]
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/