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 cross-tabulate 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.


expand all

geomeanGeometric mean
harmmeanHarmonic mean
trimmeanMean, excluding outliers
nanmeanMean, ignoring NaN values
nanmedianMedian, ignoring NaN values
momentCentral moment
nanstdStandard deviation, ignoring NaN values
nanvarVariance, ignoring NaN values
rangeRange of values
nanmaxMaximum, ignoring NaN values
nanminMinimum, ignoring NaN values
iqrInterquartile range
madMean or median absolute deviation
prctilePercentiles of a data set
quantileQuantiles of a data set
zscoreStandardized z-scores
corrLinear or rank correlation
robustcovRobust multivariate covariance and mean estimate
cholcovCholesky-like covariance decomposition
corrcovConvert covariance matrix to correlation matrix
partialcorrLinear or rank partial correlation coefficients
partialcorriPartial correlation coefficients adjusted for internal variables
nancovCovariance ignoring NaN values
nearcorrCompute nearest correlation matrix by minimizing Frobenius distance
grpstatsSummary statistics organized by group
tabulateFrequency table
tiedrankRank adjusted for ties
nansumSum, ignoring NaN values


Exploratory Analysis of Data

Explore the distribution of data using descriptive statistics.

Data with Missing Values

Compute descriptive statistics while ignoring missing values.

Measures of Central Tendency

Locate a distribution of data along an appropriate scale.

Measures of Dispersion

Find out how spread out the data values are on the number line.

Quantiles and Percentiles

Learn how the Statistics and Machine Learning Toolbox computes quantiles and percentiles.

Grouping Variables

Grouping variables are utility variables used to group or categorize observations.