Sxx, Syy & Sxy Calculator (Sum of Squares & Linear Regression): Enter your $X$ data values (and optional $Y$ values) below to instantly compute the mean $\bar{x}$, Sum of Squares $S_{xx} = \sum(x_i – \bar{x})^2$, sample variance $s_x^2$, standard deviation $s_x$, covariance sum $S_{xy}$, Pearson correlation $r$, and linear regression equation with step-by-step work.
Interactive Sxx, Syy & Sxy Statistics Calculator
What is Sxx, Syy, and Sxy in Statistics? (Formulas)
In statistics and linear regression, $S_{xx}$, $S_{yy}$, and $S_{xy}$ represent the sum of squares of deviations from the mean and the sum of cross-products:
| Statistic | Definitional Formula | Shortcut Computational Formula | How It Is Used |
|---|---|---|---|
| $S_{xx}$ (Sum of Squares of $X$) | $S_{xx} = \sum_{i=1}^{n} (x_i – \bar{x})^2$ | $S_{xx} = \sum x_i^2 – \frac{(\sum x_i)^2}{n}$ | Measures total variation in $X$; Sample Variance is $s_x^2 = \frac{S_{xx}}{n-1}$ |
| $S_{yy}$ (Sum of Squares of $Y$) | $S_{yy} = \sum_{i=1}^{n} (y_i – \bar{y})^2$ | $S_{yy} = \sum y_i^2 – \frac{(\sum y_i)^2}{n}$ | Measures total variation in $Y$; Sample Variance is $s_y^2 = \frac{S_{yy}}{n-1}$ |
| $S_{xy}$ (Sum of Cross-Products) | $S_{xy} = \sum_{i=1}^{n} (x_i – \bar{x})(y_i – \bar{y})$ | $S_{xy} = \sum x_i y_i – \frac{(\sum x_i)(\sum y_i)}{n}$ | Regression slope $b_1 = \frac{S_{xy}}{S_{xx}}$; Correlation $r = \frac{S_{xy}}{\sqrt{S_{xx}S_{yy}}}$ |
Step-by-Step Solved Example of Sxx
Example: Find $S_{xx}$ and the sample variance $s^2$ for the dataset $X = \{2, 4, 6, 8, 10\}$.
- Find the sample size ($n$) and mean ($\bar{x}$): $n = 5$, and $\bar{x} = \frac{2 + 4 + 6 + 8 + 10}{5} = \frac{30}{5} = 6$.
- Subtract the mean from each value and square the deviation $(x_i – \bar{x})^2$:
- $(2 – 6)^2 = (-4)^2 = 16$
- $(4 – 6)^2 = (-2)^2 = 4$
- $(6 – 6)^2 = 0^2 = 0$
- $(8 – 6)^2 = 2^2 = 4$
- $(10 – 6)^2 = 4^2 = 16$
- Sum the squared deviations to get $S_{xx}$: $S_{xx} = 16 + 4 + 0 + 4 + 16 = \mathbf{40}$.
- Calculate Sample Variance ($s^2$) and Population Variance ($\sigma^2$):
- Sample Variance: $s^2 = \frac{S_{xx}}{n – 1} = \frac{40}{5 – 1} = \mathbf{10}$
- Population Variance: $\sigma^2 = \frac{S_{xx}}{n} = \frac{40}{5} = \mathbf{8}$