MATLAB: Median vs Mean averages using skewness

averageMATLABmeanmedianskewnessStatistics and Machine Learning Toolbox

Hi,
I would like to take the average of some data, but I'm unsure whether to use median or mean.
I know of the skewness function, but I'm not sure how to use what this outputs. I know negative and positive skewness refers to the side it is skewed, but besides that I don't know what is considered a large or small skewness. I'm looking for a ballpark value at which if the skewness exceeds this value, the median is the better option, and below this value the mean would be the better option. Has anyone worked with this before or has a better way to choose which average to use?
Thanks!

Best Answer

It depends on what you want to do. In a symmetric distribution, the mean and median will be close if not equal. The mean is affected by extreme values, while the median is not. If you have any doubts as to the ‘best’ parameter, I would simply choose the median.
To illustrate:
x1 = [1 2 3 10];
x2 = [1 2 3 99];
x1_stats = [mean(x1) median(x1)]
x2_stats = [mean(x2) median(x2)]
x1_stats =
4 2.5
x2_stats =
26.25 2.5
Related Question