# Statistics - Cross Product (of X and Y) (CP|SP)

The cross product is a calculation used in order to define the correlation coefficient between two variables.

SP is the sum of all cross products between two variables.

## 3 - Computation

### 3.1 - CP

For one observation (one row), multiply the deviation score on the variable X by the deviation score on the variable Y:

$$\text{Cross Product}=(\href{raw_score}{X}_i-\href{mean}{\bar{X}}).(\href{raw_score}{Y}_i-\href{mean}{\bar{Y}})$$

### 3.2 - SP

SP is the sum of cross product between two variables (X and Y) for all observations. $$\begin{array}{rrl} \text{Sum of Cross Product (SP)} & = & \sum_{i=1}^{\href{sample_size}{N}}{\href{cross_product}{\text{Cross Product of X & Y}}} \\ & = & \sum_{i=1}^{\href{sample_size}{N}}{(\href{raw_score}{X}_i-\href{mean}{\bar{X}}).(\href{raw_score}{Y}_i-\href{mean}{\bar{Y}})} \\ \end{array}$$

Data Science
Data Analysis
Statistics
Data Science
Linear Algebra Mathematics
Trigonometry