transform(deprecated)/tallyinto - Maple Help

Home : Support : Online Help : transform(deprecated)/tallyinto

stats[transform, tallyinto]

group together data into a given pattern

 Calling Sequence stats[transform, tallyinto](data,partition) transform[tallyinto](data,partition) stats[transform, tallyinto['extra']](data, partition)

Parameters

 data - statistical list partition - list showing how the data is to be split extra - name

Description

 • Important: The stats package has been deprecated. Use the superseding package Statistics instead.
 • The function tallyinto of the subpackage stats[transform, ...] groups the items of data into the pattern given by partition.
 • The values (see transform[statvalue]) in the result are the values that were in partition.
 • If there are data items that do not fit into the given pattern and the parameter extra gives a name, then they are put into the name specified by extra. If the parameter extra is not specified, an error condition is raised which gives the non-conforming items.
 • Remember that for the stats package, the upper boundary of a class (or range) excludes the boundary. So the class $3..4$ represents points $x$ satisfying $3<=x<4$. Refer to stats[data] for more information.
 • To regroup data, use stats[transform, tally] and stats[transform, statsort].

Examples

Important: The stats package has been deprecated. Use the superseding package Statistics instead.

 > $\mathrm{with}\left(\mathrm{stats}\right):$
 > $\mathrm{data1}≔\left[7,11,2,19,13,5,7,10,15,16\right]$
 ${\mathrm{data1}}{≔}\left[{7}{,}{11}{,}{2}{,}{19}{,}{13}{,}{5}{,}{7}{,}{10}{,}{15}{,}{16}\right]$ (1)
 > $\mathrm{transform}\left[\mathrm{tallyinto}\right]\left(\mathrm{data1},\left[1..5,5..10,10..15,15..20\right]\right)$
 $\left[{1}{..}{5}{,}{\mathrm{Weight}}{}\left({5}{..}{10}{,}{3}\right){,}{\mathrm{Weight}}{}\left({10}{..}{15}{,}{3}\right){,}{\mathrm{Weight}}{}\left({15}{..}{20}{,}{3}\right)\right]$ (2)
 > $\mathrm{data2}≔\left[1,2,3,\mathrm{missing},3,4..5,4..5,\mathrm{Weight}\left(4..5,6\right),6..7,6..7\right]$
 ${\mathrm{data2}}{≔}\left[{1}{,}{2}{,}{3}{,}{\mathrm{missing}}{,}{3}{,}{4}{..}{5}{,}{4}{..}{5}{,}{\mathrm{Weight}}{}\left({4}{..}{5}{,}{6}\right){,}{6}{..}{7}{,}{6}{..}{7}\right]$ (3)
 > $\mathrm{transform}\left[\mathrm{tallyinto}\right]\left(\mathrm{data2},\left[1..3,3..4,4..8\right]\right)$
 $\left[{\mathrm{Weight}}{}\left({1}{..}{3}{,}{2}\right){,}{\mathrm{Weight}}{}\left({3}{..}{4}{,}{2}\right){,}{\mathrm{Weight}}{}\left({4}{..}{8}{,}{10}\right){,}{\mathrm{missing}}\right]$ (4)

Note, ranges are inclusive at the lower point, but excluding at the higher point, see  what happens when 3..4 is omitted.

If infolevel is set to a greater integer (possible settings are 1 through 5), more detailed information about the computation method is displayed.

 > $\mathrm{infolevel}\left[\mathrm{stats}\right]≔1$
 ${{\mathrm{infolevel}}}_{{\mathrm{stats}}}{≔}{1}$ (5)
 > $\mathrm{transform}\left[\mathrm{tallyinto}\right]\left(\mathrm{data2},\left[1..3,4..8\right]\right)$
 > $\mathrm{exceptions}≔'\mathrm{exceptions}':$
 > $\mathrm{transform}\left[\mathrm{tallyinto}\left['\mathrm{exceptions}'\right]\right]\left(\mathrm{data2},\left[1..3,4..8\right]\right)$
 $\left[{\mathrm{Weight}}{}\left({1}{..}{3}{,}{2}\right){,}{\mathrm{Weight}}{}\left({4}{..}{8}{,}{10}\right){,}{\mathrm{missing}}\right]$ (6)
 > $\mathrm{exceptions}$
 $\left[{3}{,}{3}\right]$ (7)