Can you paste a small example of how your data looks & how you want it to be in the end?
I'm assuming you have multiple records per site.
I'd probably do something like this.
file handle temp /name='c:\data
file handle temp1 /name='c:\et
dataset close all.
get file='temp/data.sav'.
select if char.index(lower(school), 'm
inneapolis' )>0.
save outfile='temp1/temp1.sav' /keep school observations. ((/rename if different)))
dataset close all.
get file='temp/data.sav'.
select if char.index(lower(school), 'paul' )>0.
save outfile='temp1/temp2.sav' /keep school observations. ((/rename if different)))
dataset close all.
add files /file='temp1/temp1.sav'
/file='temp1/temp2.sav' .
execute.------------------------------
Art Jack
------------------------------
Original Message:
Sent: Mon January 23, 2023 11:03 AM
From: Gretchen Baas
Subject: Restructuring and Aggregating Data
Hello!
I am attempting to restructure and then aggregate data in SPSS. Although I do know how to restructure the data, I am stuck on one part.
Some of my data have multiple names in the variable that I am restructuring based on. For example, I am restructuring based on school name; however, some of my observations have multiple school names under one variable (e.g., instead of Minneapolis Middle School, it has Minneapolis Middle School, St. Paul High School, University of Minnesota). What I would like to do is to divide those observations into separate observations. So, if there were 3 schools listed, I would create 3 duplicates of the original observation, keeping all other original variables with the duplicates.
Any thoughts or help is much appreciated!
------------------------------
Gretchen Baas
------------------------------