 transform(deprecated)/classmark - Maple Help

stats[transform, classmark]

replace Classes by their Class Mark Calling Sequence stats[transform, classmark](data) transform[classmark](data) Parameters

 data - statistical list Description

 • Important: The stats package has been deprecated. Use the superseding package Statistics instead.
 • The function classmark of the subpackage stats[transform, ...] replaces classes by their class mark in the given data.
 • The class mark of a class is its midpoint. A class is represented by the range data structure. When the distinction is important (such as for the transform[tallyinto] function), the lower bound is inclusive and the upper bound is exclusive. Therefore, $a..b$ represents data  points $x$ such that $a<=x.
 • Data not given as a class (or range) are left unchanged. Examples

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

 > $\mathrm{with}\left(\mathrm{stats}\right):$
 > $\mathrm{data1}≔\left[1..3,4..5\right]$
 ${\mathrm{data1}}{≔}\left[{1}{..}{3}{,}{4}{..}{5}\right]$ (1)
 > ${\mathrm{transform}}_{\mathrm{classmark}}\left(\mathrm{data1}\right)=\left[\frac{1+3}{2},\frac{4+5}{2}\right]$
 $\left[{2}{,}\frac{{9}}{{2}}\right]{=}\left[{2}{,}\frac{{9}}{{2}}\right]$ (2)

It works for weighted data also.

 > $\mathrm{data2}≔\left[\mathrm{Weight}\left(3..9,10\right)\right]$
 ${\mathrm{data2}}{≔}\left[{\mathrm{Weight}}{}\left({3}{..}{9}{,}{10}\right)\right]$ (3)
 > ${\mathrm{transform}}_{\mathrm{classmark}}\left(\mathrm{data2}\right)=\left[\mathrm{Weight}\left(\frac{3+9}{2},10\right)\right]$
 $\left[{\mathrm{Weight}}{}\left({6}{,}{10}\right)\right]{=}\left[{\mathrm{Weight}}{}\left({6}{,}{10}\right)\right]$ (4)
 > $\mathrm{data3}≔\left[\mathrm{Weight}\left(3,10\right),\mathrm{missing},4,\mathrm{Weight}\left(11..12,3\right),15..17\right]$
 ${\mathrm{data3}}{≔}\left[{\mathrm{Weight}}{}\left({3}{,}{10}\right){,}{\mathrm{missing}}{,}{4}{,}{\mathrm{Weight}}{}\left({11}{..}{12}{,}{3}\right){,}{15}{..}{17}\right]$ (5)
 > ${\mathrm{transform}}_{\mathrm{classmark}}\left(\mathrm{data3}\right)$
 $\left[{\mathrm{Weight}}{}\left({3}{,}{10}\right){,}{\mathrm{missing}}{,}{4}{,}{\mathrm{Weight}}{}\left(\frac{{23}}{{2}}{,}{3}\right){,}{16}\right]$ (6)