$$\frac{\sum_{i=1}^{n}(x_i-\bar x)}{n}$$
This method will not work for calculating the mean deviation. Instead we have:
$$\frac{\sum_{i=1}^{n}|x_i-\bar x|}{n}.$$
I'm not quite understanding why we need to use absolute value. I read that if we don't use absolute value, we will always get zero, but I'm not understanding why. Absolute value isn't always used when dealing with differences, so why in this case?
Thanks.
$\dfrac{\sum_{i=1}^{n}(x_i-\bar x)}{n} = \frac{\sum_{i=1}^n x_i}{n} - \frac{\sum_{i=1}^n \bar{x}}{n} = \bar{x} - \frac{n \bar{x}}{n} = \bar{x} - \bar{x} = 0$ (so the average deviation from the mean is $0$ - this makes sense from what an average means). The other answer justifies why you want the absolute value (or some other actual distance metric - distances are non-negative)