Dataplot Vol 2 Vol 1

# WINDOW (LET)

Name:
WINDOW (LET)
Type:
Let Subcommand
Purpose:
Compute a statistic for fixed size intervals of the response variable.
Description:
This command can be used to compute the value of a statistic for groups of a response variable. The following commands are similar

LET NSIZE = 10
LET YSTAT = WINDOW MEAN Y

LET YSTAT = CROSS TABULATE MEAN Y X

The distinction is in how the groups are formed. For the LET ... = CROSS TABULATE command, the groups are formed based on the distinct values of the group-id variable (X in the above example). For the LET .. = WINDOW command, groups are formed from contiguous rows of the response variable. The LET NSIZE command is used to specify the size of each group.

This can in fact be used for any supported statistic (enter HELP STATISTIC for a list of supported statistics).

Syntax:
LET <yout> = WINDOW <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 = WINDOW MAD Y
LET Y2 = WINDOW MEDIAN Y
LET Y2 = WINDOW SD Y SUBSET Y > 0
Default:
None
Synonyms:
None
Related Commands:
 WINDOW STATISTIC PLOT = Plot the value of a statistic over contiguous groups in the response variable. CROSS TABULATE (LET) = Compute a statistic, or a cumulative statistic, across groups. MOVING = Compute a moving statistic. CUMULATIVE = Compute a cumulative statistic.
Applications:
Data Analysis
Implementation Date:
2016/06
Program:
```
skip 25
let nsize = 20
let ymean = window mean y
set write decimals 4
print ymean
```
The following output is generated
```
---------------
YMEAN
---------------
0.9986
0.9968
0.9954
1.0010
0.9966
```

NIST is an agency of the U.S. Commerce Department.

Date created: 07/06/2016
Last updated: 07/06/2016