Statistics - Maple Programming Help

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

Statistics

 FrequencyTable
 compute the frequency table for a data sample

 Calling Sequence FrequencyTable(A, options)

Parameters

 A - options - (optional) equation(s) of the form option=value where option is one of ignore, weights, bins, headers, or summarize; specify options for the FrequencyTable 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 FrequencyTable 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.
 • 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$.
 • bins : posint; If this option is set, every data range will be subdivided into the given number of equal subintervals. Note that each subinterval except for the last one is considered closed from the left and open from the right; the last subinterval in each range includes both endpoints. The default value of bins is 10 if only one range is given and 1 if multiple ranges are given.
 • headers : truefalse; If this option is set to true, the returned array contains the header information for each of the columns. The default is false.
 • summarize : false or embed; Display an embedded summary table. The default is false.

Description

 • The FrequencyTable command computes the frequency table for the data set A. This is done by subdividing all data from A into the specified number of ranges of equal size and computing the number of observations falling in each range. The ranges are considered closed from the left and open from the right, the rightmost range is also closed from the right. The FrequencyTable command returns a 5-column Array. The first column contains the ranges. The remaining four columns contain the absolute frequency, the percentage, the cumulative frequency and the cumulative percentage of the data.
 • 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.

Examples

 > $\mathrm{with}\left(\mathrm{Statistics}\right):$
 > $A≔\mathrm{Array}\left(\left[\mathrm{seq}\left(\mathrm{nextprime}\left(i\right),i=100..700\right)\right]\right)$
 ${A}{≔}\left[\begin{array}{c}{\mathrm{1 .. 601}}{\mathrm{Array}}\\ {\mathrm{Data Type:}}{\mathrm{anything}}\\ {\mathrm{Storage:}}{\mathrm{rectangular}}\\ {\mathrm{Order:}}{\mathrm{Fortran_order}}\end{array}\right]$ (1)
 > $\mathrm{FrequencyTable}\left(A\right)$
 $\left[\begin{array}{ccccc}{101.}{..}{161.}& {57.}& {9.484193012}& {57.}& {9.484193012}\\ {161.}{..}{221.}& {54.}& {8.985024958}& {111.}& {18.46921797}\\ {221.}{..}{281.}& {66.}& {10.98169717}& {177.}& {29.45091514}\\ {281.}{..}{341.}& {60.}& {9.983361065}& {237.}& {39.43427621}\\ {341.}{..}{401.}& {60.}& {9.983361065}& {297.}& {49.41763727}\\ {401.}{..}{461.}& {60.}& {9.983361065}& {357.}& {59.40099834}\\ {461.}{..}{521.}& {52.}& {8.652246256}& {409.}& {68.05324459}\\ {521.}{..}{581.}& {68.}& {11.31447587}& {477.}& {79.36772047}\\ {581.}{..}{641.}& {54.}& {8.985024958}& {531.}& {88.35274542}\\ {641.}{..}{701.}& {70.}& {11.64725458}& {601.}& {100.0000000}\end{array}\right]$ (2)

Try fewer bins.

 > $\mathrm{FrequencyTable}\left(A,\mathrm{bins}=3,\mathrm{headers}\right)$
 $\left[\begin{array}{ccccc}{\mathrm{Range}}& {\mathrm{Absolute Frequency}}& {\mathrm{Percentage}}& {\mathrm{Cumulative Frequency}}& {\mathrm{Cumulative Percentage}}\\ {101.}{..}{301.}& {193.}& {32.11314476}& {193.}& {32.11314476}\\ {301.}{..}{501.}& {206.}& {34.27620632}& {399.}& {66.38935108}\\ {501.}{..}{701.}& {202.}& {33.61064892}& {601.}& {100.0000000}\end{array}\right]$ (3)

Consider a data set with missing values.

 > $B≔\mathrm{Array}\left(\left[\mathrm{seq}\left(i,i=100..300\right),\mathrm{seq}\left(\mathrm{undefined},i=1..100\right)\right]\right)$
 ${B}{≔}\left[\begin{array}{c}{\mathrm{1 .. 301}}{\mathrm{Array}}\\ {\mathrm{Data Type:}}{\mathrm{anything}}\\ {\mathrm{Storage:}}{\mathrm{rectangular}}\\ {\mathrm{Order:}}{\mathrm{Fortran_order}}\end{array}\right]$ (4)
 > $\mathrm{FrequencyTable}\left(B,\mathrm{bins}=3\right)$
 $\left[\begin{array}{ccccc}{100.}{..}{\mathrm{HFloat}}{}\left({\mathrm{undefined}}\right)& {0.}& {0.}& {0.}& {0.}\\ {\mathrm{HFloat}}{}\left({\mathrm{undefined}}\right){..}{\mathrm{HFloat}}{}\left({\mathrm{undefined}}\right)& {0.}& {0.}& {0.}& {0.}\\ {\mathrm{HFloat}}{}\left({\mathrm{undefined}}\right){..}{\mathrm{HFloat}}{}\left({\mathrm{undefined}}\right)& {0.}& {0.}& {0.}& {0.}\end{array}\right]$ (5)
 > $\mathrm{FrequencyTable}\left(B,\mathrm{ignore}=\mathrm{true}\right)$
 $\left[\begin{array}{ccccc}{100.}{..}{120.}& {20.}& {9.950248756}& {20.}& {9.950248756}\\ {120.}{..}{140.}& {20.}& {9.950248756}& {40.}& {19.90049751}\\ {140.}{..}{160.}& {20.}& {9.950248756}& {60.}& {29.85074627}\\ {160.}{..}{180.}& {20.}& {9.950248756}& {80.}& {39.80099502}\\ {180.}{..}{200.}& {20.}& {9.950248756}& {100.}& {49.75124378}\\ {200.}{..}{220.}& {20.}& {9.950248756}& {120.}& {59.70149254}\\ {220.}{..}{240.}& {20.}& {9.950248756}& {140.}& {69.65174129}\\ {240.}{..}{260.}& {20.}& {9.950248756}& {160.}& {79.60199005}\\ {260.}{..}{280.}& {20.}& {9.950248756}& {180.}& {89.55223881}\\ {280.}{..}{300.}& {21.}& {10.44776119}& {201.}& {100.0000000}\end{array}\right]$ (6)

Try weighted data.

 > $C≔\mathrm{Array}\left(\left[\mathrm{seq}\left(i,i=20..30\right)\right]\right)$
 ${C}{≔}\left[\begin{array}{c}{\mathrm{1 .. 11}}{\mathrm{Array}}\\ {\mathrm{Data Type:}}{\mathrm{anything}}\\ {\mathrm{Storage:}}{\mathrm{rectangular}}\\ {\mathrm{Order:}}{\mathrm{Fortran_order}}\end{array}\right]$ (7)
 > $W≔\mathrm{Array}\left(\left[10,20,30,40,50,60,70,80,90,100,110\right]\right)$
 ${W}{≔}\left[\begin{array}{c}{\mathrm{1 .. 11}}{\mathrm{Array}}\\ {\mathrm{Data Type:}}{\mathrm{anything}}\\ {\mathrm{Storage:}}{\mathrm{rectangular}}\\ {\mathrm{Order:}}{\mathrm{Fortran_order}}\end{array}\right]$ (8)
 > $\mathrm{FrequencyTable}\left(C,\mathrm{weights}=W,\mathrm{headers},\mathrm{summarize}=\mathrm{embed}\right):$

 $\mathrm{Range}$ $\mathrm{Absolute Frequency}$ $\mathrm{Percentage}$ $\mathrm{Cumulative Frequency}$ $\mathrm{Cumulative Percentage}$ $20.0..21.0$ $10.0$ $1.5151515151515151$ $10.0$ $1.5151515151515151$ $21.0..22.0$ $20.0$ $3.0303030303030303$ $30.0$ $4.545454545454546$ $22.0..23.0$ $30.0$ $4.545454545454546$ $60.0$ $9.090909090909092$ $23.0..24.0$ $40.0$ $6.0606060606060606$ $100.0$ $15.151515151515152$ $24.0..25.0$ $50.0$ $7.575757575757576$ $150.0$ $22.727272727272727$ $25.0..26.0$ $60.0$ $9.090909090909092$ $210.0$ $31.818181818181817$ $26.0..27.0$ $70.0$ $10.606060606060606$ $280.0$ $42.42424242424242$ $27.0..28.0$ $80.0$ $12.121212121212121$ $360.0$ $54.54545454545455$ $28.0..29.0$ $90.0$ $13.636363636363637$ $450.0$ $68.18181818181819$ $29.0..30.0$ $210.0$ $31.818181818181817$ $660.0$ $100.0$

 > 

References

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

Compatibility

 • The headers option was introduced in Maple 2015.