You are currently offline, waiting for your internet to reconnect

`RSQ`

The most common usage of RSQ includes two ranges of cells that contain the data, such as RSQ(A1:A100, B1:B100).

- Create a blank Excel worksheet, and then copy the following table.
1 = 3 + 10^$D$2 Power of 10 to add to data 2 =4 + 10^$D$2 0 3 =2 + 10^$D$2 4 =5 + 10^$D$2 5 =4+10^$D$2 6 =7+10^$D$2 pre-Excel 2003 =RSQ(A1:A6,B1:B6) when D2 = 7.5 =PEARSON(A1:A6,B1:B6)^2 RSQ = PEARSON^2 0.492857142857143 =CORREL(A1:A6,B1:B6)^2 CORREL^2 0.509470304975923 when D2 = 8 RSQ = PEARSON^2 #DIV/0! CORREL^2 0.509470304975923 - Select cell A1 in your blank Excel worksheet, and then paste the entries so that the table fills cells A1:D13 in your worksheet.
- After you paste the table into your new Excel worksheet, click the
**Paste Options**button, and then click**Match Destination Formatting**. With the pasted range still selected, use one of the following procedures, as appropriate for the version of Excel that you are running:- In Microsoft Office Excel 2007, click the
**Home**tab, click**Format**in the**Cells**group, and then click**AutoFit Column Width**. - In Excel 2003, point to
**Column**on the**Format**menu, and then click**AutoFit Selection**.

- In Microsoft Office Excel 2007, click the

Cells A1:A6 and B1:B6 contain the two data arrays that are used in this example to call RSQ, PEARSON, and CORREL in cells A8:A10. RSQ is calculated by essentially calculating PEARSON and squaring the result. Because PEARSON and CORREL both compute the Pearson Product-Moment Correlation Coefficient, their results should agree. RSQ could have been (but was not) implemented as essentially calculating CORREL and squaring the result.

In versions of Excel that are earlier than Excel 2003, PEARSON may exhibit round-off errors. This behavior leads to round-off errors in RSQ. The behavior of PEARSON, and therefore of RSQ, has been improved for Excel 2003 and for later versions of Excel. CORREL has always been implemented by using the improved procedure that is found in Excel 2003 and in later versions of Excel. Therefore, an alternative to RSQ for an earlier version of Excel is to use CORREL instead and then to square the result.

In versions of Excel that are earlier than Excel 2003, you can use the worksheet in this article to run an experiment and to discover when round-off errors occur. If you add a constant to each of the observations in B1:B6, the values of RSQ, PEARSON^2, and CORREL^2 in cells A7:A9 should not be affected. If you increase the value in D2, a larger constant is added to B1:B6. If D2 <= 7, there are no round-off errors that appear in A7:A9. Now change the value of 7.25, 7.5, 7.75, and then 8. CORREL^2 in A9 is unaffected, but RSQ and PEARSON^2 ( (these expressions always agree with each other) show round-off errors in A7:A8. D6:D13 show values of RSQ = PEARSON^2 and CORREL^2 when D2 = 7.5 and 8, respectively.

Note that CORREL is still well-behaved, but round-off errors in PEARSON have become so severe that division by 0 occurs in RSQ and PEARSON^2 when D2 = 8.

Earlier versions of Excel exhibit incorrect answers in these cases because the effects of round-off errors are more profound with the computational formula that is used by these versions of Excel. Still, the cases that are used in this experiment may be viewed as extreme.

If you have Excel 2003 or a later version of Excel, you see no changes in values of RSQ and PEARSON^2 if you try the experiment. However, cells D6:D13 show round-off errors that you would have obtained with earlier versions of Excel.

In most practical examples, you are not likely to see a difference between the results in later versions of Excel and the results in earlier versions of Excel. This behavior occurs because typical data is unlikely to exhibit the kind of unusual behavior that this experiment illustrates. Numeric instability is most likely to appear in earlier versions of Excel when data contains a high number of significant digits combined with relatively little variation between data values.

The procedure of finding the sum of squared deviations about a sample mean by finding the sample mean, by computing each squared deviation, and by summing the squared deviations is more accurate than the alternative procedure. This alternative procedure was frequently named the "calculator formula" because it was suitable for use of a calculator on a small number of data points. The alternative procedure used the following procedure:

- Found the sum of squares of all observations, the sample size, and the sum of all observations
- Computed the sum of squares of all observations minus ([sum of all observations]^2)/sample size).

The following list is a list of such functions:

- VAR
- VARP
- STDEV
- STDEVP
- DVAR
- DVARP
- DSTDEV
- DSTDEVP
- FORECAST
- SLOPE
- INTERCEPT
- PEARSON
- RSQ
- STEYX

Properties

Article ID: 828131 - Last Review: 01/17/2007 19:58:23 - Revision: 2.2

Microsoft Office Excel 2007, Microsoft Office Excel 2003

- kbformula kbhowto kbexpertisebeginner kbinfo KB828131