We recommend that you begin by
answering questions before interacting with the simulation.
General Instructions
This demonstration allows you to examine the sum of squared deviations from a given value. The graph to the left shows the numbers 1, 2, 3, 4, and 5 and their deviations from an arbitrary starting value of 0.254 (the figure displays this rounded to 0.25). The first number, 1, is represented by a red dot. The deviation from 0.254 is represented by a red line from the red dot to the black line. The value of the black line is 0.254.Similarly, the number 2 is represented by a blue dot and its deviation from 0.25 is represented by a blue line.
The graph with the colored rectangles shows the sum of the absolute deviations. The sum of the deviations of the numbers 1, 2, 3, 4, and 5 from 0.25 is 0.746 + 1.75 + 2.746 + 3.746 + 4.746 = 13.73. The height of the pile of rectangles is 13.73 and represents the sum of the absolute deviations from the black line.
The area of each rectangle represents the magnitude of the squared deviation of a point from the black line. For example, the red rectangle has an area of 0.746 x 0.746 = 0.557. The sum of all the areas of the rectangles is 47.70.
In this demonstration, you can move the black bar by clicking on it and dragging it up or down. To see how it works, move it up to 1.0. The deviation of the red point from the black bar is now 0 since they are both 1. The sum of the deviations is now 10 (0 + 1 + 2 + 3 + 4) and the sum of squared deviations is 30 (0² + 1² + 2² + 3² + 4²).
As you move the bar up and down, the value of the sum of absolute deviations and the sum of squared deviations changes. See if you can find the placement of the black bar that produces the smallest value for the sum of the squared deviations. To check and see if you found the smallest value, click the “OK” button at the bottom of the graph. It will move the bar to the location that produces the smallest sum of squared deviations. For the initial data, the value that minimizes the sum of squared deviations is also the value that minimizes the sum of absolute deviations. This will not be true for most data.
You can also move the individual points. Click on one of the points and move it up or down and note the effect.
Your goal for this demonstration is to discover a rule for determining what value will give you the smallest sum of squared deviations.
When you have discovered the rule, go back and answer the questions again.
Choose “Step by step” instructions in the pop-up menu above for help discovering the rule.
Step By Step Instructions
If it is not already there, move the black bar at the bottom of the graph up so that it crosses the Y axis at 1. The bar should go right through the red circle. Notice the numerical indicator of the black bar immediately to its right.
The deviation of the red circle from the bar is 0, so you won’t see a red rectangle on the right-hand portion of the graph. The line between the bar and the blue circle is the deviation of the circle from the bar. It has a length of 1. Notice that the height of the blue rectangle is 1. The area of the blue rectangle is also 1.
The green line has a length of 2 and the height of the green rectangle is 2 and its area is 2² = 4. The total height of the rectangles is the sum of all the line lengths: 0 + 1 + 2 + 3 + 4 = 10. This height is the sum of the absolute deviations from the bar. It is marked below the rectangles. The sum of all the areas of the rectangles is 30.
Your goal is to find the placement of the bar that gives you the smallest total area. This will be the value that minimizes the sum of the areas of the rectangles. Move the bar up and down until you think you have found this value. Then, to make sure you are correct, click on the “OK” button at the bottom of the graph. This will move the black bar to the correct location. If nothing changes, you found the correct location on your own.
Now, change the value of the green circle from 3 to somewhere between 2 and 3. You move the circle by clicking on it and dragging it. Notice that the value of the point is shown in green.
Next, find the value that minimizes the sum of squared deviations for the new data.
Now move the blue circle to somewhere between 3 and 4 and again find the value that minimizes the sum of squared differences.
See if you can find a rule to determine which value will minimize the sum of squared deviations?
Summary
The mean is the number that minimizes the sum of the squared deviations. If a distribution is symmetrical, then the median and the mean are the same and the median also minimizes this quantity.
Questions
Begin by answering the questions, even if you have to guess. The first time you answer the questions you should not check your answers. Once you have answered all the questions, answer them again using the simulation to help you. The second time through click the “Check Answer” button to get feedback.