rolling 5 yr average

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

rolling 5 yr average

wsu_wright
Listed below is an excerpt from a database reporting degree completion in years for each academic program.

year  prog  time
1998 mc1 2
1998 mc2  2.5
1998 mc3  1
.
.
.
2001 mc1 1.8
2001 mc2  2
2001 mc3  3

I want to generate a report that displays rolling 3 year averages:

        1993-95  1994-96 1995-97
time    2.3          1.8          3

The goal is to keep it simple (ala running a means by 3yravg to generate a display of 3 year averages).

I could do separate temporary select ifs for 3 year segments, but then I can only output to a report a single year set per display.

Or perhaps I could aggregate by 3 year sets & then combine each as a separate 3 yr group.

Any ideas would be welcomed.

Thanks in advance.

David,
Reply | Threaded
Open this post in threaded view
|

Re: rolling 5 yr average

Oliver, Richard
Would the CREATE command give you what you want? For example:

CREATE ma_var1=MA(var1 3).

This creates a new variables that is the centered moving average of the original variable.

-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of David Wright
Sent: Monday, July 17, 2006 7:07 PM
To: [hidden email]
Subject: rolling 5 yr average

Listed below is an excerpt from a database reporting degree completion in years for each academic program.

year  prog  time
1998 mc1 2
1998 mc2  2.5
1998 mc3  1
.
.
.
2001 mc1 1.8
2001 mc2  2
2001 mc3  3

I want to generate a report that displays rolling 3 year averages:

        1993-95  1994-96 1995-97
time    2.3          1.8          3

The goal is to keep it simple (ala running a means by 3yravg to generate a display of 3 year averages).

I could do separate temporary select ifs for 3 year segments, but then I can only output to a report a single year set per display.

Or perhaps I could aggregate by 3 year sets & then combine each as a separate 3 yr group.

Any ideas would be welcomed.

Thanks in advance.

David,