Computes the linear correlation coefficient between input sequences X and Y.


icon

Inputs/Outputs

  • c1ddbl.png X

    X is the first input sequence.

  • c1ddbl.png Y

    Y is the second input sequence.

  • idbl.png correlation coefficient r

    correlation coefficient r returns the correlation coefficient between X and Y.

  • idbl.png r^2

    r^2 returns the square of correlation coefficient r.

  • The linear correlation coefficient also is known as the product-moment coefficient of correlation or Pearson's correlation. The following equation describes the linear correlation coefficient:

    where zx and zy are the standardized z-values of X and Y. The standardized z-values indicate how many standard deviations X and Y are above or below the mean.

    correlation coefficient r always is in the interval [–1, 1]. If correlation coefficient r is 1, X and Y have a complete positive correlation. In other words, the data points from X and Y lie on a perfectly straight, positively-sloped line. If correlation coefficient r is –1, X and Y have a complete negative correlation. In other words, the data points from X and Y lie on a perfectly straight, negatively-sloped line. If correlation coefficient r is 0, X and Y have no correlation.