transform(deprecated)/subtractfrom - Maple Help

stats[transform, subtractfrom]

subtracts from statistical data a number or the result of a descriptive statistics function

 /  1993-03-16: Created. jmlang.

 Calling Sequence stats[transform, subtractfrom[quantity]](data) transform[subtractfrom[quantity]](data)

Parameters

 quantity - numerical value, or descriptive statistic function data - statistical list

Description

 • Important: The stats package has been deprecated. Use the superseding package Statistics instead.
 • The function subtractfrom of the subpackage stats[transform, ...] subtracts from  data the given quantity.
 • Missing items remain unchanged.
 • The requested subtraction is applied at each of the boundary points of classes.
 • If quantity is not numeric, a call to stats[describe, quantity](data) is made to compute it.
 • This function is useful for comparing the (absolute) dispersion of two lists of data. For example, removing the mean is a good first step in comparing the variation of mid-day temperatures at the North Pole and at some point on the Equator.
 • The function transform[apply] is more general than the function transform[subtractfrom]. The function transform[divideby] is related to transform[subtractfrom], and is often used in conjunction with it. One may also want to use transform[standardscore] which removes the mean from the given data, then performs a division by the standard deviation.

Examples

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

 > $\mathrm{with}\left(\mathrm{stats}\right):$
 > $\mathrm{data}≔\left[5,6,7,8\right]$
 ${\mathrm{data}}{≔}\left[{5}{,}{6}{,}{7}{,}{8}\right]$ (1)

Subtract 4 from each datum.

 > $\mathrm{transform}\left[\mathrm{subtractfrom}\left[4\right]\right]\left(\mathrm{data}\right)$
 $\left[{1}{,}{2}{,}{3}{,}{4}\right]$ (2)

Subtract the mean from each datum.

 > $\mathrm{transform}\left[\mathrm{subtractfrom}\left[\mathrm{mean}\right]\right]\left(\mathrm{data}\right)$
 $\left[{-}\frac{{3}}{{2}}{,}{-}\frac{{1}}{{2}}{,}\frac{{1}}{{2}}{,}\frac{{3}}{{2}}\right]$ (3)
 > $\mathrm{describe}\left[\mathrm{mean}\right]\left(\mathrm{data}\right)$
 $\frac{{13}}{{2}}$ (4)