Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: RE: A tricky reshape

From   "Nick Cox" <>
To   <>
Subject   st: RE: RE: A tricky reshape
Date   Fri, 25 Jun 2004 12:55:36 +0100

Andreas Kuhn's way is very good. 

Mine can be improved. 


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) 


*   For searches and help try:

© Copyright 1996–2015 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index