stats(deprecated)/data - Help

Data Representation for the stats Package

Description

 • Important: The stats package has been deprecated. Use the superseding package Statistics instead.
 • The fundamental data structure for the stats package is the statistical list. This is a list containing the following types of items.

 item a number, or symbolic expression representing a single data value. missing a keyword representing missing data. item..item data grouped in a class. For example, 3..4, designates a single data item whose value is greater than or equal to 3 and less than 4. Weight(value, weight) Weighted data. The parameter value consists of any of the preceding item types, and the parameter weight is the weight associated with this data item. For example, Weight(3..4, 10), can be used to represent 10 entries within the class 3..4.

 • Some functions, for example, stats[describe, mode], return unevaluated if their argument is a statistical list that contains non-numeric data.

Examples

Important: The stats package has been deprecated. Use the superseding package Statistics instead. Single entries, with missing observations.

 > $\left[1,3,6,\mathrm{missing},3,90\right]:$

This is equivalent to (if ordering is irrelevant)

 > $\left[\mathrm{Weight}\left(3,2\right),1,6,90,\mathrm{missing}\right]:$

Regrouped in classes (note that some information is necessarily lost)

 > $\left[\mathrm{Weight}\left(0..4,3\right),5..9,90..94,\mathrm{missing}\right]:$

Symbolic values can also be used

 > $\left[\mathrm{sin}\left(x\right),\mathrm{missing},{x}^{3}\right]:$

If data is numeric, then the mode can be computed.

 > $\mathrm{stats}[\mathrm{describe},\mathrm{mode}]\left(\left[1,1,\mathrm{missing},3,\mathrm{Weight}\left(2,4\right)\right]\right)$
 ${2}$ (1)

However, if data contains a non numerical entry

 > $n≔'n'$
 ${n}{:=}{n}$ (2)
 > $\mathrm{stats}[\mathrm{describe},\mathrm{mode}]\left(\left[n,1,\mathrm{missing},3,\mathrm{Weight}\left(2,4\right)\right]\right)$
 ${{\mathrm{stats}}}_{{\mathrm{describe}}{,}{\mathrm{mode}}}{}\left(\left[{n}{,}{1}{,}{\mathrm{missing}}{,}{3}{,}{\mathrm{Weight}}{}\left({2}{,}{4}\right)\right]\right)$ (3)

 > $\mathrm{stats/lasterror}$
 $\left[{{\mathrm{stats}}}_{{\mathrm{describe}}{,}{\mathrm{mode}}}{,}{\mathrm{requires data of type stats/numericdata, received}}{,}\left[{n}{,}{1}{,}{\mathrm{missing}}{,}{3}{,}{\mathrm{Weight}}{}\left({2}{,}{4}\right)\right]\right]$ (4)