function gamHat = quartile_coef_skewness(x) % QUARTILE_COEF_SKEWNESS - returns the quartile coeffient of skewness % % Written by: % -- % John L. Weatherwax 2008-02-20 % % email: wax@alum.mit.edu % % Please send comments and especially bug reports to the % above email address. % %----- % estimate the three quartiles using the "median of the median" method: xs = sort(x); q0_5 = median(xs); xlt = xs( find(xs<=q0_5) ); q0_25 = median( xlt ); xgt = xs( find(xs>=q0_5) ); q0_75 = median( xgt ); gamHat = (q0_75 - 2*q0_5 + q0_25)/(q0_75 - q0_25);