EXTREMUM Instruction |
EXTREMUM( options ) series start end
Locates extreme values of a single series. STATISTICS with the FRACTILES option can also get the maximum and minimum as well as other quantiles like the median. The TABLE instruction can be used to find the maximum and minimum across a set of series. SSTATS with the MIN or the MAX option can be used to locate the maximum or minimum value taken by an expression without having to create a separate series.
Wizard
This is on the Statistics>Univariate Statistics Wizard.
Parameters
|
series |
series to examine |
|
start, end |
range to use. By default, the range of series |
Options
[PRINT]/NOPRINT
TITLE="title for output" ["Extreme Values for Series xxx"]
SMPL=Standard SMPL option [unused]
SHUFFLE=SERIES[INTEGER] with entry remapping[unused]
Variables
|
%MAXENT |
entry at which maximum is reached (INTEGER) |
|
%MAXIMUM |
maximum value (REAL) |
|
%MINENT |
entry at which minimum is reached (INTEGER) |
|
%MINIMUM |
minimum value (REAL) |
Example
This standardizes the daily changes in the DJIA into a mean zero, variance one series and uses EXTREMUM to locate the maximum and minimum values of the standardized series. It uses the %MINIMUM variable defined by the instruction to compute the tail probability of the minimum value.
*
* Stock & Watson, Introduction to Econometrics, 3rd edition
* CHAPTER 2
* Page 39
*
* The data are read as "irregular" rather than daily because there are
* missing dates on the file due to holidays, and the percentage change
* (in the analysis) is taken to mean the change since the previous
* trading day. If read as daily, missing values would be inserted for
* the holidays, and the percentage change would also be a missing value
* for that data point and the next.
*
cal(irregular)
open data ch02_badday.xls
data(format=xls,org=columns) 1 2528 decimaldate djia
set pchange = 100.0*log(djia/djia{1})
*
* The STATS (short for statistics) instruction computes sample
* statistics on a single series. In addition to the output, it also
* saves the calculated values in various pre-defined variables. In this
* case, we use %MEAN and %VARIANCE to compute the "z" scores for the
* data, that, is the number of standard errors from the sample mean.
*
stats pchange
set zscores = (pchange-%mean)/sqrt(%variance)
*
* The EXT instruction (short for extremum) locates the maximum and
* minimum values.
*
ext zscores
*
* This displays the probability of a standardized normal being less than
* the observed minimum.
*
disp "Probability of October drop using Normal" %cdf(%minimum)
Sample Output
Extreme Values of Series ZSCORES
Minimum Value is -2.9709670006 at Entry 53
Maximum Value is 3.9453491369 at Entry 78
Copyright © 2026 Thomas A. Doan