Special SAS Data Sets


Definitional Formulas

This section contrasts corrected and uncorrected SSCP, COV, and CORR matrices by showing how these matrices can be computed. In the following formulas, assume that the data consist of two variables, X and Y, with n observations.

\begin{eqnarray*} \mbox{~ ~ SSCP} & =& \left[\begin{array}{ccc} n & \sum X & \sum Y \\ \sum X & \sum X^2 & \sum XY \\ \sum Y & \sum XY & \sum Y^2 \\ \end{array}\right] \\[.2in] \mbox{CSSCP} & =& \left[\begin{array}{cc} \sum (X-\bar{X})^2 & \sum (X-\bar{X})(Y-\bar{Y})\\ \sum (X-\bar{X})(Y-\bar{Y}) & \sum (Y-\bar{Y})^2 \\ \end{array}\right] \\[.2in] \mbox{~ ~ ~ COV} & =& \frac{\mbox{CSSCP}}{n-1}= \frac{\displaystyle 1}{\displaystyle n-1}\left[\begin{array}{cc} \sum (X-\bar{X})^2 & \sum (X-\bar{X})(Y-\bar{Y})\\ \sum (X-\bar{X})(Y-\bar{Y}) & \sum (Y-\bar{Y})^2 \\ \end{array}\right] \\[.2in] \mbox{~ UCOV} & =& \frac{\displaystyle 1}{\displaystyle n}\left[\begin{array}{cc} \sum X^2 & \sum XY\\ \sum XY & \sum Y^2 \\ \end{array}\right] \\[.2in] \mbox{~ CORR} & =& \left[\begin{array}{cc} 1 & \frac{\displaystyle \sum (X-\bar{X})(Y-\bar{Y})}{\displaystyle \sqrt {\sum (X-\bar{X})^2\sum (Y-\bar{Y})^2}} \\ \frac{\displaystyle \sum (X-\bar{X})(Y-\bar{Y})}{\sqrt {\displaystyle \sum (X-\bar{X})^2\sum (Y-\bar{Y})^2}} & 1 \\ \end{array}\right] \\[.2in] \mbox{UCORR} & =& \left[\begin{array}{cc} 1 & \frac{\displaystyle \sum XY}{\displaystyle \sqrt {\sum X^2\sum Y^2}} \\ \frac{\displaystyle \sum XY}{\displaystyle \sqrt {\sum X^2\sum Y^2}} & 1 \\ \end{array}\right] \\ \end{eqnarray*}