Pagestruct?
Posted: Thu Jul 31, 2014 3:15 pm
I need to restructure my data. I think I should be using the pagestruct command (I want to do this in a program), but don't quite see how.
I have an unstructured data file with about 11,000 observations. Each observation has a variable STDNTID which identifies a unique student number. I also have variables of the form gkclasstype, g1classtype, g2classtype, g3classtype which define the type of class in grades K-3.
I want a panel with the student number as one dimension and the grade as the other. Then I want a new variable CLASSTYPE which "stacks" the four variables g?classtype. (Of course, I have more variables than just this one to be stacked.)
I suspect that this is one or two lines of code, but I'm not seeing it.
I have an unstructured data file with about 11,000 observations. Each observation has a variable STDNTID which identifies a unique student number. I also have variables of the form gkclasstype, g1classtype, g2classtype, g3classtype which define the type of class in grades K-3.
I want a panel with the student number as one dimension and the grade as the other. Then I want a new variable CLASSTYPE which "stacks" the four variables g?classtype. (Of course, I have more variables than just this one to be stacked.)
I suspect that this is one or two lines of code, but I'm not seeing it.