DataSummary - Maple Help

Statistics

 DataSummary
 compute seven summary statistics for a data sample

 Calling Sequence DataSummary(A, options)

Parameters

 A - options - (optional) equation(s) of the form option=value where option is one of ignore, output, summarize, tableweights, or weights; specify options for the DataSummary function

Options

 The options argument can contain one or more of the options shown below. Some of these options are described in more detail in the Statistics[DescriptiveStatistics] help page.
 • ignore : truefalse; This option controls how missing data is handled by the DataSummary command. Missing items are represented by undefined or Float(undefined). So, if ignore=false and A contains missing data, most of the statistics command will yield undefined. If ignore=true all missing items in A will be ignored. The default value is false.
 • output : default or quantity where quantity is any of mean, standarddeviation, skewness, kurtosis, minimum, maximum and cumulativeweight, indicates which quantities need be calculated. The value of this option can also be a list. In this case the DataSummary command will return a list of the specified quantities in the specified order.
 • summarize : false or embed; Display an embedded summary table. The default is false.
 • tableweights : list(integer); Relative weights for the Table's columns' widths. By default all columns have equal weight.
 • weights : Vector of data weights. The number of elements in the weights array must be equal to the number of elements in the original data sample. By default all elements in A are assigned weight $1$.

Description

 • The DataSummary function computes seven summary statistics for the data set A. These are the mean, standard deviation, coefficient of skewness, coefficient of kurtosis, minimum, maximum and the cumulative weight of a data sample. By default the DataSummary command returns a column vector of equations of the form quantity=value where quantity is one of mean, standarddeviation, skewness, kurtosis, minimum, maximum, or cumulativeweight.
 • The first parameter A is the data set - such as a Vector.

Computation

 • All computations involving data are performed in floating-point; therefore, all data provided must have type realcons and all returned solutions are floating-point, even if the problem is specified with exact values.
 • For more information about computation in the Statistics package, see the Statistics[Computation] help page.

Examples

 > $\mathrm{with}\left(\mathrm{Statistics}\right):$
 > $X≔\mathrm{RandomVariable}\left(\mathrm{Normal}\left(10,3\right)\right):$
 > $A≔\mathrm{Sample}\left(X,{10}^{4}\right):$

The DataSummary command returns a Vector containing the summary statistics.

 > $\mathrm{DataSummary}\left(A\right)$
 $\left[\begin{array}{c}\mathrm{mean}=9.929906967641008\\ \mathrm{standarddeviation}=2.9854565077355004\\ \mathrm{skewness}=-0.03205073815120898\\ \mathrm{kurtosis}=2.987474052351289\\ \mathrm{minimum}=-1.6116642566301707\\ \mathrm{maximum}=20.78301180186928\\ \mathrm{cumulativeweight}=10000.0\end{array}\right]$ (1)
 > $\mathrm{DataSummary}\left(A,\mathrm{output}=\left[\mathrm{mean},\mathrm{standarddeviation}\right]\right)$
 $\left[{9.92990696764101}{,}{2.98545650773550}\right]$ (2)
 > $\mathrm{DataSummary}\left(A,\mathrm{output}=\left[\mathrm{minimum},\mathrm{mean},\mathrm{standarddeviation},\mathrm{maximum}\right]\right)$
 $\left[{-1.61166425663017}{,}{9.92990696764101}{,}{2.98545650773550}{,}{20.7830118018693}\right]$ (3)

Consider the following Matrix data set.

 > $M≔\mathrm{Matrix}\left(\left[\left[3,1130,114694\right],\left[4,1527,127368\right],\left[3,907,88464\right],\left[2,878,96484\right],\left[4,995,128007\right]\right]\right)$
 $\left[\begin{array}{rrr}3& 1130& 114694\\ 4& 1527& 127368\\ 3& 907& 88464\\ 2& 878& 96484\\ 4& 995& 128007\end{array}\right]$ (4)

For Matrix inputs, the DataSummary command outputs a Vector containing the corresponding summary statistics by column.

 > $\mathrm{results}≔\mathrm{DataSummary}\left(M\right)$
 $\left[\begin{array}{ccc}\left[\begin{array}{c}\mathrm{mean}=3.2\\ \mathrm{standarddeviation}=0.8366600265340756\\ \mathrm{skewness}=-0.30734449954313\\ \mathrm{kurtosis}=1.4775510204081639\\ \mathrm{minimum}=2.0\\ \mathrm{maximum}=4.0\\ \mathrm{cumulativeweight}=5.0\end{array}\right]& \left[\begin{array}{c}\mathrm{mean}=1087.4\\ \mathrm{standarddeviation}=264.5719183889326\\ \mathrm{skewness}=0.9339774575409044\\ \mathrm{kurtosis}=2.061469467497881\\ \mathrm{minimum}=878.0\\ \mathrm{maximum}=1527.0\\ \mathrm{cumulativeweight}=5.0\end{array}\right]& \left[\begin{array}{c}\mathrm{mean}=1.110034{}{10}^{5}\\ \mathrm{standarddeviation}=17953.973120175935\\ \mathrm{skewness}=-0.22301188518436363\\ \mathrm{kurtosis}=1.1020141039120812\\ \mathrm{minimum}=88464.0\\ \mathrm{maximum}=1.280070{}{10}^{5}\\ \mathrm{cumulativeweight}=5.0\end{array}\right]\end{array}\right]$ (5)

To display the summary for one of the columns:

 > $\mathrm{results}\left[1\right]$
 $\left[\begin{array}{c}\mathrm{mean}=3.2\\ \mathrm{standarddeviation}=0.8366600265340756\\ \mathrm{skewness}=-0.30734449954313\\ \mathrm{kurtosis}=1.4775510204081639\\ \mathrm{minimum}=2.0\\ \mathrm{maximum}=4.0\\ \mathrm{cumulativeweight}=5.0\end{array}\right]$ (6)

If the input is a DataFrame object, then the result is a DataFrame that has the same column labels as the original input, and the row labels correspond to the output quantities requested.

 > $\mathrm{df}≔\mathrm{DataFrame}\left(M,\mathrm{columns}=\left[a,b,c\right]\right)$
 ${\mathrm{DataFrame}}{}\left(\left[\begin{array}{rrr}3& 1130& 114694\\ 4& 1527& 127368\\ 3& 907& 88464\\ 2& 878& 96484\\ 4& 995& 128007\end{array}\right]{,}{\mathrm{rows}}{=}\left[{1}{,}{2}{,}{3}{,}{4}{,}{5}\right]{,}{\mathrm{columns}}{=}\left[{a}{,}{b}{,}{c}\right]\right)$ (7)
 > $\mathrm{df_results}≔\mathrm{DataSummary}\left(\mathrm{df}\right)$
 ${\mathrm{DataFrame}}{}\left(\left[\begin{array}{ccc}3.2& 1087.4& 1.110034{}{10}^{5}\\ 0.8366600265340756& 264.5719183889326& 17953.973120175935\\ -0.30734449954313& 0.9339774575409044& -0.22301188518436363\\ 1.4775510204081639& 2.061469467497881& 1.1020141039120812\\ 2.0& 878.0& 88464.0\\ 4.0& 1527.0& 1.280070{}{10}^{5}\\ 5.0& 5.0& 5.0\end{array}\right]{,}{\mathrm{rows}}{=}\left[{\mathrm{mean}}{,}{\mathrm{standarddeviation}}{,}{\mathrm{skewness}}{,}{\mathrm{kurtosis}}{,}{\mathrm{minimum}}{,}{\mathrm{maximum}}{,}{\mathrm{cumulativeweight}}\right]{,}{\mathrm{columns}}{=}\left[{a}{,}{b}{,}{c}\right]\right)$ (8)
 > $\mathrm{df_results}\left[b\right]$
 ${\mathrm{DataSeries}}{}\left(\left[\begin{array}{ccccccc}1087.4& 264.5719183889326& 0.9339774575409044& 2.061469467497881& 878.0& 1527.0& 5.0\end{array}\right]{,}{\mathrm{labels}}{=}\left[{\mathrm{mean}}{,}{\mathrm{standarddeviation}}{,}{\mathrm{skewness}}{,}{\mathrm{kurtosis}}{,}{\mathrm{minimum}}{,}{\mathrm{maximum}}{,}{\mathrm{cumulativeweight}}\right]{,}{\mathrm{datatype}}{=}{\mathrm{anything}}\right)$ (9)

The summarize option makes it possible to display an embedded table containing the results. Note that the embedded table is only for display and that the returned value of the DataSummary command is unchanged.

 > $\mathrm{results}≔\mathrm{DataSummary}\left(\mathrm{df},\mathrm{summarize}=\mathrm{embed}\right):$

 a b c mean ${3.20000000000000018}$ ${1087.40000000000009}$ ${111003.399999999994}$ standarddeviation ${0.836660026534075563}$ ${264.571918388932602}$ ${17953.9731201759350}$ skewness ${-0.307344499543129979}$ ${0.933977457540904443}$ ${-0.223011885184363629}$ kurtosis ${1.47755102040816388}$ ${2.06146946749788107}$ ${1.10201410391208121}$ minimum ${2.}$ ${878.}$ ${88464.}$ maximum ${4.}$ ${1527.}$ ${128007.}$ cumulativeweight ${5.}$ ${5.}$ ${5.}$

Similar to the example above, the returned value for results is the same:

 > $\mathrm{results}\left[1\right]$
 ${\mathrm{DataSeries}}{}\left(\left[\begin{array}{ccccccc}3.2& 0.8366600265340756& -0.30734449954313& 1.4775510204081639& 2.0& 4.0& 5.0\end{array}\right]{,}{\mathrm{labels}}{=}\left[{\mathrm{mean}}{,}{\mathrm{standarddeviation}}{,}{\mathrm{skewness}}{,}{\mathrm{kurtosis}}{,}{\mathrm{minimum}}{,}{\mathrm{maximum}}{,}{\mathrm{cumulativeweight}}\right]{,}{\mathrm{datatype}}{=}{\mathrm{anything}}\right)$ (10)

The tableweights option controls the width of columns in an embedded table.

 > $\mathrm{interface}\left(\mathrm{displayprecision}=4\right):$
 > $\mathrm{DataSummary}\left(\mathrm{df},\mathrm{summarize}=\mathrm{embed},\mathrm{tableweights}=\left[4,2,2,2\right]\right):$

 a b c mean ${3.2000}$ ${1087.4000}$ ${1.1100}{×}{{10}}^{{5}}$ standarddeviation ${0.8367}$ ${264.5719}$ ${1.7954}{×}{{10}}^{{4}}$ skewness ${-0.3073}$ ${0.9340}$ ${-0.2230}$ kurtosis ${1.4776}$ ${2.0615}$ ${1.1020}$ minimum ${2.0000}$ ${878.0000}$ ${8.8464}{×}{{10}}^{{4}}$ maximum ${4.0000}$ ${1527.0000}$ ${1.2801}{×}{{10}}^{{5}}$ cumulativeweight ${5.0000}$ ${5.0000}$ ${5.0000}$

 > 

References

 Stuart, Alan, and Ord, Keith. Kendall's Advanced Theory of Statistics. 6th ed. London: Edward Arnold, 1998. Vol. 1: Distribution Theory.

Compatibility

 • The A parameter was updated in Maple 16.
 • The summarize option was introduced in Maple 2016.
 • For more information on Maple 2016 changes, see Updates in Maple 2016.
 • The Statistics[DataSummary] command was updated in Maple 2019.
 • The tableweights option was introduced in Maple 2019.
 • For more information on Maple 2019 changes, see Updates in Maple 2019.