Table of Contents
Sxx, also known as the sum of squares, is a statistical measure used to calculate the variability or dispersion of a given set of data points around the mean. It is calculated by finding the squared differences between each data point and the mean, and then summing up these squared differences.
To calculate Sxx, the following steps can be followed:
1. Find the mean of the data set by adding all the data points and dividing by the total number of data points.
2. Calculate the difference between each data point and the mean.
3. Square each of these differences.
4. Sum up all the squared differences.
The resulting value is the Sxx for the given data set.
For example, let’s say we have the following data set: 5, 7, 9, 11, 13.
1. Mean = (5+7+9+11+13)/5 = 9.
2. Differences: (5-9) = -4, (7-9) = -2, (9-9) = 0, (11-9) = 2, (13-9) = 4.
3. Squared differences: (-4)^2 = 16, (-2)^2 = 4, 0^2 = 0, 2^2 = 4, 4^2 = 16.
4. Sxx = 16+4+0+4+16 = 40.
In conclusion, Sxx is a useful statistical measure that helps in understanding the spread or variation of data points around the mean. It is calculated by finding the squared differences between each data point and the mean and summing them up.
Calculate Sxx in Statistics (With Example)
In statistics, Sxx represents the sum of squared deviations from the mean value of x.
This value is often calculated when fitting a by hand.
We use the following formula to calculate Sxx:
Sxx = Σ(xi – x)2
where:
- Σ: A symbol that means “sum”
- xi: The ith value of x
- x: The mean value of x
The following example shows how to use this formula in practice.
Example: Calculating Sxx by Hand
Suppose we would like to fit a simple linear regression model to the following dataset:

Suppose we would like to calculate Sxx, which represents the sum of squared deviations from the mean value of x.
First, we must calculate the mean value of x:
- x = (1 + 2 + 2 + 3 + 5 + 8) / 6 = 3.5
Next, we can use the following formula to calculate the value for Sxx:
- Sxx = Σ(xi – x)2
- Sxx = (1-3.5)2+(2-3.5)2+(2-3.5)2+(3-3.5)2+(5-3.5)2+(8-3.5)2
- Sxx = 6.25 + 2.25 + 2.25 + .25 + 2.25 + 20.25
- Sxx = 33.5
The value for Sxx turns out to be 33.5.
This tells us that the sum of squared deviations between the individual x values and the mean x value is 33.5.

The calculator returns a value of 33.5, which matches the value that we calculated by hand.
Note that we use the following formulas to perform simple linear regression by hand:
y = a + bx
where:
- a = y – bx
- b = Sxy / Sxx
The calculation for Sxx is just one calculation that we must perform in order to fit a simple linear regression model.
Related:
The following tutorials explain how to perform other common tasks in statistics:
Cite this article
stats writer (2024). How can Sxx be calculated in statistics, and can you provide an example?. PSYCHOLOGICAL SCALES. Retrieved from https://scales.arabpsychology.com/stats/how-can-sxx-be-calculated-in-statistics-and-can-you-provide-an-example/
stats writer. "How can Sxx be calculated in statistics, and can you provide an example?." PSYCHOLOGICAL SCALES, 25 Jun. 2024, https://scales.arabpsychology.com/stats/how-can-sxx-be-calculated-in-statistics-and-can-you-provide-an-example/.
stats writer. "How can Sxx be calculated in statistics, and can you provide an example?." PSYCHOLOGICAL SCALES, 2024. https://scales.arabpsychology.com/stats/how-can-sxx-be-calculated-in-statistics-and-can-you-provide-an-example/.
stats writer (2024) 'How can Sxx be calculated in statistics, and can you provide an example?', PSYCHOLOGICAL SCALES. Available at: https://scales.arabpsychology.com/stats/how-can-sxx-be-calculated-in-statistics-and-can-you-provide-an-example/.
[1] stats writer, "How can Sxx be calculated in statistics, and can you provide an example?," PSYCHOLOGICAL SCALES, vol. X, no. Y, ص Z-Z, June, 2024.
stats writer. How can Sxx be calculated in statistics, and can you provide an example?. PSYCHOLOGICAL SCALES. 2024;vol(issue):pages.
