[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
Re: st: Transpose?
At 04:05 PM 4/13/2004 -0500, Justin (firstname.lastname@example.org) wrote:
This is not a case for transpose or -xpose-.
I have data that looks like this:
yr series country1 country2 country3
1960 exports (value) (value) (value)
1960 imports (value) (value) (value)
1961 exports " " " " " "
I would like to get the data so it looks like:
yr country series(exports) series(imports)
1960 1 (value) (value)
1961 1 "" ""
1960 2 "" ""
1961 2 "" ""
I am new to Stata and completely at a loss as to how to accomplish this. Any
help would be greatly appreciated.
It looks as if you need to do two -reshape- steps.
-reshape- this to long form with only one content variable: what you show
as value. Thus, you would end up with data looking something like this:
yr country series value
1960 1 imports (value)
1960 1 exports (value)
1960 2 imports (value)
1960 2 exports (value)
1960 3 imports (value)
1960 3 exports (value)
Then -reshape- it a second time to wide form, splitting the imports from
This is a sketchy description. You need to fill in the details, which
depend on your particular variable names and types. It may help to have
series as numerically coded. See -help reshape-.
Institute for Policy Studies
Johns Hopkins University
* For searches and help try: