Date: Fri, 14 Mar 2008 14:21:20 -0600
Reply-To: ViAnn Beadle <vab88011@gmail.com>
Sender: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From: ViAnn Beadle <vab88011@gmail.com>
Subject: Re: CASESTOVARS / LOOP-END LOOP(?)
In-Reply-To: <9b14e15b0803140854r3cb9f6f7gf9e68a154afe7527@mail.gmail.com>
Content-Type: text/plain; charset="us-ascii"
The simple question of amount and frequency is easily done with reporting
procedures like SUMMARIZE. Just break on giver ID and ask for SUM and N of
the Gift Amount. If you want a breakdown by year then break on ID and YEAR.
-----Original Message-----
From: SPSSX(r) Discussion [mailto:SPSSX-L@LISTSERV.UGA.EDU] On Behalf Of
Mark Palmberg
Sent: Friday, March 14, 2008 9:55 AM
To: SPSSX-L@LISTSERV.UGA.EDU
Subject: Re: CASESTOVARS / LOOP-END LOOP(?)
On Thu, Mar 13, 2008 at 8:35 PM, Richard Ristow <wrristow@mindspring.com>
wrote:
> You can do a lot
> of over-time analysis with long-form data; in fact, it's generally
> easier. That's even more likely in your case, as organizing the file like
>
> MRSEQ# GFT_Mean81 GFT_Count81 GFT_SUM81 GFT_Mean82 GFT_Count82 GFT_SUM82
> GFT_Mean83 GFT_Count83 GFT_SUM83 GFT_Mean84 GFT_Count84 GFT_SUM84
>
> means you can't even define VECTORs for your means, counts and totals.
>
Unless I reorder my variables to be consecutive within Mean, Count, and SUM,
yes?
The long-form alternative, then, if I wanted to examine the annual
differences in giving by individual (including, but not limited to, things
like percentage dollar increase [or decrease] year-to-year and lifetime
and/or mean #days between gifts [by year and lifetime]) would be something
like the syntax you offered in a previous post (11/24/07):
NUMERIC #NewGuy (F2) /* Flag first record for an ID */.
DO IF MISSING(LAG(ID))
OR LAG(ID) NE ID.
. COMPUTE #NewGuy = 1.
ELSE.
. COMPUTE #NewGuy = 0.
END IF.
* Difference in days between successive gifts .
* (Requires data be sorted by ID and gift date.) .
NUMERIC BtwnGift (F4).
VAR LABEL BtwnGift 'Time, days, since previous gift'.
IF NOT #NewGuy BtwnGift = datediff(GFTDAT,LAG(GFTDAT),"days").
Which gives me a new variable (BtwnGift) that holds -- for each gift record
AFTER the first one for each ID -- the number of days since the previous
gift (the same syntax could be used for my GFTAMT variable). This still
leaves me with the a single variable in long form (i.e., by gift, not ID)
that I would otherwise analyze in wide form (i.e., by ID) with VECTOR and
LOOP-END LOOP.
So, then, my enduring question is: What is the key syntax I need to review
to be able to -- from a long-form data file -- end up with a way to measure
a donor's giving performance (measured by amount and frequency)? I'm
looking at the "VECTOR outside a Loop Structure" example in the CSR (pg.
1891 -- v. 15), but it appears to only get me back to a wide format file
anyway.
I feel like I'm staring a solution in the face...or at least looking in its
general direction. Thank you for your patient and gentle guidance.
Mark
=====================
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