Date: Sat, 15 Feb 2003 01:06:17 +0100
Reply-To: Karel Asselberghs <asselberghs@XS4ALL.NL>
Sender: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From: Karel Asselberghs <asselberghs@XS4ALL.NL>
Subject: Re: SPSS equivalent of reshape
In-Reply-To: <5.1.0.14.2.20030214180548.0436ee00@pop.law.harvard.edu>
Content-Type: text/plain; charset="us-ascii"; format=flowed
Hi Margo,
You can use SPSS-command VARSTOCASES to restructure the file:
varstocases
/make pop 'total state population' from pop_1970 pop_1971 etc.
/make jail 'jail population' from jail_1970 jail_1971 etc.
/make pri 'state prison population' from pri_1970 pri_1971 etc.
/make fed 'federal prison population' from fed_1970 fed_1971 etc.
/make sfi 'lawsuits filed by state and jail inmates' from sfi_1970
sfi_1971 etc.
/make ffi 'lawsuits filed by federal inmates' from ffi_1970 ffi_1971 etc.
/index = year.
At 00:06 15-2-2003, Margo Schlanger wrote:
>Hi --
>
>Is there an easy way to do an SPSS equivalent of the Stata command "reshape"?
>
>I've got data for each state (Alabama, etc., so 5` observations (D.C. makes
>51)), with the following:
>
>30 variables for total state population (pop_1970, pop_1971, etc.)
>30 variables for jail population, by state (jail_1970, jail_1971, etc.)
>30 variables for state prison population (pri_1970, pri_1971, etc.)
>30 variables for federal prison population (fed_1970, fed_1971, etc.)
>30 variables for lawsuits filed by state and jail inmates (sfi_1970,
>sfi_1971, etc.)
>30 variables for lawsuits filed by federal inmates (ffi_1970, ffi_1971, etc.)
>
>I want to do time series analysis, within states. So I want to "panelize"
>this -- reshape it from wide to long, so that I have 30 records for each
>state, each with seven variables year, pop, jail, pri, fed, sfi, ffi) Then
>I can do my work on it.
>
>In Stata this would be "reshape long." But I'm not good with stata, so I
>want to do the work in SPSS. Any ideas? Am I approaching this right,
>altogether?
>
>Thanks for any advice.
>
>Margo Schlanger
>
>
>
>______________________
>Margo Schlanger
>Assistant Professor of Law
>Harvard Law School
>Cambridge, MA 02138
>(617) 495-4626
>(253) 295-6089 (fax)
>______________________
>Margo Schlanger
>Assistant Professor of Law
>Harvard Law School
>Cambridge, MA 02138
>(617) 495-4626
>(253) 295-6089 (fax)
|