# Sxx Variance Formula (With Examples)

-

The Sxx refers to the sum of squares due to the variable x in both linear regression and ANOVA. It basically measures the amount of variation introduced in the data because of the x variable.

### Formula for Sxx Variance:

The sum of squares due to x, that is the Sxx variance can be calculated using the formula, S_{xx}= \frac{\sum (x_i - \bar{x})^2}{n}

1. Here x_i denotes the given data values of the variable x.
2. \bar{x} denotes the mean/average of the x data values.
3. n denotes the number of given data values of the variable x.

Alternatively, the sum of squares Sxx can also be calculated using the formula, S_{xx}= \frac{\sum (x_i )^2}{n} - (\bar{x})^2

The alternative formula is obtained from the original formula by simply expanding the square and carrying out the algebraic simplifications. The original formula and the alternative formula both give the same answer. The advantage of the alternative formula is that the calculations are much easier to carry out by hand.

### Example 1:

We now illustrate how to calculate Sxx for given data values using the original formula. Consider the following 5 data values: 3, 7, 12, 8, 5

We first calculate the mean of the given values, \bar{x} = \frac{\sum{x_i}}{n} = \frac{3+7+12+8+5}{5} = \frac{25}{5} =5

We then obtain the square of the differences as follows,

We now compute the Sxx value as follows, S_{xx}= \frac{\sum (x_i - \bar{x})^2}{n} = \frac{66}{5} = 13.2

### Example 2:

Next, we will see an example of how to calculate Sxx for given data values using the alternative formula. Consider the following 8 data values: 4, 6, 2, 7, 1, 10, 3, 7

We first calculate the mean of the given values, \bar{x} = \frac{\sum{x_i}}{n} = \frac{4+6+2+7+1+10+3+7}{8} = \frac{40}{8} =5

We then obtain the squares of the data values as follows,

Using the alternative formula we obtain that, S_{xx}= \frac{\sum (x_i )^2}{n} - (\bar{x})^2 = \frac{264}{5} - 5^2 = 52.8 - 25 = 27.8

Hey 👋

I'm currently pursuing a Ph.D. in Maths. Prior to this, I completed my master's in Maths & bachelors in Statistics.

I created this website for explaining maths and statistics concepts in the simplest possible manner.

If you've found value from reading my content, feel free to support me in even the smallest way you can.