Descriptive Statistics

Numerical summaries and associated measures

Compute descriptive statistics from sample data, including measures of central tendency, dispersion, shape, correlation, and covariance. Tabulate and crosstabulate data, and compute summary statistics for grouped data. If your data contains missing (NaN) values, MATLAB® arithmetic operation functions return NaN. However, specialized functions available in Statistics and Machine Learning Toolbox™ ignore these missing values and return a numerical value calculated using the remaining values. For more information, see Data with Missing Values.


Central Tendency and Dispersion

geomean Geometric mean
harmmean Harmonic mean
trimmean Mean excluding outliers
nanmean Mean ignoring NaN values
nanmedian Median ignoring NaN values
kurtosis Kurtosis
moment Central moments
skewness Skewness
nanstd Standard deviation ignoring NaN values
nanvar Variance, ignoring NaN values

Ranges, Percentiles, and z-Scores

range Range of values
nanmax Maximum ignoring NaN values
nanmin Minimum ignoring NaN values
iqr Interquartile range
mad Mean or median absolute deviation
prctile Percentiles of a data set
quantile Quantiles of a data set
zscore Standardized z-scores

Correlation and Covariance

corr Linear or rank correlation
cholcov Cholesky-like covariance decomposition
corrcov Convert covariance matrix to correlation matrix
partialcorr Linear or rank partial correlation coefficients
partialcorri Partial correlation coefficients adjusted for internal variables
nancov Covariance ignoring NaN values

Tabulation and Grouped Data

grpstats Summary statistics organized by group
tabulate Frequency table
crosstab Cross-tabulation
tiedrank Rank adjusted for ties
nansum Sum ignoring NaN values
Was this topic helpful?