Coefficient of linear correlation between two data lists
stats[describe, linearcorrelation](data1, data2)
first statistical list
second statistical list
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.
These two sets of data are on an increasing straight line
These are on a decreasing straight line
These have low correlation
Download Help Document
What kind of issue would you like to report? (Optional)