Compute the cumulative average of a variable.
The cumulative average, Y2, of a variable Y is defined as:
Y2(1) = Y(1)
Y2(2) = (Y(1) + Y(2))/2
Y2(3) = (Y(1) + Y(2) + Y(3))/3
That is, the cumulative mean of an element in a variable
is simply the mean of all points in the variable up to and
including that element.
LET <y2> = CUMULATIVE AVERAGE <y1>
where <y1> is a response variable;
<y2> is a variable where the cumulative average
and where the <SUBSET/EXCEPT/FOR qualification> is optional.
LET Y2 = CUMULATIVE AVERAGE Y
LET Y2 = CUMULATIVE AVERAGE Y FOR I = 1 1 30
CUMULATIVE MEAN is a synonym for CUMULATIVE AVERAGE.
Compute the mean of a variable.
= Compute the cumulative sum of a variable.
= Compute the cumulative product of a variable.
= Compute the cumulative integral of a variable.
READ HAHN.DAT Y
LET YAVE = CUMULATIVE AVERAGE Y
Date created: 6/5/2001
Last updated: 4/4/2003
Please email comments on this WWW page to