MATHEMATICA TUTORIAL

# Statistics with Units

Mathematica supports a large number of descriptive statistics operations on datasets composed of Quantity expressions, including location, covariance, correlation, and shape statistics functions. A general description of these functions can be found in "Descriptive Statistics".

For univariate datasets, statistics functions require that all elements within the dataset contain compatible units. If the units are not compatible, an error message describing the conflict is returned.

Here is a dataset.
This finds the Mean and Median of the univariate data.
 Out[2]=
Here is a matrix composed of Quantity expressions.
 Out[3]=
Location functions will evaluate matrices.
 Out[4]=
 Out[5]//MatrixForm=
Moment will have UnitDimensions of the Product of input data columns, based on the moment specifications.
 Out[6]=
 Out[7]=

### Multivariate Data

For multivariate datasets, statistics functions require that all elements within each column of the dataset contain compatible units. If the units are not compatible, an error message describing the conflict is returned.

Here is multivariate data with different units in each column.
 Out[8]=
Location functions will evaluate column-wise on multivariate datasets.
 Out[9]=
 Out[10]//MatrixForm=
Moment will have UnitDimensions of the Product of input data columns, based on the moment specifications.
 Out[11]=

## Related TutorialsRelated Tutorials

New to Mathematica? Find your learning path »
Have a question? Ask support »