 Dataplot Vol 2 Vol 1

# CUMULATIVE (LET)

Name:
CUMULATIVE (LET)
Type:
Let Subcommand
Purpose:
Compute a cumulative statistic for a variable.
Description:
It is sometimes useful to a compute a cumulative value for a statistic. That is, for element i of the response variable we compute the value of the specified statistic for elements 1 to i.

Although this command is most commonly used for a location statistic, it can in fact be used for any supported statistic (enter HELP STATISTIC for a list of supported statistics).

Syntax:
LET <yout> = CUMULATIVE <stat> <y1> ... <yk>
<SUBSET/EXCEPT/FOR qualification>
where <y1> ... <yk> is a list of one to three response variables (depending on what <stat> is);
<stat> is one of the supported statistics (HELP STATISTICS for a list);
<yout> is a variable where the computed values are stored;
and where the <SUBSET/EXCEPT/FOR qualification> is optional.
Examples:
LET Y2 = CUMULATIVE MAD Y
LET Y2 = CUMULATIVE MEDIAN Y
LET Y2 = CUMULATIVE SD Y FOR I = 1 1 50
Note:
The commands CUMULATIVE AVERAGE, CUMULATIVE SUM, CUMULATIVE PRODUCT, CUMULATIVE INTEGRAL, CUMULATIVE MINIMUM, and CUMULATIVE MAXIMUM are implemented separately, and more efficiently, from this command.
Default:
None
Synonyms:
None
Related Commands:
 CROSS TABULATE (LET) = Compute a statistic, or a cumulative statistic, across groups. MOVING = Compute a moving statistic. CUMULATIVE SUM = Compute the cumulative sum of a variable. CUMULATIVE MEAN = Compute the cumulative mean of a variable. CUMULATIVE MINIMUM = Compute the cumulative minimum of a variable. CUMULATIVE MAXIMUM = Compute the cumulative minimum of a variable. CUMULATIVE PRODUCT = Compute the cumulative product of a variable. CUMULATIVE INTEGRAL = Compute the cumulative integral of a variable. CUMULATIVE HAZARD = Compute the cumulative hazard of a variable.
Applications:
Data Analysis
Implementation Date:
2013/01
Program:
```
skip 25
let n = size y
let x = sequence 1 1 n
.
let y1 = cumulative median y
let y2 = cumulative lower quartile y
let y3 = cumulative upper quartile y
.
line color red black black
.
plot y1 y2 y3 vs x
``` Date created: 01/07/2013
Last updated: 01/13/2013