| 1 | <html><head><meta name="robots" content="index,follow"><meta http-equiv="Content-Type" content="text/html; charset=utf-8"> |
| 2 | <title>Table: Get median absolute deviation...</title> |
| 3 | <style> |
| 4 | td { padding-left: 5pt; padding-right: 5pt; } |
| 5 | th { padding-left: 5pt; padding-right: 5pt; } |
| 6 | code { white-space: pre-wrap; } |
| 7 | dd { white-space: pre-wrap; } |
| 8 | </style> |
| 9 | </head><body bgcolor="#FFFFFF"> |
| 10 | |
| 11 | <table border=0 cellpadding=0 cellspacing=0><tr><td bgcolor="#CCCC00"><table border=4 cellpadding=9><tr><td align=middle bgcolor="#000000"><font face="Palatino,Times" size=6 color="#999900"><b> |
| 12 | Table: Get median absolute deviation... |
| 13 | </b></font></table></table> |
| 14 | <p>Get the median absolute deviation (MAD) of the column in the selected <a href="Table.html">Table</a> (adjusted by a scale factor).</p> |
| 15 | <h2>Algorithm</h2> |
| 16 | <p>From the <i>n</i> numbers <i>x</i><sub>1</sub>, <i>x</i><sub>2</sub>, ..., <i>x</i><sub><i>n</i></sub> in the selected column we first calculate the <a href="quantile_algorithm.html">median</a> value <i>x</i><sub>median</sub>. Next we calculate the <i>n</i> absolute deviations from this median: <i>d</i><sub>1</sub>, <i>d</i><sub>2</sub>, ..., <i>d</i><sub><i>n</i></sub>, where <i>d</i><sub><i>j</i></sub>=|<i>x</i><sub><i>j</i></sub> - <i>x</i><sub>median</sub>|. Then we calculate the MAD value, which is the median of the <i>n</i> values <i>d</i><sub>1</sub>, <i>d</i><sub>2</sub>, ..., <i>d</i><sub><i>n</i></sub>. Finally we multiply the MAD value by the scale factor 1.4826. This last multiplication makes the result comparable with the value of the standard deviation if the <i>x</i> values are normally distributed.</p> |
| 17 | <hr> |
| 18 | <address> |
| 19 | <p>© djmw 20120405</p> |
| 20 | </address> |
| 21 | </body> |
| 22 | </html> |