Judging Model Fit with Least Squares Method
Lesson
In this tutorial, you will use the Census at School data to fit a scatterplot that suggests a linear relationship and judge the fit of the model using the Show Squares feature. Show Squares In the previous tutorials, you learned that there may be several lines that appear to fit a given data reasonably well. In your own classroom, different students may choose different best fit lines. In this context, you also learned that the Least Squares line is one of the many objective ways to determine a good fit that is comparable. But what do the squares in the Least Squares line mean? Tuva allows you to visualize the squares in a concrete way to understand what it means in context of finding the best fit. Here are the steps to creating such a visual: Step 1: Create a Scatterplot Drag and drop a quantitative attribute on each of the x- and y-axes to create a scatterplot. Image: Show Squares_1 Step 2: Add a Movable Line From the toolbar, choose :ti[movable-line] and try to fit the data by manipulating the ends of the line. Notice that each point is at a certain distance from the line. This vertical distance is also called a residual. The residuals represent the difference between the actual data values and the values predicted by your model (the fitted line). Image: Show Squares_2 Step 3: Display the Squares From the toolbar, choose :ti[show-squares]. Image: Show Squares_3 Once you do so, squares appear, built on vertical segments extending from each point to the line (residuals). Image: Show Squares_4 Step 4: Display the Sum of Squares Click on the :ti[ti-summary-view] or hover over the fitted line to read the sum of all the squared residuals. Image: Show Squares_5 All the squares that you see in the graph are squares of the residuals (distance between the actual data value and the fitted line). The sum of the squares displayed in the summary view is the sum of the areas of the nine squares displayed in your scatterplot. This sum of squares changes as you drag the movable line in search of a good fit. The goal is to minimize this sum. This is how the least squares line got its name. In the interactive tutorial that follows, you will learn to use the Show Squares feature to find the best fit for the data. Click Next to begin!
Topics and standards: Line Of Best Fit, Scatter Plots, Fitting Data, Tutorial