Date: Thu, 30 Jul 2009 09:29:00 -0500
Reply-To: "Reutter, Alex" <areutter@spss.com>
Sender: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From: "Reutter, Alex" <areutter@spss.com>
Subject: Re: Nested or Hierarchical Data Structures for Multiple SPSS Data
Files
In-Reply-To: A<7.0.1.0.2.20090730042815.06acf7c0@mindspring.com>
Content-Type: multipart/alternative;
I think whether this is "not a great idea" depends a bit upon what one plans to do with the merged dataset. MIXED and GENLIN both use the "long" data structure for repeated measures analyses, in which case each person's demographics will occur in multiple records.
Cheers,
Alex
________________________________
From: SPSSX(r) Discussion [mailto:SPSSX-L@LISTSERV.UGA.EDU] On Behalf Of Richard Ristow
Sent: Thursday, July 30, 2009 3:42 AM
To: SPSSX-L@LISTSERV.UGA.EDU
Subject: Re: Nested or Hierarchical Data Structures for Multiple SPSS Data Files
At 03:55 PM 7/29/2009, Kevan Edwards (MDH) wrote:
I have several SPSS data files saved each of which contains information about individuals at different levels of observation. There is a one to many situation in these files. For example one file contains information about demographics (1 record per person) another file contains information about utilization of services (1 record for each office visit) while others contain information about the persons health history (1 record for each medical condition). All files have 1 common linkage field/variable being the id number of the person.
My question is, is it possible to link the SPSS .sav files I have for in which the data records reflect various levels of observation to create a hierarchical or nested files stricture from the individual SPSS sav files with that common a key variable (Recipient ID) , and if so, how?
You can't get a hierarchical or nested structure in a single SPSS file. But it works fine to have separate files for data at each level of observation; and then summarize (with AGGREGATE) or join (with MATCH FILES) as you need for analysis.
The Nested Files documentation in my SPSS manuals indicates how to do it when creating data from scratch ...
If you look really hard at the documentation, you'll see that it doesn't do that. The 'nested' filetype feature lets you take a file that comes IN nested, and write it with the data from each higher level included on every corresponding record at the lower levels. You could do that from your data, with (untested)
MATCH FILES
/TABLE=Demographics
/FILE =Office_Visits
/BY PersonID.
But it's not a great idea. The resulting file is what, in the database world, is called un-normalized: in this case, breaking the rule that any piece of information (like the person's demographics) should occur in one and only one record.
You're probably fine as you are. Happy analysis!
-Best wishes,
Richard
===================== To manage your subscription to SPSSX-L, send a message to LISTSERV@LISTSERV.UGA.EDU (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD
[text/html]