Dataplot Vol 2 Vol 1

# MEDIAN ABSOLUTE DEVIATION

Name:
MEDIAN ABSOLUTE DEVIATION (LET)
Type:
Let Subcommand
Purpose:
Compute the median absolute deviation for a variable.
Description:
The median absolute deviation is:

$$\mbox{MAD} = \mbox{median} |x - \tilde{x}|$$

where $$\tilde{x}$$ is the median of the variable. This statistic is sometimes used as a robust alternative to the standard deviation as a measure of scale.

The scaled MAD is defined as

For normally distributed data, the scaled MAD is approximately equal to the standard deviation.

Syntax 1:
LET <par> = MEDIAN ABSOLUTE DEVIATION <y>
<SUBSET/EXCEPT/FOR qualification>
where <y> is the response variable;
<par> is a parameter where the computed median absolute deviation is stored;
and where the <SUBSET/EXCEPT/FOR qualification> is optional.
Syntax 2:
LET <par> = SCALED MEDIAN ABSOLUTE DEVIATION <y>
<SUBSET/EXCEPT/FOR qualification>
where <y> is the response variable;
<par> is a parameter where the computed scaled median absolute deviation is stored;
and where the <SUBSET/EXCEPT/FOR qualification> is optional.
Examples:
LET A = MEDIAN ABSOLUTE DEVIATION Y1
LET A = MEDIAN ABSOLUTE DEVIATION Y1 SUBSET TAG > 2
LET A = SCALED MEDIAN ABSOLUTE DEVIATION Y1
Note:
Dataplot statistics can be used in a number of commands. For details, enter

Default:
None
Synonyms:
MAD is a synonym for MEDIAN ABSOLUTE DEVIATION
MADN is a synonym for SCALED MEDIAN ABSOLUTE DEVIATION
NORMALIZED is a synomym for SCALED
Related Commands:
 AVERAGE ABSOLUTE DEVIATION = Compute the average absolute deviation of a variable. STANDARD DEVIATION = Compute the standard deviation of a variable. VARIANCE = Compute the variance of a variable. RANGE = Compute the range of a variable.
Applications:
Robust Statistics
Implementation Date:
1995/04
2016/02: Added SCALED MEDIAN ABSOLUTE DEVIATION
Program 1:

LET Y1 = LOGISTIC RANDOM NUMBERS FOR I = 1 1 100
LET A1 = MEDIAN ABSOLUTE DEVIATION Y1
LET A2 = SCALED MEDIAN ABSOLUTE DEVIATION Y1

Program 2:

SKIP 25
TITLE AUTOMATIC
XLIMITS 1 10
MAJOR XTIC MARK NUMBER 10
MINOR XTIC MARK NUMBER 0
XTIC OFFSET 1 1
X1LABEL BATCH
Y1LABEL MEDIAN ABSOLUTE DEVIATION OF DIAMETER