Sxx Calculator (Sums of Squares)

This Sxx calculator computes the corrected sum of squares Sxx for your x values. Add y values to get Syy and Sxy, then the regression slope, intercept, correlation and SSE.

Checks on your data

  • Sxx is the numerator of the sample variance, so Sxx divided by n − 1 equals s². In regression, Sxx must be above 0 or no slope exists. Full regression analysis →

Results

Sxx = Σ(x − x̄)²
42
sum of squared deviations of x
Syy = Σ(y − ȳ)²
167.795
Sxy = Σ(x − x̄)(y − ȳ)
83.9
Σx
36
Σx²
204
Mean x̄
4.5
Sample variance Sxx/(n − 1)
6
Sample standard deviation
2.4494897
Σy
72.2
Σy²
819.4
Σxy
408.8
Mean ȳ
9.025
Slope b₁ = Sxy/Sxx
1.997619
Intercept b₀ = ȳ − b₁x̄
0.035714286
Correlation r = Sxy/√(Sxx·Syy)
0.99941947
SSE = Syy − Sxy²/Sxx
0.1947619
R²
0.99883929
Data with the least squares line (ŷ = 0.03571 + 1.998x)
510152468xy
Working table
xyx − x̄y − ȳ(x − x̄)²(x − x̄)(y − ȳ)
12.1-3.5-6.92512.2524.2375
23.9-2.5-5.1256.2512.8125
36.2-1.5-2.8252.254.2375
47.8-0.5-1.2250.250.6125
510.10.51.0750.250.5375
612.21.53.1752.254.7625
713.82.54.7756.2511.9375
816.13.57.07512.2524.7625
Show step-by-step solution
  1. Σx = 36, Σx² = 204, n = 8.
  2. Sxx = Σx² − (Σx)² ÷ n = 204 − 162 = 42.
  3. Syy = Σy² − (Σy)² ÷ n = 167.795.
  4. Sxy = Σxy − (Σx)(Σy) ÷ n = 408.8 − 324.9 = 83.9.
  5. b₁ = Sxy ÷ Sxx = 1.997619; b₀ = ȳ − b₁x̄ = 0.035714286; r = 0.99941947.
SxxΣ(x − x̄)²
SxyΣ(x − x̄)(y − ȳ)
SlopeSxy / Sxx
rSxy/√(Sxx·Syy)

What Is Sxx?

In statistics, Sxx = Σ(x − x̄)² is the sum of squared deviations of x from its mean. It is the numerator of the sample variance and the denominator of the least squares slope. The companion quantities are Syy = Σ(y − ȳ)² and Sxy = Σ(x − x̄)(y − ȳ).

Enter x values, and optionally y values, to get all three sums together with the means, Σx, Σx², Σxy, the slope Sxy/Sxx, the intercept, the correlation r = Sxy/√(Sxx·Syy), SSE and R². A working table shows each deviation so you can follow a hand calculation.

The sections below give the formulas, a variables table, a worked example and answers to common questions about notation and the link to variance.

How to Use the Sxx Calculator

  1. Enter the x values.
  2. Optionally enter the y values, in the same order.
  3. Read Sxx, Syy and Sxy.
  4. Use the slope, intercept, r and SSE shown below them.

Sxx Formula

Sxx

Sxx=∑(xi−xˉ)2=∑xi2−(∑xi)2nS_{xx}=\sum(x_i-\bar x)^2=\sum x_i^2-\frac{(\sum x_i)^2}{n}

Sxy

Sxy=∑(xi−xˉ)(yi−yˉ)=∑xiyi−∑xi∑yinS_{xy}=\sum(x_i-\bar x)(y_i-\bar y)=\sum x_iy_i-\frac{\sum x_i\sum y_i}{n}

Slope and correlation

b1=SxySxx,r=SxySxxSyyb_1=\frac{S_{xy}}{S_{xx}},\quad r=\frac{S_{xy}}{\sqrt{S_{xx}S_{yy}}}

Sxx Variables Explained

SymbolMeaningNotes
SxxSum of squared deviations of xΣ(x − x̄)²
SyySum of squared deviations of y
SxySum of cross-products of deviations
b₁Regression slopeSxy ÷ Sxx
rCorrelation coefficientSxy ÷ √(Sxx Syy)

Sxx Worked Example

For x = 1, 2, 3, 4: Σx = 10 and Σx² = 30, so Sxx = 30 − 10² ÷ 4 = 5. If y = 2, 4, 5, 8 then Σy = 19, Σxy = 2 + 8 + 15 + 32 = 57, so Sxy = 57 − 10 × 19 ÷ 4 = 9.5. The slope is 9.5 ÷ 5 = 1.9.

With the example values loaded in the calculator above, the steps are:

  1. Σx = 36, Σx² = 204, n = 8.
  2. Sxx = Σx² − (Σx)² ÷ n = 204 − 162 = 42.
  3. Syy = Σy² − (Σy)² ÷ n = 167.795.
  4. Sxy = Σxy − (Σx)(Σy) ÷ n = 408.8 − 324.9 = 83.9.
  5. b₁ = Sxy ÷ Sxx = 1.997619; b₀ = ȳ − b₁x̄ = 0.035714286; r = 0.99941947.

Result: Sxx = Σ(x − x̄)² = 42; Syy = Σ(y − ȳ)² = 167.795; Sxy = Σ(x − x̄)(y − ȳ) = 83.9; Slope b₁ = Sxy/Sxx = 1.997619.

Where Sxx Is Used

Hand regression

Checking the building blocks of a least squares line.

Variance by hand

Getting Sxx for a sample variance.

Correlation

Computing r from sums of squares.

Exam practice

Verifying A-level and intro statistics answers.

Common Sxx Mistakes to Avoid

  • Use the shortcut formula with Σx² for hand calculation, but beware rounding with large numbers.
  • Sxx ≥ 0 always; it is zero only if all x are equal.
  • Notation varies: some books write SSxx or Σxx.

Sxx Terms and Definitions

Corrected sum of squares
A sum of squared deviations from the mean, such as Sxx.
Cross-product sum
Sxy, which is positive when x and y rise together.

Sxx FAQs

What is Sxx in statistics?

The sum of squared deviations of x from its mean, Σ(x − x̄)².

How is Sxx related to variance?

Sample variance equals Sxx divided by n − 1.

What are Sxy and Syy?

Sxy is the sum of cross-products of deviations and Syy the sum of squared deviations of y.

How do I get the regression slope from Sxx?

Slope = Sxy ÷ Sxx, and the intercept is ȳ − slope × x̄.

Related calculators

Last updated 2026-11-09. See our disclaimer.