Statistics - Maple Programming Help

Online Help

All Products    Maple    MapleSim


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

Parameters

Options

Description

Computation

Examples

References

Compatibility

Calling Sequence

FrequencyTable(A, options)

Parameters

A

-

data sample

options

-

(optional) equation(s) of the form option=value where option is one of bins, headers, ignore, summarize, tableweights, or weights; 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.

• 

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.

• 

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.

• 

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

Examples

withStatistics:

AArrayseqnextprimei,i=100..700

_rtable18446884586649510006

(1)

FrequencyTableA

101.0..161.057.9.48419301257.9.484193012161.0..221.054.8.985024958111.18.46921797221.0..281.066.10.98169717177.29.45091514281.0..341.060.9.983361065237.39.43427621341.0..401.060.9.983361065297.49.41763727401.0..461.060.9.983361065357.59.40099834461.0..521.052.8.652246256409.68.05324459521.0..581.068.11.31447587477.79.36772047581.0..641.054.8.985024958531.88.35274542641.0..701.070.11.64725458601.100.

(2)

Try fewer bins.

FrequencyTableA,bins=3,headers

RangeAbsolute FrequencyPercentageCumulative FrequencyCumulative Percentage101.0..301.0193.32.11314476193.32.11314476301.0..501.0206.34.27620632399.66.38935108501.0..701.0202.33.61064892601.100.

(3)

Consider a data set with missing values.

BArrayseqi,i=100..300,sequndefined,i=1..100

_rtable18446884586642875206

(4)

FrequencyTableB,bins=3

100.0..HFloatundefined0.0.0.0.HFloatundefined..HFloatundefined0.0.0.0.HFloatundefined..HFloatundefined0.0.0.0.

(5)

FrequencyTableB,ignore=true

100.0..120.020.9.95024875620.9.950248756120.0..140.020.9.95024875640.19.90049751140.0..160.020.9.95024875660.29.85074627160.0..180.020.9.95024875680.39.80099502180.0..200.020.9.950248756100.49.75124378200.0..220.020.9.950248756120.59.70149254220.0..240.020.9.950248756140.69.65174129240.0..260.020.9.950248756160.79.60199005260.0..280.020.9.950248756180.89.55223881280.0..300.021.10.44776119201.100.

(6)

Try weighted data.

CArrayseqi,i=20..30

2021222324252627282930

(7)

WArray10,20,30,40,50,60,70,80,90,100,110

102030405060708090100110

(8)

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

FrequencyTableC,weights=W,headers,summarize=embed:

Range

`Absolute Frequency`

Percentage

`Cumulative Frequency`

`Cumulative Percentage`

20...21.

10.

1.51515151515151514

10.

1.51515151515151514

21...22.

20.

3.03030303030303028

30.

4.54545454545454586

22...23.

30.

4.54545454545454586

60.

9.09090909090909172

23...24.

40.

6.06060606060606055

100.

15.1515151515151523

24...25.

50.

7.57575757575757613

150.

22.7272727272727266

25...26.

60.

9.09090909090909172

210.

31.8181818181818166

26...27.

70.

10.6060606060606055

280.

42.4242424242424221

27...28.

80.

12.1212121212121211

360.

54.5454545454545396

28...29.

90.

13.6363636363636349

450.

68.1818181818181728

29...30.

210.

31.8181818181818166

660.

100.

 

FrequencyTableC,weights=W

20.0..21.010.01.515151515151515110.01.515151515151515121.0..22.020.03.030303030303030330.04.54545454545454622.0..23.030.04.54545454545454660.09.09090909090909223.0..24.040.06.0606060606060606100.015.15151515151515224.0..25.050.07.575757575757576150.022.72727272727272725.0..26.060.09.090909090909092210.031.81818181818181726.0..27.070.010.606060606060606280.042.4242424242424227.0..28.080.012.121212121212121360.054.5454545454545428.0..29.090.013.636363636363635450.068.1818181818181729.0..30.0210.031.818181818181817660.0100.0

(9)

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

interfacedisplayprecision=4:

FrequencyTableC,weights=W,headers,summarize=embed,tableweights=4,2,2,2,2:

Range

`Absolute Frequency`

Percentage

`Cumulative Frequency`

`Cumulative Percentage`

20.0000..21.0000

10.0000

1.5152

10.0000

1.5152

21.0000..22.0000

20.0000

3.0303

30.0000

4.5455

22.0000..23.0000

30.0000

4.5455

60.0000

9.0909

23.0000..24.0000

40.0000

6.0606

100.0000

15.1515

24.0000..25.0000

50.0000

7.5758

150.0000

22.7273

25.0000..26.0000

60.0000

9.0909

210.0000

31.8182

26.0000..27.0000

70.0000

10.6061

280.0000

42.4242

27.0000..28.0000

80.0000

12.1212

360.0000

54.5455

28.0000..29.0000

90.0000

13.6364

450.0000

68.1818

29.0000..30.0000

210.0000

31.8182

660.0000

100.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 headers option was introduced in Maple 2015.

• 

For more information on Maple 2015 changes, see Updates in Maple 2015.

• 

The summarize option was introduced in Maple 2016.

• 

For more information on Maple 2016 changes, see Updates in Maple 2016.

• 

The Statistics[FrequencyTable] 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.

See Also

Statistics

Statistics[Computation]

Statistics[DescriptiveStatistics]

Statistics[Tally]

Statistics[TallyInto]