Documentation/Calc Functions/RSQ

From The Document Foundation Wiki
Jump to navigation Jump to search

Function name:



Statistical Analysis


Calculate the square of the sample Pearson correlation coefficient(r2) based on the given value of data samples.


RSQ(DataY; DataX)


Returns a real value which is the square of the sample Pearson correlation coefficient of values in Datay and DataX. It returns a value in the range [0,1].


DataY is a reference to a range of cells which is considered the first data set.

DataX is a reference to a range of cells which is considered the second data set.

  • If a cell contains text, logical values, or empty cells, then the function ignores these values. However, for logical values, TRUE is considered as 1 and FALSE as 0.
  • If DataY and DataX are empty or contain only one data point or have a different number of data points then the function returns an error value.

Additional details:

  • RSQ (also called determination coefficient) is a measure for the accuracy of an adjustment and can be used to produce a regression analysis.
  • The formula for is the square of sample PEARSON coefficient = r2 where r is:

where x̄ and ӯ are mean values.

  • For more details on the sample Pearson correlation coefficient, visit Wikipedia.


Data1 Data2
1 195 200
2 151 180
3 148 178
4 189 165
5 183 192
6 154 144
Formula Description Returns
=RSQ(A1:A6;B1:B6) The function calculates the square of the Pearson correlation coefficient of the two data sets, Data1 and Data2. Alternatively, it gives the determination coefficient for both data sets. 0.218150635028104

Related LibreOffice functions:


ODF standard:

Section 6.18.66, part 2

Equivalent Excel functions: