stats[transform, subtractfrom]
subtracts from statistical data a number or the result of a descriptive statistics function
/ 1993-03-16: Created. jmlang.
Calling Sequence
Parameters
Description
Examples
stats[transform, subtractfrom[quantity]](data)
transform[subtractfrom[quantity]](data)
quantity
-
numerical value, or descriptive statistic function
data
statistical list
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.
with⁡stats:
data≔5,6,7,8
Subtract 4 from each datum.
transformsubtractfrom4⁡data
1,2,3,4
Subtract the mean from each datum.
transformsubtractfrommean⁡data
−32,−12,12,32
describemean⁡data
132
See Also
Statistics
transform(deprecated)[apply]
transform(deprecated)[divideby]
transform(deprecated)[multiapply]
transform(deprecated)[standardscore]
Download Help Document