Dataplot Vol 2 Vol 1

Name:
Type:
Let Subcommand
Purpose:
Compute the coefficient of dispersion based on the average absolute deviation (AAD) and the median of a variable.
Description:
There are a number of definitions for the coefficient of dispersion. Dataplot uses the definition based on the ratio of the median absolute deviation (MAD) to the median. An alternative definition is based on the AAD and the median. Specifically,

$$\mbox{d} = \frac{\mbox{AAD}}{\tilde{x}}$$

where AAD and $$\tilde{x}$$ denote the average absolute deviation and the median, respectively. This is the statistic computed by this command.

Note that the AAD used here is defined as

$$\mbox{AAD} = \frac{\sum_{i=1}^{n}{|X_{i} - \tilde{x}|}} {n}$$

That is, we compute the deviations from the median rather than the mean.

This statistic is a robust alternative to the coefficient of variation.

Syntax 1:
LET <par> = AAD TO MEDIAN <y>
<SUBSET/EXCEPT/FOR qualification>
where <y> is a response variable;
<par> is a parameter where the AAD TO MEDIAN value is saved;
and where the <SUBSET/EXCEPT/FOR qualification> is optional.
Syntax 2:
LET <par> = DIFFERENCE OF AAD TO MEDIAN <y1> <y2>
<SUBSET/EXCEPT/FOR qualification>
where <y1> is the first response variable;
<y2> is the second response variable;
<par> is a parameter where the AAD TO MEDIAN value is saved;
and where the <SUBSET/EXCEPT/FOR qualification> is optional.
Examples:
LET D = AAD TO MEDIAN Y1
LET D = AAD TO MEDIAN Y1 SUBSET TAG > 2

LET D = DIFFERENCE OF AAD TO MEDIAN Y1

Note:
Dataplot statistics can be used in a number of commands. For details, enter

Default:
None
Synonyms:
None
Related Commands:
 COEFFICIENT OF DISPERSION = Compute the coefficient of dispersion of a variable. QUARTILE COEFFICIENT OF DISPERSION = Compute the quartile coefficient of dispersion of a variable. COEFFICIENT OF VARIATION = Compute the coefficient of variation. RELATIVE STANDARD DEVIATION = Compute the relative standard deviation of a variable. MEDIAN = Compute the median of a variable. MEAN = Compute the mean of a variable. AVERAGE ABSOLUTE DEVIATION = Compute the average absolute deviation of a variable. STANDARD DEVIATION = Compute the standard deviation of a variable.
Applications:
Data Analysis
Implementation Date:
2017/01
Program 1:

LET Y1 = DOUBLE EXPONENTIAL NUMBERS FOR I = 1 1 100
LET D = AAD TO MEDIAN Y1

Program 2:

. Step 1:   Create the data
.
skip 25
skip 0
set write decimals 6
.
. Step 2:   Define plot control
.
title case asis
title offset 2
label case asis
.
y1label Coefficient of Dispersion (AAD to Median)
x1label Group
title AAD to Median for GEAR.DAT
let ngroup = unique x
xlimits 1 ngroup
major x1tic mark number ngroup
minor x1tic mark number 0
tic mark offset units data
x1tic mark offset 0.5 0.5
y1tic mark label decimals 3
.
character X
line blank
.
set statistic plot reference line average
aad to median plot y x
.
tabulate aad to median y x

(Response Variables: Y        )
---------------------------------------------
---------------------------------------------
1.000000   |          0.003405
2.000000   |          0.003704
3.000000   |          0.002811
4.000000   |          0.003210
5.000000   |          0.006134
6.000000   |          0.007419
7.000000   |          0.005497
8.000000   |          0.002800
9.000000   |          0.003106
10.000000   |          0.003815

Program 3:

SKIP 25
READ IRIS.DAT Y1 TO Y4 X
.
LET A = DIFFERENCE OF AAD TO MEDIAN Y1 Y2
SET WRITE DECIMALS 4
TABULATE DIFFERENCE OF AAD TO MEDIAN Y1 Y2 X

Cross Tabulate DIFFERENCE OF AAD TO MEDIAN

(Response Variables: Y1       Y2      )
---------------------------------------------
X          |   DIFFERENCE OF A
---------------------------------------------
1.0000   |           -0.0295
2.0000   |           -0.0181
3.0000   |           -0.0036

. XTIC OFFSET 0.2 0.2 X1LABEL GROUP ID Y1LABEL DIFFERENCE OF AAD TO MEDIAN CHAR X LINE BLANK DIFFERENCE OF AAD TO MEDIAN PLOT Y1 Y2 X

CHAR X ALL LINE BLANK ALL BOOTSTRAP DIFFERENCE OF AAD TO MEDIAN PLOT Y1 Y2 X

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

Date created: 01/24/2017
Last updated: 06/30/2017