Descriptive Statistics, Data Summary and Related Commands - Maple Programming Help

Home : Support : Online Help : Statistics and Data Analysis : Statistics Package : Statistics/DescriptiveStatistics

Descriptive Statistics, Data Summary and Related Commands

 The Statistics package provides various commands for computing descriptive statistics and related quantities. These include location, dispersion and shape statistics, moments and cumulants. The package also provides several data summary and tabulation commands. In addition, most of these functions can handle weighted data and data with missing values. Here is the list of available commands

Available Commands

Location Statistics

 deciles geometric mean harmonic mean Hodges-Lehmann statistic generate a procedure for calculating statistical quantities arithmetic mean median mode percentiles quadratic mean quantiles quartiles trimmed mean winsorized mean

Dispersion Statistics

 compute the average absolute deviation interquartile range average absolute deviation from the mean compute the median absolute deviation range Rousseeuw and Croux' Qn Rousseeuw and Croux' Sn standard deviation variance coefficient of variation

Shape Statistics

 kurtosis skewness

Moments and Cumulants

 central moments cumulants moments standardized moments

Data Summary

 seven summary statistics five-point summary frequency table

Related Commands

 autocorrelations correlation/correlation matrix covariance/covariance matrix cross-correlations compute expected values order statistics principal component analysis principal component analysis standard error of the sampling distribution

Floating Point Environment

 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.

Supplying Data

 Most of the commands above can accept one- and two-dimensional data sets. One-dimensional data sets can be supplied as a list, a Vector, a one-dimensional Array, or a DataSeries. Two-dimensional data sets can be supplied as a list of lists, a Matrix, a two-dimensional Array, or a DataFrame.
 For more details on how two-dimensional data is handled, see the DataFrames in Statistics help page.

Data with Missing Values

 Missing values are represented by undefined or Float(undefined). Note that Float(undefined) propagates freely through most floating-point operations, which means that most statistics for a data set with missing values will yield undefined. The option ignore - which is available for most commands listed above - controls how missing data is handled. If ignore=true all missing items in a data set will be ignored. The default value of this option is false. For more details on a particular command, see the corresponding help page.

 Weights can be added to data by supplying an optional argument weights=value, where value is a vector of numeric constants. The number of elements in the weights array must be equal to the number of elements in the original data set. By default all elements in a data set are assigned weight $1$. For more details on a particular command, see the corresponding help page.

Examples

Generate random sample drawn from the non-central Beta distribution.

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

Compute the five point summary of the data sample.

 > $\mathrm{FivePointSummary}\left(A\right)$
 $\left[\begin{array}{c}{\mathrm{minimum}}{=}{0.00284705659174078}\\ {\mathrm{lowerhinge}}{=}{0.188161202689945}\\ {\mathrm{median}}{=}{0.271067705972343}\\ {\mathrm{upperhinge}}{=}{0.364718410290619}\\ {\mathrm{maximum}}{=}{0.881224090305735}\end{array}\right]$ (1)

Compute the mean, standard deviation, skewness, kurtosis, etc.

 > $\mathrm{DataSummary}\left(A\right)$
 $\left[\begin{array}{c}{\mathrm{mean}}{=}{0.282155087071985}\\ {\mathrm{standarddeviation}}{=}{0.125196186114285}\\ {\mathrm{skewness}}{=}{0.440928241161531}\\ {\mathrm{kurtosis}}{=}{2.84630585844533}\\ {\mathrm{minimum}}{=}{0.00284705659174078}\\ {\mathrm{maximum}}{=}{0.881224090305735}\\ {\mathrm{cumulativeweight}}{=}{1.000000}{}{{10}}^{{6}}\end{array}\right]$ (2)

Estimate the mode.

 > $\mathrm{Mode}\left(A\right)$
 ${0.241228990034607}$ (3)

Compute the second moment about .3.

 > $\mathrm{Moment}\left(A,2,\mathrm{origin}=0.3\right)$
 ${0.0159925102608858}$ (4)

Compute mean, trimmed mean and winsorized mean.

 > $\mathrm{Mean}\left(A\right),\mathrm{TrimmedMean}\left(A,1,99\right),\mathrm{WinsorizedMean}\left(A,1,99\right)$
 ${0.282155087072001}{,}{0.280925669045912}{,}{0.281857130439082}$ (5)

Compute frequency table for A.

 > $\mathrm{FrequencyTable}\left(A,\mathrm{range}=0..1,\mathrm{bins}=5\right)$
 $\left[\begin{array}{ccccc}{0.}{..}{0.200000000000000}& {283991.}& {28.39910000}& {283991.}& {28.39910000}\\ {0.200000000000000}{..}{0.400000000000000}& {536689.}& {53.66890000}& {820680.}& {82.06800000}\\ {0.400000000000000}{..}{0.600000000000000}& {168883.}& {16.88830000}& {989563.}& {98.95630000}\\ {0.600000000000000}{..}{0.800000000000000}& {10407.}& {1.040700000}& {999970.}& {99.99700000}\\ {0.800000000000000}{..}{1.}& {30.}& {0.003000000000}& {1.000000}{}{{10}}^{{6}}& {100.}\end{array}\right]$ (6)