|
OK, since nobody's answered this yet -
At 05:37 PM 9/25/2006, Jeffrey Farmer wrote:
>I have different organizations' attendance variables for five years -
>1994-1998. I would like to combine the years into one variable -
>Before Development. This variable would contain the sum of each year
>for each organization. Any ideas how to accomplish this task? Thanks.
Sure. It depends whether the attendance figures are one variable in
five records, or five variables in one record. This syntax is not
tested.
* One variable in five records: .
* Variables are ORGANZTN, YEAR, and ATTEND. .
SELECT IF (YEAR GE 1994) AND (YEAR LE 1998).
AGGREGATE OUTFILE=*
/BREAK=ORGANZTN
/Before_Development 'Total attendance 1994-1998'
= SUM(ATTEND).
* Five variables in one record: .
* Variables are ORGANZTN, ATND1994, ATND1995, .
* ATND1996, ATND1997, ATND1998. .
* (This only works if they are contiguous in .
* the file. If they aren't, you need to name .
* each individually in the SUM function.) .
COMPUTE Before_Development = SUM(ATND1994 TO ATND1998).
|