LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (September 2005)Back to main SPSSX-L pageJoin or leave SPSSX-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Sat, 17 Sep 2005 14:41:06 -0400
Reply-To:     Richard Ristow <wrristow@mindspring.com>
Sender:       "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From:         Richard Ristow <wrristow@mindspring.com>
Subject:      Re: Matching question
Comments: To: Michael Healy <healym@earthlink.net>
In-Reply-To:  <BF5100B8.2A972%healym@earthlink.net>
Content-Type: text/plain; charset="us-ascii"; format=flowed

Boy, you do throw the questions at us. I'm not clear whether this replaces your question "Tough data setup" (which seems to use the same, or similar, data), or you somehow need to do both.

The other one, by the way, has some inherent as well as coding problems. But this is pretty easy. The trick is the constant variable NOBREAK.

At 02:07 AM 9/17/2005, Michael Healy wrote:

>I have two data sets. >Data set 1: >A B >999 998 > >Data set 2: >C D >9 8 >7 8 >6 7 > >How do I match the data sets so that I can get: >C D A B >9 8 999 998 >7 8 999 998 >6 7 999 998

Here we go. Tested; this is SPSS draft output: * ---------------------.

GET FILE=DATA1. LIST. List

A B

999 998

Number of cases read: 1 Number of cases listed: 1

NUMERIC NOBREAK(F2). COMPUTE NOBREAK = 1. SAVE OUTFILE=DATA1 /KEEP = NOBREAK ALL.

GET FILE=DATA2. LIST. List

C D

9 8 7 8 6 7

Number of cases read: 3 Number of cases listed: 3

NUMERIC NOBREAK(F2). COMPUTE NOBREAK = 1. MATCH FILES /FILE=* /TABLE=DATA1 /BY NOBREAK. LIST. List

C D NOBREAK A B

9 8 1 999 998 7 8 1 999 998 6 7 1 999 998

Number of cases read: 3 Number of cases listed: 3

* If desired:. ADD FILES FILE=* /DROP=NOBREAK. LIST. List

C D A B

9 8 999 998 7 8 999 998 6 7 999 998

Number of cases read: 3 Number of cases listed: 3


Back to: Top of message | Previous page | Main SPSSX-L page