describe(deprecated)/covariance - Help

stats[describe]

 covariance
 Covariance Between Two Data Lists

 Calling Sequence stats[describe, covariance](data1, data2) describe[covariance](data1, data2)

Parameters

 data1 - first statistical list data2 - second statistical list

Description

 • Important: The stats package has been deprecated. Use the superseding package Statistics instead.
 • The function covariance of the subpackage stats[describe, ...] computes the covariance between two statistical lists.
 • The two data lists must have the same number of observations, with the same weights for each corresponding elements.
 • Let x[i] be the observations of data1, y[i] be the observations of data2, xmean be the mean of data1, ymean be the mean of data2 and N be the common number of observations. Then the covariance is defined to be $\frac{\sum _{i=1}^{N}\phantom{\rule[-0.0ex]{5.0px}{0.0ex}}\left({x}_{i}-\mathrm{xmean}\right)\left({y}_{i}-\mathrm{ymean}\right)}{N}$.
 • If either of x[i] and y[i] is missing, then the corresponding term in the above sum is omitted.
 • The covariance is used in the computation of the linear correlation. Refer to describe[linearcorrelation] for more information.
 • Classes are assumed to be represented by the class mark, for example 10..12 has the value 11.

Examples

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

 > $\mathrm{with}\left(\mathrm{stats}\right):$
 > $\mathrm{data1}≔\left[\mathrm{Weight}\left(3,10\right),4,\mathrm{Weight}\left(11,3\right)\right]$
 ${\mathrm{data1}}{≔}\left[{\mathrm{Weight}}{}\left({3}{,}{10}\right){,}{4}{,}{\mathrm{Weight}}{}\left({11}{,}{3}\right)\right]$ (1)
 > $\mathrm{data2}≔\left[\mathrm{Weight}\left(1,10\right),3,\mathrm{Weight}\left(12,3\right)\right]$
 ${\mathrm{data2}}{≔}\left[{\mathrm{Weight}}{}\left({1}{,}{10}\right){,}{3}{,}{\mathrm{Weight}}{}\left({12}{,}{3}\right)\right]$ (2)
 > $\mathrm{describe}[\mathrm{covariance}]\left(\mathrm{data1},\mathrm{data2}\right)$
 $\frac{{407}}{{28}}$ (3)