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

$\mathrm{with}\left(\mathrm{stats}\right)\:$

>

$\mathrm{data}\u2254\left[4\,\mathrm{Weight}\left(3\,10\right)\,\mathrm{missing}\,\mathrm{Weight}\left(1..2\,25\right)\right]$

${\mathrm{data}}{\u2254}\left[{4}{\,}{\mathrm{Weight}}{}\left({3}{\,}{10}\right){\,}{\mathrm{missing}}{\,}{\mathrm{Weight}}{}\left({1}{..}{2}{\,}{25}\right)\right]$
 (1) 
>

$\mathrm{transform}\left[\mathrm{deletemissing}\right]\left(\mathrm{data}\right)$

$\left[{4}{\,}{\mathrm{Weight}}{}\left({3}{\,}{10}\right){\,}{\mathrm{Weight}}{}\left({1}{..}{2}{\,}{25}\right)\right]$
 (2) 
>

$\mathrm{transform}\left[\mathrm{statsort}\right]\left(\mathrm{data}\right)$

$\left[{\mathrm{Weight}}{}\left({1}{..}{2}{\,}{25}\right){\,}{\mathrm{Weight}}{}\left({3}{\,}{10}\right){\,}{4}{\,}{\mathrm{missing}}\right]$
 (3) 
>

$\mathrm{data2}\u2254\left[1\,1\,1\,2\,3\,3\,4\,4\,4\,4\,5\,6\,6\,6\,7\,8\,9\,10\right]$

${\mathrm{data2}}{\u2254}\left[{1}{\,}{1}{\,}{1}{\,}{2}{\,}{3}{\,}{3}{\,}{4}{\,}{4}{\,}{4}{\,}{4}{\,}{5}{\,}{6}{\,}{6}{\,}{6}{\,}{7}{\,}{8}{\,}{9}{\,}{10}\right]$
 (4) 
>

$\mathrm{transform}\left[\mathrm{tally}\right]\left(\mathrm{data2}\right)$

$\left[{\mathrm{Weight}}{}\left({1}{\,}{3}\right){\,}{2}{\,}{\mathrm{Weight}}{}\left({3}{\,}{2}\right){\,}{\mathrm{Weight}}{}\left({4}{\,}{4}\right){\,}{5}{\,}{\mathrm{Weight}}{}\left({6}{\,}{3}\right){\,}{7}{\,}{8}{\,}{9}{\,}{10}\right]$
 (5) 
Remembering that the left boundary of a class is inclusive, and the right boundary is exclusive (so the 10 above belongs to 10..15 and not 5..10, we have:
>

$\mathrm{transform}\left[\mathrm{tallyinto}\right]\left(\mathrm{data2}\,\left[0..5\,5..10\,10..15\right]\right)$

$\left[{\mathrm{Weight}}{}\left({0}{..}{5}{\,}{10}\right){\,}{\mathrm{Weight}}{}\left({5}{..}{10}{\,}{7}\right){\,}{10}{..}{15}\right]$
 (6) 