compute the frequency table for a data sample - Maple Help

Online Help

All Products    Maple    MapleSim


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

Statistics[FrequencyTable] - compute the frequency table for a data sample

Calling Sequence

FrequencyTable(A, options)

Parameters

A

-

data sample

options

-

(optional) equation(s) of the form option=value where option is one of ignore, weights, bins, or headers; specify options for the FrequencyTable function

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.

• 

For more information about computation in the Statistics package, see the Statistics[Computation] help page.

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 -- 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.

Examples

withStatistics:

A:=Arrayseqnextprimei,i=100..700

A:= 1 .. 601 ArrayData Type: anythingStorage: rectangularOrder: Fortran_order

(1)

FrequencyTableA

101...161.57.9.48419301257.9.484193012161...221.54.8.985024958111.18.46921797221...281.66.10.98169717177.29.45091514281...341.60.9.983361065237.39.43427621341...401.60.9.983361065297.49.41763727401...461.60.9.983361065357.59.40099834461...521.52.8.652246256409.68.05324459521...581.68.11.31447587477.79.36772047581...641.54.8.985024958531.88.35274542641...701.70.11.64725458601.100.

(2)

Try fewer bins.

FrequencyTableA,bins=3,headers

RangeAbsolute FrequencyPercentageCumulative FrequencyCumulative Percentage101...301.193.32.11314476193.32.11314476301...501.206.34.27620632399.66.38935108501...701.202.33.61064892601.100.

(3)

Consider a data set with missing values.

B:=Arrayseqi,i=100..300,sequndefined,i=1..100

B:= 1 .. 301 ArrayData Type: anythingStorage: rectangularOrder: Fortran_order

(4)

FrequencyTableB,bins=3

100...HFloatundefined0.0.0.0.HFloatundefined..HFloatundefined0.0.0.0.HFloatundefined..HFloatundefined0.0.0.0.

(5)

FrequencyTableB,ignore=true

100...120.20.9.95024875620.9.950248756120...140.20.9.95024875640.19.90049751140...160.20.9.95024875660.29.85074627160...180.20.9.95024875680.39.80099502180...200.20.9.950248756100.49.75124378200...220.20.9.950248756120.59.70149254220...240.20.9.950248756140.69.65174129240...260.20.9.950248756160.79.60199005260...280.20.9.950248756180.89.55223881280...300.21.10.44776119201.100.

(6)

Try weighted data.

C:=Arrayseqi,i=20..30

C:= 1 .. 11 ArrayData Type: anythingStorage: rectangularOrder: Fortran_order

(7)

W:=Array10,20,30,40,50,60,70,80,90,100,110

W:= 1 .. 11 ArrayData Type: anythingStorage: rectangularOrder: Fortran_order

(8)

FrequencyTableC,weights=W

20...21.10.1.5151515151515210.1.5151515151515221...22.20.3.0303030303030330.4.5454545454545522...23.30.4.5454545454545560.9.0909090909090923...24.40.6.06060606060606100.15.151515151515224...25.50.7.57575757575758150.22.727272727272725...26.60.9.09090909090909210.31.818181818181826...27.70.10.6060606060606280.42.424242424242427...28.80.12.1212121212121360.54.545454545454528...29.90.13.6363636363636450.68.181818181818229...30.210.31.8181818181818660.100.

(9)

See Also

Statistics, Statistics[Computation], Statistics[DescriptiveStatistics], Statistics[Tally], Statistics[TallyInto]

References

  

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


Download Help Document

Was this information helpful?



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