Statistics - Maple Help

# Online Help

###### All Products    Maple    MapleSim

Home : Support : Online Help : Statistics and Data Analysis : Statistics Package : Summary and Tabulation : Statistics/FivePointSummary

Statistics

 FivePointSummary
 compute the five-point summary for a data sample

 Calling Sequence FivePointSummary(data, options)

Parameters

 data - options - (optional) equation(s) of the form option=value where option is one of ignore, output, summarize, or weights; specify options for the FivePointSummary 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 FivePointSummary 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 minimum, lowerhinge, median, upperhinge, or maximum, indicates which quantities need be calculated. The value of this option can also be a list. In this case the FivePointSummary 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.
 • 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 FivePointSummary command computes the minimum, lower hinge, median, upper hinge and the maximum of a data sample. By default, the FivePointSummary command returns a column vector of equations of the form quantity=value where quantity is one of minimum, lowerhinge, median, upperhinge, or maximum.
 • The first parameter A is a data set (e.g., a Vector) or a Matrix data set.

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 FivePointSummary command returns a Vector containing the summary statistics.

 > $\mathrm{FivePointSummary}\left(A\right)$
 $\left[\begin{array}{c}{\mathrm{minimum}}{=}{-}{1.61166425663017}\\ {\mathrm{lowerhinge}}{=}{7.91510830185606}\\ {\mathrm{median}}{=}{9.94306123337073}\\ {\mathrm{upperhinge}}{=}{11.9165768932441}\\ {\mathrm{maximum}}{=}{20.7830118018693}\end{array}\right]$ (1)
 > $\mathrm{FivePointSummary}\left(A,\mathrm{output}=\left[\mathrm{lowerhinge},\mathrm{upperhinge}\right]\right)$
 $\left[{7.91510830185606}{,}{11.9165768932441}\right]$ (2)

Note the difference between the quantities computed by the FivePointSummary and the Quantile commands.

 > $\mathrm{FivePointSummary}\left(A,\mathrm{output}=\left[\mathrm{lowerhinge},\mathrm{median},\mathrm{upperhinge}\right]\right)$
 $\left[{7.91510830185606}{,}{9.94306123337073}{,}{11.9165768932441}\right]$ (3)
 > $\mathrm{Quantile}\left(A,\left[0.25,0.5,0.75\right]\right)$
 $\left[{7.91509444943781}{,}{9.94306123337073}{,}{11.9168353743767}\right]$ (4)

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)$
 ${M}{≔}\left[\begin{array}{rrr}{3}& {1130}& {114694}\\ {4}& {1527}& {127368}\\ {3}& {907}& {88464}\\ {2}& {878}& {96484}\\ {4}& {995}& {128007}\end{array}\right]$ (5)

For Matrix input, the FivePointSummary command outputs a Vector containing the corresponding summary statistics by column.

 > $\mathrm{results}≔\mathrm{FivePointSummary}\left(M\right)$
 ${\mathrm{results}}{≔}\left[\begin{array}{ccc}\left[\begin{array}{c}{\mathrm{minimum}}{=}{2.}\\ {\mathrm{lowerhinge}}{=}{3.}\\ {\mathrm{median}}{=}{3.}\\ {\mathrm{upperhinge}}{=}{4.}\\ {\mathrm{maximum}}{=}{4.}\end{array}\right]& \left[\begin{array}{c}{\mathrm{minimum}}{=}{878.}\\ {\mathrm{lowerhinge}}{=}{907.}\\ {\mathrm{median}}{=}{995.}\\ {\mathrm{upperhinge}}{=}{1130.}\\ {\mathrm{maximum}}{=}{1527.}\end{array}\right]& \left[\begin{array}{c}{\mathrm{minimum}}{=}{88464.}\\ {\mathrm{lowerhinge}}{=}{96484.}\\ {\mathrm{median}}{=}{1.14694}{}{{10}}^{{5}}\\ {\mathrm{upperhinge}}{=}{1.27368}{}{{10}}^{{5}}\\ {\mathrm{maximum}}{=}{1.28007}{}{{10}}^{{5}}\end{array}\right]\end{array}\right]$ (6)

To display the summary for one of the columns:

 > ${\mathrm{results}}_{1}$
 $\left[\begin{array}{c}{\mathrm{minimum}}{=}{2.}\\ {\mathrm{lowerhinge}}{=}{3.}\\ {\mathrm{median}}{=}{3.}\\ {\mathrm{upperhinge}}{=}{4.}\\ {\mathrm{maximum}}{=}{4.}\end{array}\right]$ (7)

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{df}}{≔}\left[\begin{array}{cccc}{}& {a}& {b}& {c}\\ {1}& {3}& {1130}& {114694}\\ {2}& {4}& {1527}& {127368}\\ {3}& {3}& {907}& {88464}\\ {4}& {2}& {878}& {96484}\\ {5}& {4}& {995}& {128007}\end{array}\right]$ (8)
 > $\mathrm{df_results}≔\mathrm{FivePointSummary}\left(\mathrm{df}\right)$
 ${\mathrm{df_results}}{≔}\left[\begin{array}{cccc}{}& {a}& {b}& {c}\\ {\mathrm{minimum}}& {2.}& {878.}& {88464.}\\ {\mathrm{lowerhinge}}& {3.}& {907.}& {96484.}\\ {\mathrm{median}}& {3.}& {995.}& {1.14694}{}{{10}}^{{5}}\\ {\mathrm{upperhinge}}& {4.}& {1130.}& {1.27368}{}{{10}}^{{5}}\\ {\mathrm{maximum}}& {4.}& {1527.}& {1.28007}{}{{10}}^{{5}}\end{array}\right]$ (9)
 > ${\mathrm{df_results}}_{b}$
 $\left[\begin{array}{cc}{\mathrm{minimum}}& {878.}\\ {\mathrm{lowerhinge}}& {907.}\\ {\mathrm{median}}& {995.}\\ {\mathrm{upperhinge}}& {1130.}\\ {\mathrm{maximum}}& {1527.}\end{array}\right]$ (10)

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 FivePointSummary command is unchanged.

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

 1 2 3 minimum ${2.0}$ ${878.0}$ ${88464.0}$ lowerhinge ${3.0}$ ${907.0}$ ${96484.0}$ median ${3.0}$ ${995.0}$ ${1.146940}{}{{10}}^{{5}}$ upperhinge ${4.0}$ ${1130.0}$ ${1.273680}{}{{10}}^{{5}}$ maximum ${4.0}$ ${1527.0}$ ${1.280070}{}{{10}}^{{5}}$

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

 > ${\mathrm{results}}_{1}$
 $\left[\begin{array}{c}{\mathrm{minimum}}{=}{2.}\\ {\mathrm{lowerhinge}}{=}{3.}\\ {\mathrm{median}}{=}{3.}\\ {\mathrm{upperhinge}}{=}{4.}\\ {\mathrm{maximum}}{=}{4.}\end{array}\right]$ (11)
 > 

References

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

Compatibility

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

 See Also

## Was this information helpful?

 Please add your Comment (Optional) E-mail Address (Optional) What is ? This question helps us to combat spam