 describe(deprecated)/linearcorrelation - Maple Help

stats[describe]

 linearcorrelation
 Coefficient of linear correlation between two data lists Calling Sequence stats[describe, linearcorrelation](data1, data2) describe[linearcorrelation](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 linearcorrelation of the subpackage stats[describe, ...] computes the coefficient of linear correlation between two statistical lists.
 • The linear correlation measures how well a linear function (a straight line) explains the relationship between two data lists. If a straight line is an excellent explanation of the relationship, then the linear correlation coefficient will have a high magnitude. The correlation is positive if an increase in one variable corresponds to an increase in the other, and negative when an increase in one corresponds to a decrease in the other. The range of this function is -1 (high negative correlation) to 0 (no linear correlation) to 1 (high positive linear correlation).
 • The two data lists must have the same number of observations, with the same weights for each corresponding element.
 • The coefficient of linear correlation is computed by dividing the covariance by the square root of the product of the variance of the two data lists.
 • Classes are assumed to be represented by the class mark, for example 10..12 has the value 11.
 • See stats[describe, covariance] and stats[describe, variance] for the treatment of missing data.
 • There are other measures of correlation besides the linear correlation. A low value for the coefficient of linear correlation does not imply that the data is not correlated. For example, if the pairs of data describe a circle, the correlation is high with respect to the circle, but low with respect to a straight line.
 • The command with(stats[describe],linearcorrelation) allows the use of the abbreviated form of this command. Examples

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

 > $\mathrm{with}\left(\mathrm{stats}\right):$

These two sets of data are on an increasing straight line

 > $\mathrm{data1}≔\left[1,2,3\right]$
 ${\mathrm{data1}}{≔}\left[{1}{,}{2}{,}{3}\right]$ (1)
 > $\mathrm{data2}≔\left[3,5,7\right]$
 ${\mathrm{data2}}{≔}\left[{3}{,}{5}{,}{7}\right]$ (2)
 > ${\mathrm{describe}}_{\mathrm{linearcorrelation}}\left(\mathrm{data1},\mathrm{data2}\right):$$\mathrm{evalf}\left(\right)$
 $\left[{3.}{,}{5.}{,}{7.}\right]$ (3)

These are on a decreasing straight line

 > $\mathrm{data3}≔\left[1,2,3\right]$
 ${\mathrm{data3}}{≔}\left[{1}{,}{2}{,}{3}\right]$ (4)
 > $\mathrm{data4}≔\left[7,5,3\right]$
 ${\mathrm{data4}}{≔}\left[{7}{,}{5}{,}{3}\right]$ (5)
 > ${\mathrm{describe}}_{\mathrm{linearcorrelation}}\left(\mathrm{data3},\mathrm{data4}\right):$$\mathrm{evalf}\left(\right)$
 $\left[{7.}{,}{5.}{,}{3.}\right]$ (6)

These have low correlation

 > $\mathrm{data5}≔\left[1,2,3,4,5\right]$
 ${\mathrm{data5}}{≔}\left[{1}{,}{2}{,}{3}{,}{4}{,}{5}\right]$ (7)
 > $\mathrm{data6}≔\left[0,5,-6,1,1\right]$
 ${\mathrm{data6}}{≔}\left[{0}{,}{5}{,}{-6}{,}{1}{,}{1}\right]$ (8)
 > ${\mathrm{describe}}_{\mathrm{linearcorrelation}}\left(\mathrm{data5},\mathrm{data6}\right):$$\mathrm{evalf}\left(\right)$
 $\left[{0.}{,}{5.}{,}{-6.}{,}{1.}{,}{1.}\right]$ (9)