Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
st: RE: on restructuring of panel datasets
From
Nick Cox <[email protected]>
To
"'[email protected]'" <[email protected]>
Subject
st: RE: on restructuring of panel datasets
Date
Thu, 27 Jan 2011 19:53:34 +0000
As far as Stata is concerned this is already a panel dataset. It is difficult to see why you want this restructure, which would break that.
But what you ask for is possible through -reshape long-.
Nick
[email protected]
[email protected]
I would like to ask for help with the reorganizing of a panel dataset. I
have a panel data set with the following structure:
Firm date VAR1 VAR2 VAR3 (other vars follow)
1 1 0 1 2
1 2 1 2 3
1 3 2 3 1
2 1 . . .
2 2 . . .
2 3 . . .
3 1
3 2
3 3
VAR1 VAR2 VAR3 actually are sub-elements of a general variable VAR.
I would like to create the following series where these variables are combined
in
a single variable VAR for all firms:
On the example of firm 1, I would like to get:
Firm date VAR
1 1 0
1 1 1
1 1 2
1 2 1
1 2 2
1 2 3
1 3 2
1 3 3
1 3 1
and so on.
I also have other variables in the dataset but I guess they will be reordered
automatically with respect to this order.
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/