Skip to content

Least Squares

Probability and Statistics · FE Reference Handbook section

Probability and Statistics
15 formulas
10 exam-style examples
~60 min
All Probability and Statistics lectures

Core formulas for this FE topic

Definitions, applicability, units, assumptions and worked examples for each relation.

Worked exam-style examples

The four ways this section is written on the real exam — thoughts first, then equations, then substitution.

Example 1
Least squares regression slope — solve for regression slope — Least Squares

An engineer fits a least squares regression line to calibration data. Given sum of cross products (Sxy) = 80.5000; sum of squares of x (Sxx) = 31.5000, determine the regression slope (b).

Given

  • sumofcrossproducts(Sxy)=80.5000sum of cross products (Sxy) = 80.5000
  • sumofsquaresofx(Sxx)=31.5000sum of squares of x (Sxx) = 31.5000

Find

regression slope (b)

Start with the thinking

  • The governing relation printed in this handbook section is Least squares regression slope.
  • Everything except b is given, so isolate b symbolically first — never rearrange after the numbers are in.
  • Tabulate each given with its unit and confirm the units are consistent with the relation before substituting.
  • The least squares method finds the regression slope minimizing the squared vertical residuals.
xyLeast squares regression line

Figure 1 — schematic for Least squares regression slope — solve for regression slope — Least Squares

Step-by-step solution

  1. Step 1 — State the governing relation:

    b=∑(xi−xˉ)(yi−yˉ)∑(xi−xˉ)2b = \dfrac{\sum (x_i - \bar{x})(y_i-\bar{y})}{\sum (x_i - \bar{x})^2}
  2. Step 2 — Rearrange symbolically for b:

    b=SxySxxb = \dfrac{S_{xy}}{S_{xx}}
  3. Step 3

    Listthegivens:sumofcrossproducts(Sxy)=80.5000,sumofsquaresofx(Sxx)=31.5000List the givens: sum of cross products (Sxy) = 80.5000, sum of squares of x (Sxx) = 31.5000
  4. Step 4 — Substitute the given values:

    b=SxySxxb = \dfrac{S_{xy}}{S_{xx}}
  5. Step 5 — Evaluate:

    b=2.5556b = 2.5556
  6. Step 6 — Check: returning b = 2.5556 to

    b=∑(xi−xˉ)(yi−yˉ)∑(xi−xˉ)2b = \dfrac{\sum (x_i - \bar{x})(y_i-\bar{y})}{\sum (x_i - \bar{x})^2}

    reproduces the given quantities, and both sides carry the same units.

Answer:
b=2.5556b = 2.5556

Why the other options are there

  • 5.1111 — kept a factor of two that cancels in the correct rearrangement.
  • 1.2778 — dropped that same factor in the other direction.
  • 2.8111 — rounded an intermediate value before the final step.

Reference: FE Handbook — Least Squares

Example 2
Least squares regression slope — solve for sum of cross products — Least Squares (2)

A student computes the least squares slope from sums of cross products. Given sum of squares of x (Sxx) = 69.0000; regression slope (b) = 5.9400, determine the sum of cross products (Sxy).

Given

  • sumofsquaresofx(Sxx)=69.0000sum of squares of x (Sxx) = 69.0000
  • regressionslope(b)=5.9400regression slope (b) = 5.9400

Find

sum of cross products (Sxy)

Start with the thinking

  • The governing relation printed in this handbook section is Least squares regression slope.
  • Everything except Sxy is given, so isolate Sxy symbolically first — never rearrange after the numbers are in.
  • Tabulate each given with its unit and confirm the units are consistent with the relation before substituting.
  • The least squares method finds the regression slope minimizing the squared vertical residuals.
xyLeast squares regression line

Figure 2 — schematic for Least squares regression slope — solve for sum of cross products — Least Squares (2)

Step-by-step solution

  1. Step 1 — State the governing relation:

    b=∑(xi−xˉ)(yi−yˉ)∑(xi−xˉ)2b = \dfrac{\sum (x_i - \bar{x})(y_i-\bar{y})}{\sum (x_i - \bar{x})^2}
  2. Step 2 — Rearrange symbolically for Sxy:

    Sxy=b SxxSxy = b\,S_{xx}
  3. Step 3

    Listthegivens:sumofsquaresofx(Sxx)=69.0000,regressionslope(b)=5.9400List the givens: sum of squares of x (Sxx) = 69.0000, regression slope (b) = 5.9400
  4. Step 4 — Substitute the given values:

    Sxy=5.9400 SxxSxy = 5.9400\,S_{xx}
  5. Step 5 — Evaluate:

    Sxy=409.9Sxy = 409.9
  6. Step 6 — Check: returning Sxy = 409.9 to

    b=∑(xi−xˉ)(yi−yˉ)∑(xi−xˉ)2b = \dfrac{\sum (x_i - \bar{x})(y_i-\bar{y})}{\sum (x_i - \bar{x})^2}

    reproduces the given quantities, and both sides carry the same units.

Answer:
Sxy=409.9Sxy = 409.9

Why the other options are there

  • 819.7 — kept a factor of two that cancels in the correct rearrangement.
  • 204.9 — dropped that same factor in the other direction.
  • 450.8 — rounded an intermediate value before the final step.

Reference: FE Handbook — Least Squares

Example 3
Least squares regression slope — solve for sum of squares of x — Least Squares (3)

The least squares trend line for settlement readings is calculated. Given sum of cross products (Sxy) = 96.0000; regression slope (b) = 8.0700, determine the sum of squares of x (Sxx).

Given

  • sumofcrossproducts(Sxy)=96.0000sum of cross products (Sxy) = 96.0000
  • regressionslope(b)=8.0700regression slope (b) = 8.0700

Find

sum of squares of x (Sxx)

Start with the thinking

  • The governing relation printed in this handbook section is Least squares regression slope.
  • Everything except Sxx is given, so isolate Sxx symbolically first — never rearrange after the numbers are in.
  • Tabulate each given with its unit and confirm the units are consistent with the relation before substituting.
  • The least squares method finds the regression slope minimizing the squared vertical residuals.
xyLeast squares regression line

Figure 3 — schematic for Least squares regression slope — solve for sum of squares of x — Least Squares (3)

Step-by-step solution

  1. Step 1 — State the governing relation:

    b=∑(xi−xˉ)(yi−yˉ)∑(xi−xˉ)2b = \dfrac{\sum (x_i - \bar{x})(y_i-\bar{y})}{\sum (x_i - \bar{x})^2}
  2. Step 2 — Rearrange symbolically for Sxx:

    Sxx=SxybSxx = \dfrac{S_{xy}}{b}
  3. Step 3

    Listthegivens:sumofcrossproducts(Sxy)=96.0000,regressionslope(b)=8.0700List the givens: sum of cross products (Sxy) = 96.0000, regression slope (b) = 8.0700
  4. Step 4 — Substitute the given values:

    Sxx=Sxy8.0700Sxx = \dfrac{S_{xy}}{8.0700}
  5. Step 5 — Evaluate:

    Sxx=11.8959Sxx = 11.8959
  6. Step 6 — Check: returning Sxx = 11.8959 to

    b=∑(xi−xˉ)(yi−yˉ)∑(xi−xˉ)2b = \dfrac{\sum (x_i - \bar{x})(y_i-\bar{y})}{\sum (x_i - \bar{x})^2}

    reproduces the given quantities, and both sides carry the same units.

Answer:
Sxx=11.8959Sxx = 11.8959

Why the other options are there

  • 23.7918 — kept a factor of two that cancels in the correct rearrangement.
  • 5.9480 — dropped that same factor in the other direction.
  • 13.0855 — rounded an intermediate value before the final step.

Reference: FE Handbook — Least Squares

Example 4
Least squares regression slope — solve for regression slope (case 2) — Least Squares (4)

An engineer fits a least squares regression line to calibration data. Given sum of cross products (Sxy) = 10.5000; sum of squares of x (Sxx) = 92.0000, determine the regression slope (b).

Given

  • sumofcrossproducts(Sxy)=10.5000sum of cross products (Sxy) = 10.5000
  • sumofsquaresofx(Sxx)=92.0000sum of squares of x (Sxx) = 92.0000

Find

regression slope (b)

Start with the thinking

  • The governing relation printed in this handbook section is Least squares regression slope.
  • Everything except b is given, so isolate b symbolically first — never rearrange after the numbers are in.
  • Tabulate each given with its unit and confirm the units are consistent with the relation before substituting.
  • The least squares method finds the regression slope minimizing the squared vertical residuals.
xyLeast squares regression line

Figure 4 — schematic for Least squares regression slope — solve for regression slope (case 2) — Least Squares (4)

Step-by-step solution

  1. Step 1 — State the governing relation:

    b=∑(xi−xˉ)(yi−yˉ)∑(xi−xˉ)2b = \dfrac{\sum (x_i - \bar{x})(y_i-\bar{y})}{\sum (x_i - \bar{x})^2}
  2. Step 2 — Rearrange symbolically for b:

    b=SxySxxb = \dfrac{S_{xy}}{S_{xx}}
  3. Step 3

    Listthegivens:sumofcrossproducts(Sxy)=10.5000,sumofsquaresofx(Sxx)=92.0000List the givens: sum of cross products (Sxy) = 10.5000, sum of squares of x (Sxx) = 92.0000
  4. Step 4 — Substitute the given values:

    b=SxySxxb = \dfrac{S_{xy}}{S_{xx}}
  5. Step 5 — Evaluate:

    b=0.1141b = 0.1141
  6. Step 6 — Check: returning b = 0.1141 to

    b=∑(xi−xˉ)(yi−yˉ)∑(xi−xˉ)2b = \dfrac{\sum (x_i - \bar{x})(y_i-\bar{y})}{\sum (x_i - \bar{x})^2}

    reproduces the given quantities, and both sides carry the same units.

Answer:
b=0.1141b = 0.1141

Why the other options are there

  • 0.2283 — kept a factor of two that cancels in the correct rearrangement.
  • 0.0571 — dropped that same factor in the other direction.
  • 0.1255 — rounded an intermediate value before the final step.

Reference: FE Handbook — Least Squares

Example 5
Least squares regression slope — solve for sum of cross products (case 2) — Least Squares (5)

A student computes the least squares slope from sums of cross products. Given sum of squares of x (Sxx) = 98.5000; regression slope (b) = 1.1300, determine the sum of cross products (Sxy).

Given

  • sumofsquaresofx(Sxx)=98.5000sum of squares of x (Sxx) = 98.5000
  • regressionslope(b)=1.1300regression slope (b) = 1.1300

Find

sum of cross products (Sxy)

Start with the thinking

  • The governing relation printed in this handbook section is Least squares regression slope.
  • Everything except Sxy is given, so isolate Sxy symbolically first — never rearrange after the numbers are in.
  • Tabulate each given with its unit and confirm the units are consistent with the relation before substituting.
  • The least squares method finds the regression slope minimizing the squared vertical residuals.
xyLeast squares regression line

Figure 5 — schematic for Least squares regression slope — solve for sum of cross products (case 2) — Least Squares (5)

Step-by-step solution

  1. Step 1 — State the governing relation:

    b=∑(xi−xˉ)(yi−yˉ)∑(xi−xˉ)2b = \dfrac{\sum (x_i - \bar{x})(y_i-\bar{y})}{\sum (x_i - \bar{x})^2}
  2. Step 2 — Rearrange symbolically for Sxy:

    Sxy=b SxxSxy = b\,S_{xx}
  3. Step 3

    Listthegivens:sumofsquaresofx(Sxx)=98.5000,regressionslope(b)=1.1300List the givens: sum of squares of x (Sxx) = 98.5000, regression slope (b) = 1.1300
  4. Step 4 — Substitute the given values:

    Sxy=1.1300 SxxSxy = 1.1300\,S_{xx}
  5. Step 5 — Evaluate:

    Sxy=111.3Sxy = 111.3
  6. Step 6 — Check: returning Sxy = 111.3 to

    b=∑(xi−xˉ)(yi−yˉ)∑(xi−xˉ)2b = \dfrac{\sum (x_i - \bar{x})(y_i-\bar{y})}{\sum (x_i - \bar{x})^2}

    reproduces the given quantities, and both sides carry the same units.

Answer:
Sxy=111.3Sxy = 111.3

Why the other options are there

  • 222.6 — kept a factor of two that cancels in the correct rearrangement.
  • 55.6525 — dropped that same factor in the other direction.
  • 122.4 — rounded an intermediate value before the final step.

Reference: FE Handbook — Least Squares

Example 6
Least squares regression slope — solve for sum of squares of x (case 2) — Least Squares (6)

The least squares trend line for settlement readings is calculated. Given sum of cross products (Sxy) = 26.5000; regression slope (b) = 2.0000, determine the sum of squares of x (Sxx).

Given

  • sumofcrossproducts(Sxy)=26.5000sum of cross products (Sxy) = 26.5000
  • regressionslope(b)=2.0000regression slope (b) = 2.0000

Find

sum of squares of x (Sxx)

Start with the thinking

  • The governing relation printed in this handbook section is Least squares regression slope.
  • Everything except Sxx is given, so isolate Sxx symbolically first — never rearrange after the numbers are in.
  • Tabulate each given with its unit and confirm the units are consistent with the relation before substituting.
  • The least squares method finds the regression slope minimizing the squared vertical residuals.
xyLeast squares regression line

Figure 6 — schematic for Least squares regression slope — solve for sum of squares of x (case 2) — Least Squares (6)

Step-by-step solution

  1. Step 1 — State the governing relation:

    b=∑(xi−xˉ)(yi−yˉ)∑(xi−xˉ)2b = \dfrac{\sum (x_i - \bar{x})(y_i-\bar{y})}{\sum (x_i - \bar{x})^2}
  2. Step 2 — Rearrange symbolically for Sxx:

    Sxx=SxybSxx = \dfrac{S_{xy}}{b}
  3. Step 3

    Listthegivens:sumofcrossproducts(Sxy)=26.5000,regressionslope(b)=2.0000List the givens: sum of cross products (Sxy) = 26.5000, regression slope (b) = 2.0000
  4. Step 4 — Substitute the given values:

    Sxx=Sxy2.0000Sxx = \dfrac{S_{xy}}{2.0000}
  5. Step 5 — Evaluate:

    Sxx=13.2500Sxx = 13.2500
  6. Step 6 — Check: returning Sxx = 13.2500 to

    b=∑(xi−xˉ)(yi−yˉ)∑(xi−xˉ)2b = \dfrac{\sum (x_i - \bar{x})(y_i-\bar{y})}{\sum (x_i - \bar{x})^2}

    reproduces the given quantities, and both sides carry the same units.

Answer:
Sxx=13.2500Sxx = 13.2500

Why the other options are there

  • 26.5000 — kept a factor of two that cancels in the correct rearrangement.
  • 6.6250 — dropped that same factor in the other direction.
  • 14.5750 — rounded an intermediate value before the final step.

Reference: FE Handbook — Least Squares

Example 7
Least squares regression slope — solve for regression slope (case 3) — Least Squares (7)

An engineer fits a least squares regression line to calibration data. Given sum of cross products (Sxy) = 172.0; sum of squares of x (Sxx) = 16.5000, determine the regression slope (b).

Given

  • sumofcrossproducts(Sxy)=172.0sum of cross products (Sxy) = 172.0
  • sumofsquaresofx(Sxx)=16.5000sum of squares of x (Sxx) = 16.5000

Find

regression slope (b)

Start with the thinking

  • The governing relation printed in this handbook section is Least squares regression slope.
  • Everything except b is given, so isolate b symbolically first — never rearrange after the numbers are in.
  • Tabulate each given with its unit and confirm the units are consistent with the relation before substituting.
  • The least squares method finds the regression slope minimizing the squared vertical residuals.
xyLeast squares regression line

Figure 7 — schematic for Least squares regression slope — solve for regression slope (case 3) — Least Squares (7)

Step-by-step solution

  1. Step 1 — State the governing relation:

    b=∑(xi−xˉ)(yi−yˉ)∑(xi−xˉ)2b = \dfrac{\sum (x_i - \bar{x})(y_i-\bar{y})}{\sum (x_i - \bar{x})^2}
  2. Step 2 — Rearrange symbolically for b:

    b=SxySxxb = \dfrac{S_{xy}}{S_{xx}}
  3. Step 3

    Listthegivens:sumofcrossproducts(Sxy)=172.0,sumofsquaresofx(Sxx)=16.5000List the givens: sum of cross products (Sxy) = 172.0, sum of squares of x (Sxx) = 16.5000
  4. Step 4 — Substitute the given values:

    b=SxySxxb = \dfrac{S_{xy}}{S_{xx}}
  5. Step 5 — Evaluate:

    b=10.4242b = 10.4242
  6. Step 6 — Check: returning b = 10.4242 to

    b=∑(xi−xˉ)(yi−yˉ)∑(xi−xˉ)2b = \dfrac{\sum (x_i - \bar{x})(y_i-\bar{y})}{\sum (x_i - \bar{x})^2}

    reproduces the given quantities, and both sides carry the same units.

Answer:
b=10.4242b = 10.4242

Why the other options are there

  • 20.8485 — kept a factor of two that cancels in the correct rearrangement.
  • 5.2121 — dropped that same factor in the other direction.
  • 11.4667 — rounded an intermediate value before the final step.

Reference: FE Handbook — Least Squares

Example 8
Least squares regression slope — solve for sum of cross products (case 3) — Least Squares (8)

A student computes the least squares slope from sums of cross products. Given sum of squares of x (Sxx) = 80.5000; regression slope (b) = 0.4200, determine the sum of cross products (Sxy).

Given

  • sumofsquaresofx(Sxx)=80.5000sum of squares of x (Sxx) = 80.5000
  • regressionslope(b)=0.4200regression slope (b) = 0.4200

Find

sum of cross products (Sxy)

Start with the thinking

  • The governing relation printed in this handbook section is Least squares regression slope.
  • Everything except Sxy is given, so isolate Sxy symbolically first — never rearrange after the numbers are in.
  • Tabulate each given with its unit and confirm the units are consistent with the relation before substituting.
  • The least squares method finds the regression slope minimizing the squared vertical residuals.
xyLeast squares regression line

Figure 8 — schematic for Least squares regression slope — solve for sum of cross products (case 3) — Least Squares (8)

Step-by-step solution

  1. Step 1 — State the governing relation:

    b=∑(xi−xˉ)(yi−yˉ)∑(xi−xˉ)2b = \dfrac{\sum (x_i - \bar{x})(y_i-\bar{y})}{\sum (x_i - \bar{x})^2}
  2. Step 2 — Rearrange symbolically for Sxy:

    Sxy=b SxxSxy = b\,S_{xx}
  3. Step 3

    Listthegivens:sumofsquaresofx(Sxx)=80.5000,regressionslope(b)=0.4200List the givens: sum of squares of x (Sxx) = 80.5000, regression slope (b) = 0.4200
  4. Step 4 — Substitute the given values:

    Sxy=0.4200 SxxSxy = 0.4200\,S_{xx}
  5. Step 5 — Evaluate:

    Sxy=33.8100Sxy = 33.8100
  6. Step 6 — Check: returning Sxy = 33.8100 to

    b=∑(xi−xˉ)(yi−yˉ)∑(xi−xˉ)2b = \dfrac{\sum (x_i - \bar{x})(y_i-\bar{y})}{\sum (x_i - \bar{x})^2}

    reproduces the given quantities, and both sides carry the same units.

Answer:
Sxy=33.8100Sxy = 33.8100

Why the other options are there

  • 67.6200 — kept a factor of two that cancels in the correct rearrangement.
  • 16.9050 — dropped that same factor in the other direction.
  • 37.1910 — rounded an intermediate value before the final step.

Reference: FE Handbook — Least Squares

Example 9
Least squares regression slope — solve for sum of squares of x (case 3) — Least Squares (9)

The least squares trend line for settlement readings is calculated. Given sum of cross products (Sxy) = 144.0; regression slope (b) = 9.1000, determine the sum of squares of x (Sxx).

Given

  • sumofcrossproducts(Sxy)=144.0sum of cross products (Sxy) = 144.0
  • regressionslope(b)=9.1000regression slope (b) = 9.1000

Find

sum of squares of x (Sxx)

Start with the thinking

  • The governing relation printed in this handbook section is Least squares regression slope.
  • Everything except Sxx is given, so isolate Sxx symbolically first — never rearrange after the numbers are in.
  • Tabulate each given with its unit and confirm the units are consistent with the relation before substituting.
  • The least squares method finds the regression slope minimizing the squared vertical residuals.
xyLeast squares regression line

Figure 9 — schematic for Least squares regression slope — solve for sum of squares of x (case 3) — Least Squares (9)

Step-by-step solution

  1. Step 1 — State the governing relation:

    b=∑(xi−xˉ)(yi−yˉ)∑(xi−xˉ)2b = \dfrac{\sum (x_i - \bar{x})(y_i-\bar{y})}{\sum (x_i - \bar{x})^2}
  2. Step 2 — Rearrange symbolically for Sxx:

    Sxx=SxybSxx = \dfrac{S_{xy}}{b}
  3. Step 3

    Listthegivens:sumofcrossproducts(Sxy)=144.0,regressionslope(b)=9.1000List the givens: sum of cross products (Sxy) = 144.0, regression slope (b) = 9.1000
  4. Step 4 — Substitute the given values:

    Sxx=Sxy9.1000Sxx = \dfrac{S_{xy}}{9.1000}
  5. Step 5 — Evaluate:

    Sxx=15.8242Sxx = 15.8242
  6. Step 6 — Check: returning Sxx = 15.8242 to

    b=∑(xi−xˉ)(yi−yˉ)∑(xi−xˉ)2b = \dfrac{\sum (x_i - \bar{x})(y_i-\bar{y})}{\sum (x_i - \bar{x})^2}

    reproduces the given quantities, and both sides carry the same units.

Answer:
Sxx=15.8242Sxx = 15.8242

Why the other options are there

  • 31.6484 — kept a factor of two that cancels in the correct rearrangement.
  • 7.9121 — dropped that same factor in the other direction.
  • 17.4066 — rounded an intermediate value before the final step.

Reference: FE Handbook — Least Squares

Example 10
Least squares regression slope — solve for regression slope (case 4) — Least Squares (10)

An engineer fits a least squares regression line to calibration data. Given sum of cross products (Sxy) = 21.5000; sum of squares of x (Sxx) = 66.0000, determine the regression slope (b).

Given

  • sumofcrossproducts(Sxy)=21.5000sum of cross products (Sxy) = 21.5000
  • sumofsquaresofx(Sxx)=66.0000sum of squares of x (Sxx) = 66.0000

Find

regression slope (b)

Start with the thinking

  • The governing relation printed in this handbook section is Least squares regression slope.
  • Everything except b is given, so isolate b symbolically first — never rearrange after the numbers are in.
  • Tabulate each given with its unit and confirm the units are consistent with the relation before substituting.
  • The least squares method finds the regression slope minimizing the squared vertical residuals.
xyLeast squares regression line

Figure 10 — schematic for Least squares regression slope — solve for regression slope (case 4) — Least Squares (10)

Step-by-step solution

  1. Step 1 — State the governing relation:

    b=∑(xi−xˉ)(yi−yˉ)∑(xi−xˉ)2b = \dfrac{\sum (x_i - \bar{x})(y_i-\bar{y})}{\sum (x_i - \bar{x})^2}
  2. Step 2 — Rearrange symbolically for b:

    b=SxySxxb = \dfrac{S_{xy}}{S_{xx}}
  3. Step 3

    Listthegivens:sumofcrossproducts(Sxy)=21.5000,sumofsquaresofx(Sxx)=66.0000List the givens: sum of cross products (Sxy) = 21.5000, sum of squares of x (Sxx) = 66.0000
  4. Step 4 — Substitute the given values:

    b=SxySxxb = \dfrac{S_{xy}}{S_{xx}}
  5. Step 5 — Evaluate:

    b=0.3258b = 0.3258
  6. Step 6 — Check: returning b = 0.3258 to

    b=∑(xi−xˉ)(yi−yˉ)∑(xi−xˉ)2b = \dfrac{\sum (x_i - \bar{x})(y_i-\bar{y})}{\sum (x_i - \bar{x})^2}

    reproduces the given quantities, and both sides carry the same units.

Answer:
b=0.3258b = 0.3258

Why the other options are there

  • 0.6515 — kept a factor of two that cancels in the correct rearrangement.
  • 0.1629 — dropped that same factor in the other direction.
  • 0.3583 — rounded an intermediate value before the final step.

Reference: FE Handbook — Least Squares

© 2026 Dr. Steve Efe. Civil Engineering Capstone Studio. All rights reserved.