Dataplot Vol 2 Vol 1

Name:
MAD TO MEDIAN (LET)
Type:
Let Subcommand
Purpose:
Compute the coefficient of dispersion based on the median absolute deviation from the median (MAD) 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 mean absolute deviation (AAD) to the median. An alternative definition is based on the MAD and the median. Specifically,

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

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

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

Syntax 1:
LET <par> = MAD TO MEDIAN <y>
<SUBSET/EXCEPT/FOR qualification>
where <y> is a response variable;
<par> is a parameter where the MAD TO MEDIAN value is saved;
and where the <SUBSET/EXCEPT/FOR qualification> is optional.
Syntax 2:
LET <par> = DIFFERENCE OF MAD 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 difference of the MAD to median values is saved;
and where the <SUBSET/EXCEPT/FOR qualification> is optional.
Examples:
LET D = MAD TO MEDIAN Y1
LET D = MAD TO MEDIAN Y1 SUBSET TAG > 2

LET D = DIFFERENCE OF MAD TO MEDIAN Y1

Note:
The 2017/12 version of Dataplot changed the definition for the coefficient of dispersion to use the mean absolute difference from the median rather than the median absolute difference from the median. The name of this command was changed from AAD TO MEDIAN to MAD TO MEDIAN and the computation was changed to use the MAD rather than the AAD. That is, the COEFFICIENT OF DISPERSION command was modified to compute what was previously 

This change was made to reflect the more common

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 = MAD TO MEDIAN Y1

Program 2:

. Step 1:   Create the data
.
skip 25
read gear.dat y x
skip 0
set write decimals 6
.
. Step 2:   Define plot control
.
title case asis
title offset 2
label case asis
.
y1label Coefficient of Dispersion (MAD to Median)
x1label Group
title MAD 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
mad to median plot y x
.
tabulate mad to median y x

             Cross Tabulate MAD TO MEDIAN

(Response Variables: Y        )
---------------------------------------------
X          |     MAD TO MEDIAN
---------------------------------------------
1.000000   |          0.003005
2.000000   |          0.002503
3.000000   |          0.002510
4.000000   |          0.003009
5.000000   |          0.004022
6.000000   |          0.007018
7.000000   |          0.003998
8.000000   |          0.002000
9.000000   |          0.002505
10.000000   |          0.002008

Program 3:

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

Cross Tabulate DIFFERENCE OF AAD TO MEDIAN

(Response Variables: Y1       Y2      )
---------------------------------------------
X          |   DIFFERENCE OF A
---------------------------------------------
1.0000   |           -0.0335
2.0000   |           -0.0121
3.0000   |           -0.0051

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

CHAR X ALL
LINE BLANK ALL
BOOTSTRAP DIFFERENCE OF MAD 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

Please email comments on this WWW page to alan.heckert@nist.gov.