Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
6.0.1 - English

Change language to:
Français - 日本語 - Português - Русский

Please note that the recommended version of Scilab is 2025.0.0. This page might be outdated.
See the recommended documentation of this function

Scilab Help >> Statistics > Measures of Dispersion > mad

mad

mean absolute deviation

Syntax

s2=mad(x)
s2=mad(x,'r') or s2=mad(x,1)
s2=mad(x,'c') or s2=mad(x,2)

Arguments

x

real or complex vector or matrix

Description

This function computes the mean absolute deviation of a real or complex vector or matrix x.

For a vector or matrix x, s2=mad(x) returns in scalar s2 the mean absolute deviation of all the entries of x.

s2=mad(x,'r') (or, equivalently, s2=mad(x,1)) returns in each entry of the column vector s2 the mean absolute deviation of each column of x.

s2=mad(x,'c') (or, equivalently, s2=mad(x,2)) returns in each entry of the column vector s2 the mean absolute deviation of each row of x.

Examples

x  = [2 2 3 4 14];

// Mean absolute deviation of a set of data
// Expected = (|2-5|+|2-5|+|3-5|+|4-5|+|14-5|) / 5 = 3.6
mad(x)

Bibliography

Reference: Wonacott T.H.& Wonacott R.J. .- Introductory Statistics, 5th edition, John Wiley, 1990.

Report an issue
<< iqr Measures of Dispersion strange >>

Copyright (c) 2022-2024 (Dassault Systèmes)
Copyright (c) 2017-2022 (ESI Group)
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Mon Feb 12 19:26:49 CET 2018