Excel RSQ Function
The RSQ function returns the square of the Pearson product-moment correlation coefficient (r2) for two supplied sets of values.
The RSQ function returns a numeric value.
- Arguments can be either of the following:
- Names, arrays, or references that contain numbers.
- Logical values and other values that can be converted to numbers that you type directly into the list of arguments will be counted.
- If text or empty cells are referenced as either of the arguments, the values will be ignored.
- RSQ returns the #N/A error if known_ys and known_xs have different numbers of data points.
- RSQ returns the #DIV/0! error if:
- known_ys and known_xs are empty or have only one data point;
- The standard deviation of the values in one or both of the supplied arrays equals to zero.
- The equation for the Pearson product moment correlation coefficient (r, note that RSQ will return r2) is:
Where x and y are the sample means of the two arrays of values.
Take the table below as an example. To get the square of the Pearson product-moment correlation coefficient for two supplied sets of values listed in the table, please copy or enter the formula below in the result cell, and press Enter to get the result.