Date: Fri, 14 Mar 2008 13:06:44 -0400
Reply-To: Richard Ristow <wrristow@mindspring.com>
Sender: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From: Richard Ristow <wrristow@mindspring.com>
Subject: Re: CASESTOVARS / LOOP-END LOOP(?)
In-Reply-To: <9b14e15b0803140854r3cb9f6f7gf9e68a154afe7527@mail.gmail.co m>
Content-Type: text/plain; charset="us-ascii"; format=flowed
At 11:54 AM 3/14/2008, Mark Palmberg wrote:
>On Thu, Mar 13, 2008 at 8:35 PM, Richard Ristow wrote:
>
>>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?
Exactly. But don't reorder them. On the CASESTOVARS, use
"/GROUPBY=VARIABLE" instead of "/GROUPBY=INDEX", in the first place.
(It's selectable in the wizard.)
>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):
Syntax not re-quoted; but, yes.
>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.
Yes. A VECTOR exists only within each case, and LOOP runs during the
processing of one case. VECTOR/LOOP logic will only work with a
wide-format file.
>to be able to -- from a long-form data file -- measure a donor's
>giving performance (measured by amount and frequency)?
Mostly, you'll compute some intermediate variables (often using LAG),
and then use AGGREGATE. But I can't be more specific (except for
guesses) without knowing what performance measures you want.
>I feel like I'm staring a solution in the face...or at least looking in its
>general direction.
You certainly are. The AGGREGATE code from your first posting in this
thread (dropping MODE=ADDVARIABLES) already gives some useful
performance measures by year. From the original file with one record
per gift, it's quite easy to get,
. Dates of earliest and most recent gifts
. Number of gifts ever received, and total amount. (From these, you
can get mean size of gift. From SPSS 14 on, AGGREGATE can also give
you the median size of gift -- probably important, as donors usually
have a 'regular' and a 'special' gift size.)
From the file you've created, with summary statistics by year, you
can calculate,
. Time trend in giving, by any of those measures (though I suppose
total per year is the most important). You can do that by, say,
regression; or by looking at the ratio of giving in the latest and
earliest year, converted into percent growth per year; or, probably,
most other measures you can think of.)
Now, can I leave these for you, as exercises in using AGGREGATE? Post
again, of course, if you have trouble; or if you want measures other
than these, and don't know how to get them.
-With best regards,
Richard
=====================
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