File Exchange

image thumbnail

Descriptive Statistics

version 1.1 (3.01 KB) by

Calculates key values of the descriptive statistics



View License

This function gets the key values for a descriptive statistics such as mean, std, mode, median, quartiles and percentiles. This includes the five- and seven-number summary.

Input x must be a vector or a matrix where each column of x is regarded as a data set if x is a matrix. Input param is an optional cell list of parameters, e.g., param = {'whisker', 2} setting whisker = 2. Multiple user defined options are separated by semi-colon, e.g., param = {'whisker', 2; 'qmethod','-mean'}.

Output ds is a structure. To extract the quartiles for instance quart = ds.quartile.

ds = getDescriptiveStatistics(randn(1000,10))

ds = getDescriptiveStatistics(rand(1000,2),{'whisker', 2; 'qmethod','-mean'})

ds = getDescriptiveStatistics(rand(1000,2),{'percent', [25 50 75];'pmethod','nearestRank'})

Comments and Ratings (3)


Useful..but could have been better if the calculation based on groups or classes would have possible..for example, in a single column data (variables), you have several classes (categories), and then calculation on each categories would have achieved. If you do not understand, please refer "grpstats" function of MATLAB..Combination of these fucntions would give more flexibility may be...Anyway good function... :)

Yen Hanning



very useful. Thanks.



Small error corrections.

MATLAB Release
MATLAB 7.10 (R2010a)

Inspired: summarize

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video