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 (December 2000)Back to main SPSSX-L pageJoin or leave SPSSX-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Fri, 1 Dec 2000 12:29:43 -0600
Reply-To:     Carol Albright <syzygy@TC.UMN.EDU>
Sender:       "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From:         Carol Albright <syzygy@TC.UMN.EDU>
Subject:      Variable Labeling After Restructure
Content-Type: text/plain; charset="us-ascii"

Hi, SPSS-ers,

Say I just restructured my data set from a many records per case to a one record per case (but with many more variables). Using the VECTOR trick, you can create and populate many variables. But how do I LABEL them?

Example: My original data set has ID, DATE, BP and WT. My new data set has ID, BP1 to BP#, WT1 to WT#, where # is the maximum number of weeks I collected data. BP# and WT# are created using VECTOR, and thus do not have variable labels.

Can some macro guru create a program to take this ...

VAR LABELS ID "Patient ID" BP "Blood Pressure" WT "Patient Weight".

and creates this ...

VAR LABELS ID "Patient ID" BP1 "Blood Pressure - Week 1" WT1 "Patient Weight - Week 1" BP2 "Blood Pressure - Week 2" WT2 "Patient Weight - Week 2" etc etc.

Can you do something along the line of: <macro magic here> VAR LABELS BP# "Blood Pressure" TIME # WT# "Weight" TIME #.

ie take the variable name stem plus a placeholder that increments through the # of time periods (week in this case), the original variable label plus a placeholder for the key word (change to "Week") and again the # that should match the variable name. Would sure beat my current search & replace method.

TIA! Carol ------------------------------------------------------------------------- Carol L. Albright, MS | E-Mail : syzygy@tc.umn.edu Albright Consulting | Phone : 651/699-7218 2031 Goodrich Avenue | http://www.tc.umn.edu/~syzygy St. Paul, MN 55105 USA | Research data services -------------------------------------------------------------------------


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