Linear Regression I

  • Linear Regression I

    Grade: 6th to 8th, High School

    This applet allows you to investigate a regression line, sometimes known as a "line of best fit."

    Plot several points in a relatively straight line, and then click Show Line. How well does the line approximate the scatterplot? Then, plot another point that does not lie along the line. How does the regression line change because of the outlier?

    Activity

    Instructions

    • Click anywhere on the grid to plot points.
    • To delete a point, hold down the Ctrl key, and click on the point you wish to delete.
    • To move a point, hold down the Shift key, and drag the point to a new location with the mouse.
    • To change the scale of the graph, change the values of x‑min, x‑max, y‑min, and y‑max, and hit the Set Scale button.
    • Click Show Line to display the linear regression line.
    • In the upper left corner, the following values are displayed:
    n
    The number of points on the graph.
    r
    The correlation coefficient. This measure indicates the association between the x‑variable and the y‑variable. Its absolute value roughly indicates how well the line of best fit approximates the data.
    y =
    An equation describing the line of best fit.
    • Note that the r-value and the equation of the line only appear after Show Line is clicked.
    • The Clear button will reset the graph.

    Exploration

    Plot one point on the graph and then click Show Line. Why do you think a line is not graphed?

    Clear the graph and plot two points that have whole-number coordinates.

    • On your own, find an equation for the line through these two points.
    • Click Show Line. Compare the equation for the line drawn to the equation that you calculated. Explain and resolve any differences.

    Clear the graph and plot three points. Think about a line that "fits" these three points as closely as possible.

    • Is it possible for a single straight line to contain all three of the points you plotted?
    • On a piece of paper, plot these same three points, and sketch a line that you think best fits the three points.
    • Click Show Line. Do you think that the line graphed fits the points well? How does it compare to the line you drew?

    Clear the graph. Place several points on the graph that lie roughly in a straight line, then hit Show Line. The line that appears is the regression line, which is sometimes known as the "line of best fit."

    • What is the r-value for the line?
    • Place just one additional point on the graph that lies far away from the line. What effect does this point have on the r‑value? What effect does it have on the line of best fit?
    • Move several of the points. How does the r-value and line change as points are moved?

    The line that is drawn is called the "least-squares regression line." Bascially, the least-squares regression line is the line that minimizes the squared "errors" between the actual points and the points on the line. This makes the line fit the points. To get a better feel for the regression line, try the following tasks.

    • Plot four points so that the regression line is horizontal. Do this in several different ways. What do you notice about the regression line and the r‑value?
    • Plot three points (not all on a straight line) so that the regression line is horizontal. What do you notice about the regression line and the r‑value?

    Objectives and Standards

    NCTM Standards and Expectations
    • Probability / Data Analysis and Statistics
    • 6-8
    • High School (9-12)
    • Data Analysis and Probability