nag_median_1var (g07dac) finds the median, median absolute deviation, and a robust estimate of the standard deviation for a set of ungrouped data.
The data consists of a sample of size
, denoted by
, drawn from a random variable
. nag_median_1var (g07dac) first computes the median
and from this the median absolute deviation can be computed,
Finally, a robust estimate of the standard deviation is computed,
is the value of the inverse standard Normal function at the point 0.75. nag_median_1var (g07dac) is based upon the algorithm used in the function LTMDDV in the ROBETH library, see Marazzi (1987)
Marazzi A (1987) Subroutines for robust and bounded influence regression in ROBETH Cah. Rech. Doc. IUMSP, No. 3 ROB 2 Institut Universitaire de Médecine Sociale et Préventive, Lausanne
The computations are believed to be stable.
nag_median_1var (g07dac) may be called with the same actual array supplied for arguments x
, in which case the sorted data values will overwrite the original contents of x
The following program reads in a set of data consisting of eleven observations of a variable x
. The median, median absolute deviation and a robust estimate of the standard deviation are calculated and printed along with the sorted data in output array y