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 (August 2006)Back to main SPSSX-L pageJoin or leave SPSSX-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Fri, 18 Aug 2006 11:05:30 -0400
Reply-To:   Laura Leach <lleach80@HOTMAIL.COM>
Sender:   "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From:   Laura Leach <lleach80@HOTMAIL.COM>
Subject:   Loop and macro help

Hi, Below is the syntax that I am trying to automate because it needs to be done several hundred times. I am new to SPSS and feel like I am currently killing an ant with a slede-hammer by doing this by hand. The entire point of this syntax is to get the value of "Base1E1_DEL" for every case. But to arrive at that, in the DO IF, "qA4=1" is related to the variable label "Base1" (i.e., qA4=10 label equals Base10, etc.) and the "qC1=1" is related to the "E1" part of the label (no systematic link because label part is alphanumeric). These two variables qA4 and qC1 do not change in a systematic way (i.e., they are not 1,2,3,4, etc.). What I have been doing is copying and pasting this piece of syntax for every single iteration. (qA4 has 90 different values, and qC1 has 5 different values). Is there a way to streamline this to change the values of qA4/qC1 and it's corresponding new variable label, or even better yet, is there a way to arrive at the _DEL vairable without creating 4 new variables to get there?

Thanks for any help!! Laura

DO IF (qA4=1 AND qC1=1) . COUNT Base1E1_FAV = qE1a qE1b qE1c (5 thru 6) . END IF . EXECUTE .

DO IF (qA4=1 AND qC1=1). COUNT Base1E1_TOL = qE1a qE1b qE1c (1 thru 6) . END IF. EXECUTE .

COMPUTE Base1E1_PFAV = Base1E1_FAV / Base1E1_TOL . EXECUTE .

COMPUTE Base1E1_DEL = Base1E1_PFAV-AFFav. EXECUTE .


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