Like Eva, I suspect Syed is referring to the median
_absolute_ deviation (from the median), recently
known as the MAD, but known already to Gauss in 1816.
In addition to Eva's very clear example of how to
do it from first principles, note that -egen- has
had a -mad()- function since Stata 7.
Nick
[email protected]
Eva Poen
Do you mean
sysuse auto, clear
qui sum price, detail
scalar median = r(p50)
gen deviation = abs(price - median)
qui sum deviation, detail
di "Median absolute deviation of the variable price is " r(p50)
drop deviation
?
Syed Gillani
> Is there a stata program doing median average deviation please?
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/