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 (March 2009)Back to main SPSSX-L pageJoin or leave SPSSX-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Tue, 3 Mar 2009 13:02:47 -0600
Reply-To:     "Marks, Jim" <Jim.Marks@lodgenet.com>
Sender:       "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From:         "Marks, Jim" <Jim.Marks@lodgenet.com>
Subject:      Re: How to expand 1 record into multi records.
In-Reply-To:  A<200903020949.n225ClYP017707@malibu.cc.uga.edu>
Content-Type: text/plain; charset="us-ascii"

Chris:

Not tested.

DATASET COPY v1_fix. DATASET ACTIVATE v1_fix. SELECT IF v1 = 1. COMPUTE v2 = 0. COMPUTE v3 = 0. EXECUTE.

DATASET ACTIVATE original. DATASET COPY v2_fix. DATASET ACTIVATE v2_fix. SELECT IF v2 = 1. COMPUTE v1 = 0. COMPUTE v3 = 0. EXECUTE.

DATASET ACTIVATE original. DATASET COPY v3_fix. DATASET ACTIVATE v3_fix. SELECT IF v3 = 1. COMPUTE v1 = 0. COMPUTE v2 = 0. EXECUTE.

NEW FILE. ADD FILES /FILE =v1_fix /FILE =v2_fix /FILE =v3_fix . DATASET NAME new_version WINDOW = FRONT. EXECUTE.

This could get cumbersome if you have more than 3 variables.

--jim

-----Original Message----- From: SPSSX(r) Discussion [mailto:SPSSX-L@LISTSERV.UGA.EDU] On Behalf Of Chris Sent: Monday, March 02, 2009 3:50 AM To: SPSSX-L@LISTSERV.UGA.EDU Subject: How to expand 1 record into multi records.

Hi Friends, Please help figure out whether the following operation is feasible in SPSS. Many thanks!

ID, v1,v2,v3 A1,1,0,1 A2,0,1,1

The result data set will be like:

ID, v1,v2,v3 A1,1,0,0 A1,0,0,1 A2,0,1,0 A2,0,0,1

Regards Chris

===================== 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

===================== 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


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