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 2011)Back to main SPSSX-L pageJoin or leave SPSSX-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Fri, 23 Sep 2011 14:11:09 -0700
Reply-To:     David Marso <david.marso@gmail.com>
Sender:       "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From:         David Marso <david.marso@gmail.com>
Subject:      Re: the intricacies of using do if-end if and execute
In-Reply-To:  <OFAC713F31.D1A5601E-ON87257914.006BF55D-87257914.006C4A74@us.ibm.com>
Content-Type: text/plain; charset=UTF-8

"But you can shift any number of variables in a single data pass." OK, I can see that now. Current syntax seems a PIA ;-) Any chance for some later version to provide the following sort of syntactic flexibility? SHIFT VALUES varlag_1 TO varlag_10=LAG(singlevar,1,10). or SHIFT VALUES lag_1_var1 TO lag_1_var10 = LAG(oldvar1 TO oldvar10,1). -------

Jon K Peck wrote: > > SHIFT VALUES is a procedure, of course. But you can shift any number of > variables in a single data pass. > SV was motivated by two requirements > - ability to handle leads, which the transformation data feed is not set > up to do. > - ability to handle unlimited file sizes. CREATE, which can do leads and > lags, requires the data to be in memory. That is not because of lead or > lag functionality per se but because of the other functions that CREATE > supports. > > Jon Peck (no "h") > Senior Software Engineer, IBM > peck@us.ibm.com > new phone: 720-342-5621 > > > > > From: David Marso &lt;david.marso@gmail.com&gt; > To: SPSSX-L@listserv.uga.edu > Date: 09/23/2011 01:37 PM > Subject: Re: [SPSSX-L] the intricacies of using do if-end if and > execute > Sent by: "SPSSX(r) Discussion" &lt;SPSSX-L@listserv.uga.edu&gt; > > > > OTOH: From the FM, SHIFT VALUES results in a data pass!! > Hence I suspect cannot be done in a LOOP or DO REPEAT and with HUGE data > sets WILL result in > unacceptable performance hits. > For example: > DO REPEAT X = X1 TO X10 / Y=Y1 TO Y10 / L=1 TO 10 . > + COMPUTE X=LAG(Xvar,L). > + COMPUTE Y=LAG(Yvar,L). > END REPEAT. > If recast as a set of SHIFT VALUE commands would result in 20 data passes > and require either a MACRO or 20 separate commands. > Sacrificing performance for a minor gain in "intuitiveness" is hardly > laudible ;-) > > > Jon K Peck wrote: >> >> Lag is tricky. You might find the SHIFT VALUES behavior to be more >> intuitive. >> >> Jon Peck (no "h") >> Senior Software Engineer, IBM >> peck@us.ibm.com >> new phone: 720-342-5621 >> >> >> >> >> From: "Pirritano, Matthew" &lt;MPirritano@ochca.com&gt; >> To: SPSSX-L@LISTSERV.UGA.EDU >> Date: 09/23/2011 11:49 AM >> Subject: Re: [SPSSX-L] the intricacies of using do if-end if and >> execute >> Sent by: "SPSSX(r) Discussion" &lt;SPSSX-L@LISTSERV.UGA.EDU&gt; >> >> >> >> Thanks David & Rick, >> >> It looks like it probably has something to do with the fact that lag is >> calculated after all other transformations even if it precedes them. So > my >> select if is actually happening before the compute using lag that the >> select if is supposed to be based on. >> >> Thanks >> Matt >> >> Matthew Pirritano, Ph.D. >> Research Analyst IV >> Medical Services Initiative (MSI) >> Orange County Health Care Agency >> (714) 568-5648 >> >> From: SPSSX(r) Discussion [mailto:SPSSX-L@LISTSERV.UGA.EDU] On Behalf Of >> Rick Oliver >> Sent: Friday, September 23, 2011 10:25 AM >> To: SPSSX-L@LISTSERV.UGA.EDU >> Subject: Re: the intricacies of using do if-end if and execute >> >> I don't know what the original problem was. But if lag is an issue, go >> here: >> >> http://publib.boulder.ibm.com/infocenter/spssstat/v20r0m0/index.jsp >> >> And then enter "lag function" in the Search field. >> >> It may shed some light on the problem. >> >> >> >> From: David Marso &lt;david.marso@gmail.com&gt; >> To: SPSSX-L@listserv.uga.edu >> Date: 09/23/2011 12:12 PM >> Subject: Re: the intricacies of using do if-end if and execute >> Sent by: "SPSSX(r) Discussion" &lt;SPSSX-L@listserv.uga.edu&gt; >> >> >> >> >> "Whereas if I insert an exe after the do-if I get what I want, a removal >> of >> all dups and primary cases, those instances that are a credit debit > wash. >> I >> don’t even see where primary cases are being selected here. Hopefully my >> story is not too convoluted and someone has followed it." >> >> Matt, >> It has *NOTHING* specifically to do with DO IF and *EVERYTHING* to do > with >> the LAG!!! >> Yeah, your story is way too convoluted. Since I don't use that silly >> dialog >> to DEDUP, I have *NO* idea what convoluted syntax you are beating your >> head >> against. Example of the data might be useful and the specific desired >> result. OTOH, whenever selection is done based on variables created by >> LAG >> you typically need a procedure to pass the data so things don't get >> FUBARed. >> (Might be best to use that data pass to get something informative? > Perhaps >> freqs/XTABS on some variables you have just created as reality checks > ;-) >> HTH, David >> >> >> -- >> View this message in context: >> > http://spssx-discussion.1045642.n5.nabble.com/the-intricacies-of-using-do-if-end-if-and-execute-tp4834252p4834370.html > >> >> Sent from the SPSSX Discussion mailing list archive at Nabble.com. >> >> ===================== >> 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 >> > > > -- > View this message in context: > http://spssx-discussion.1045642.n5.nabble.com/the-intricacies-of-using-do-if-end-if-and-execute-tp4834252p4834871.html > > Sent from the SPSSX Discussion mailing list archive at Nabble.com. > > ===================== > 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 >

-- View this message in context: http://spssx-discussion.1045642.n5.nabble.com/the-intricacies-of-using-do-if-end-if-and-execute-tp4834252p4835219.html Sent from the SPSSX Discussion mailing list archive at Nabble.com.

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