 transform(deprecated)/standardscore - Maple Help

stats[transform, standardscore]

replace each item by its standard score Calling Sequence stats[transform, standardscore[n_constraints]](data) transform[standardscore[n_constraints]](data) Parameters

 n_constraints - (optional, default=0) use 0 for population, 1 for sample data - statistical list Description

 • Important: The stats package has been deprecated. Use the superseding package Statistics instead.
 • The function standardscore of the subpackage stats[transform, ...] replaces each item in data by its standard score.
 • The standard score of a quantity $x$ is $\frac{x-\mathrm{mean}}{\mathrm{standarddeviation}}$, where mean and $\mathrm{standarddeviation}$ are the mean and the standard deviation  of data, respectively.
 • Standard scores are also known as zscores, or z-scores.
 • The quantity n_constraints  is explained in more detail in the description of stats[describe,standarddeviation].
 • The standard score is very useful in comparing distributions. For example, a student can compare her relative standing between two courses if she knows her mark, the courses averages and standard deviations.
 • Results expressed in terms of standard score are also known as being expressed in standard units.
 • By definition, the set of standard scores of a list of statistical data will have mean equal to 0 and standard deviation equal to 1.
 • Missing items remain unchanged. Weighted data and class data are recognized. Examples

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

 > $\mathrm{with}\left(\mathrm{stats}\right):$
 > $\mathrm{data}≔\left[\mathrm{Weight}\left(3,10\right),\mathrm{missing},4,\mathrm{Weight}\left(11..12,3\right)\right]$
 ${\mathrm{data}}{≔}\left[{\mathrm{Weight}}{}\left({3}{,}{10}\right){,}{\mathrm{missing}}{,}{4}{,}{\mathrm{Weight}}{}\left({11}{..}{12}{,}{3}\right)\right]$ (1)

The standard scores for the given data are

 > $\mathrm{transform}\left[\mathrm{standardscore}\right]\left(\mathrm{data}\right):$$\mathrm{transform}\left[\mathrm{apply}\left[\mathrm{evalf}\right]\right]\left(\right)$
 $\left[{\mathrm{Weight}}{}\left({3.}{,}{10}\right){,}{\mathrm{missing}}{,}{4.}{,}{\mathrm{Weight}}{}\left({11.}{..}{12.}{,}{3}\right)\right]$ (2)

Here is another way of computing the standard scores.

 > $\mathrm{transform}\left[\mathrm{divideby}\left[\mathrm{standarddeviation}\right]\right]\left(\mathrm{transform}\left[\mathrm{subtractfrom}\left[\mathrm{mean}\right]\right]\left(\mathrm{data}\right)\right)$
 $\left[{\mathrm{Weight}}{}\left({-}\frac{{53}{}\sqrt{{9385}}}{{9385}}{,}{10}\right){,}{\mathrm{missing}}{,}{-}\frac{{5}{}\sqrt{{9385}}}{{1877}}{,}{\mathrm{Weight}}{}\left(\frac{{171}{}\sqrt{{9385}}}{{9385}}{..}\frac{{199}{}\sqrt{{9385}}}{{9385}}{,}{3}\right)\right]$ (3)
 > $\mathrm{transform}\left[\mathrm{apply}\left[\mathrm{evalf}\right]\right]\left(\right)$
 $\left[{\mathrm{Weight}}{}\left({-0.5470899427}{,}{10}\right){,}{\mathrm{missing}}{,}{-0.2580612937}{,}{\mathrm{Weight}}{}\left({1.765139249}{..}{2.054167898}{,}{3}\right)\right]$ (4)

And here is a third way.

 > $\mathrm{the_sd}≔\mathrm{describe}\left[\mathrm{standarddeviation}\right]\left(\mathrm{data}\right)$
 ${\mathrm{the_sd}}{≔}\frac{\sqrt{{9385}}}{{28}}$ (5)
 > $\mathrm{the_mean}≔\mathrm{describe}\left[\mathrm{mean}\right]\left(\mathrm{data}\right)$
 ${\mathrm{the_mean}}{≔}\frac{{137}}{{28}}$ (6)
 > $\mathrm{transform}\left[\mathrm{apply}\left[\mathrm{unapply}\left(\frac{x-\mathrm{the_mean}}{\mathrm{the_sd}},x\right)\right]\right]\left(\mathrm{data}\right)$
 $\left[{\mathrm{Weight}}{}\left({-}\frac{{53}{}\sqrt{{9385}}}{{9385}}{,}{10}\right){,}{\mathrm{missing}}{,}{-}\frac{{5}{}\sqrt{{9385}}}{{1877}}{,}{\mathrm{Weight}}{}\left(\frac{{171}{}\sqrt{{9385}}}{{9385}}{..}\frac{{199}{}\sqrt{{9385}}}{{9385}}{,}{3}\right)\right]$ (7)
 > $\mathrm{transform}\left[\mathrm{apply}\left[\mathrm{evalf}\right]\right]\left(\right)$
 $\left[{\mathrm{Weight}}{}\left({-0.5470899427}{,}{10}\right){,}{\mathrm{missing}}{,}{-0.2580612937}{,}{\mathrm{Weight}}{}\left({1.765139249}{..}{2.054167898}{,}{3}\right)\right]$ (8)