transform(deprecated)/scaleweight - Help

stats[transform, scaleweight]

scale the frequencies by the given weight

 Calling Sequence stats[transform, scaleweight[factor]](data) transform[scaleweight[factor]](data)

Parameters

 factor - value by which the weight of the data will be multiplied data - statistical list

Description

 • Important: The stats package has been deprecated. Use the superseding package Statistics instead.
 • The function scaleweight of the subpackage stats[transform, ...] multiplies the weights of the data by the given factor.
 • The weights, or frequencies, of items in a statistical data list are obtained using the function transform[frequency]. The total weight can be obtained using describe[count].
 • The total weight of a data list is often scaled to the values 1 and 100. The value 100 is used to get percentages. The value 1 is often used to compare with theoretical probability distributions. It is also used to obtain empirical distributions.
 • Cumulative percentages are obtained by first scaling the weight to 100, then using the function transform[cumulativefrequency].

Examples

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

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

Divide the weight by four.

 > $\mathrm{transform}[\mathrm{scaleweight}[\frac{1}{4}]]\left(\left[1,\mathrm{Weight}\left(2,3\right),\mathrm{Weight}\left(5,4\right)\right]\right)$
 $\left[{\mathrm{Weight}}{}\left({1}{,}\frac{{1}}{{4}}\right){,}{\mathrm{Weight}}{}\left({2}{,}\frac{{3}}{{4}}\right){,}{5}\right]$ (1)
 > $\mathrm{data}≔\left[3,5,6,\mathrm{Weight}\left(7,2\right)\right]$
 ${\mathrm{data}}{:=}\left[{3}{,}{5}{,}{6}{,}{\mathrm{Weight}}{}\left({7}{,}{2}\right)\right]$ (2)

To get percentages.

 > $\mathrm{transform}[\mathrm{scaleweight}[\frac{100}{\mathrm{describe}[\mathrm{count}]\left(\mathrm{data}\right)}]]\left(\mathrm{data}\right)$
 $\left[{\mathrm{Weight}}{}\left({3}{,}{20}\right){,}{\mathrm{Weight}}{}\left({5}{,}{20}\right){,}{\mathrm{Weight}}{}\left({6}{,}{20}\right){,}{\mathrm{Weight}}{}\left({7}{,}{40}\right)\right]$ (3)

To normalize to a total weight of 1.

 > $\mathrm{transform}[\mathrm{scaleweight}[\frac{1}{\mathrm{describe}[\mathrm{count}]\left(\mathrm{data}\right)}]]\left(\mathrm{data}\right)$
 $\left[{\mathrm{Weight}}{}\left({3}{,}\frac{{1}}{{5}}\right){,}{\mathrm{Weight}}{}\left({5}{,}\frac{{1}}{{5}}\right){,}{\mathrm{Weight}}{}\left({6}{,}\frac{{1}}{{5}}\right){,}{\mathrm{Weight}}{}\left({7}{,}\frac{{2}}{{5}}\right)\right]$ (4)