Lesson 5.A.3 - Least-Squares Regression

Key Question: Does access to organic food vary by neighborhood

Content: Least-Squares | Computer Output | Interpreting Slope & y-Intercept | Coefficient of Determination (r²)

Alignment: CED Topics 5.5

Video

Student Items

Handout: pdf, doc

Mastery Check: link

Supplemental / Calculator Videos: link

Teacher Items

Handout Key: pdf, doc

Mastery Check Key: link

Slide Deck: pdf, ppt

Data: xls

Course Resources

Resources for teaching our AP® Statistics curriculum.

  • Lesson Flow - timing and flow of class, using our lesson materials
  • Pacing Guide - pacing our units, with daily or block schedules
  • CED Alignment Guide - aligning our lessons to the AP® Statistics Course and Exam Description

Teaching Resources

Resources for teaching with Skew The Script.

Lesson Notes

Lesson-specific insights from the creators of this lesson.

GIF

A former Skew The Script student noticed that her local grocery store offered fewer organic items than another location – from the same company – in a wealthier part of town. So, she collected data from every location in the city to investigate. In this lesson, students analyze this data set using least-squares regression, as they model the trend between income and access to organic foods. Then, they consider the fairness of this trend, both from the consumers’ perspective and from the company’s perspective.

Learning Targets
  • Describe how least-squares regression line (LSRL) models are fit to data
  • Identify the point that every LSRL passes through: (x̄, ȳ)
  • Interpret the slope and y-intercept of an LSRL model
  • Determine and interpret the coefficient of interpretation (r²)

Before proceeding: Familiarize yourself with the lesson materials linked above (e.g. handout, handout key, slides, video). Then, for additional background and teaching tips from the lesson creators, check out the sections below.


  • It’s helpful to emphasize that this data set was gathered by a real high school student who used her learning in statistics class to investigate a topic that she cared about. Although much of this course is about getting students to think critically as data consumers, telling this story can help students see themselves as data gatherers and producers too. This framing is especially helpful as students approach any post-AP exam data projects or, more importantly, any data projects they perform in college, the workforce, or on their own.
  • Instead of using the provided San Antonio data set in the lesson, instructors can consider gathering their own data set that reflects the relationship between income and access to organic foods in their own region. Income data is accessible via the US Census. Grocery data can be more difficult to gather, and its accessibility varies by region. However, the best strategy is to go to the website of the most popular grocery chain in your region. Then, on the webpage for each store location, perform a search for the products offered in-store. See if there is an “organic” filter for the search results. If so, click the filter and search for all products flagged as organic. The number of total results that appear is the number of organic items offered in store.
  • To find the LSRL from raw data, technology such as a graphing calculator or Desmos should be used. However, on the AP Statistics Exam, students are typically given either the regression equation or computer output. They are rarely given raw data and asked to find the LSRL. Therefore, it is more important to be able to identify and interpret the slope, y-intercept, r, and r² values from regression output than to compute the model with technology.
  • If time allows, we highly recommend showing students the optional video that explains some of the mathematical background behind the coefficient of determination (r²). The explanation in the video helps motivate the interpretation of r², so that the interpretation becomes meaningful to students – rather than another memorized sentence stem.

First, download this lesson's Handout Key and read through its Discussion Question section. Then, check out our model discussion norms and the additional background notes below.

  • It can be helpful to mention that the y-variable does not describe the volume of organic products in the store (i.e. it’s not the stock or raw number of organic items on shelves). Rather, the y-variable describes the number of organic product types or varieties. So, when there are fewer organic items, this means that there are fewer organic choices for consumers.
  • One way to frame this discussion is as a trade off between groups and individuals. If one group tends to buy more organic than another group, they get more organic varieties offered at their stores. However, all groups will likely have some individuals who would prefer to buy organic. Because of where they live, these individuals may have to spend more time (especially if using public transit) and money (gas or transit fare) to buy their products elsewhere.
  • Then again, for the store, offering more varieties of organic items could be costly. Offering more types of products could mean having to track new supply chains, product-specific expiration and care instructions, etc. So, for every store, they may need to sell a certain volume of a product in order to make offering it worth the cost.
  • The grocery store data set was gathered by a real high school student, who used her learning in statistics class to investigate a topic that she cared about. Sharing this background can help inspire students to take the initiative to gather their own data about their own areas of interest. Students can also consider gathering income and grocery data within their own city or region, to see if they find a similar trend locally.
  • The student gathered the data in 2019. She found the average household income in each zip code from this US census aggregator. She found the food data by searching H-E-B’s website. Specifically, she went to the webpage for each full-size store in the city of San Antonio. On each store’s webpage, she searched for products offered in-store that were flagged as “organic.” The data set shows the total number of returned search results for each store.
  • It’s worth noting for students that the average household income in the data set is coded in terms of thousands of dollars (e.g. a value of 53 indicates $53,000). This creates an opportunity to discuss how units affect the interpretation of slope.
  • Why do we square the residuals to get rid of negatives? Why not just find the model that minimizes the absolute value of the residuals? There are two central reasons for this: i) Squaring emphasizes larger differences, which can be helpful for surfacing outliers. ii) Squares have nicer mathematical properties than absolute values. In particular, finding the model that minimizes the residual error often means performing a derivative. It’s much easier to find the derivative of a square than an absolute value.
  • Every least-squares regression line passes through the point (x̄, ȳ). Conceptually, the fitting process can be viewed as beginning with a horizontal line at y = ȳ and then rotating until the total squared residual error is minimized. While students are not expected to derive this result, it can help build intuition about how the model relates to the center of the data.
  • The coefficient of determination (r²) alone does not provide enough information to fully determine the correlation coefficient (r). The magnitude can be recovered algebraically, but the sign must be determined from the direction of the relationship seen in the scatterplot. This provides another reason to examine the graph before relying solely on summary statistics.
  • The interpretation of r² introduces the important idea that statistical models explain some variation in a response variable, but rarely all of it. Consider showing students the optional video that explains some of the mathematical background behind the interpretation of r².

Student Supports

Lesson-specific resources to support all learners.

  • Interpreting slope in context can be challenging when explanatory variables are measured in unfamiliar units. Encourage students to carefully identify the units of both variables before interpreting the slope. In this lesson, income is measured in thousands of dollars rather than individual dollars, which substantially affects the interpretation.
  • When interpreting a y-intercept, it can be helpful to first determine whether x = 0 is realistic in the context being studied. A y-intercept can be mathematically correct, while still lacking a meaningful real-world interpretation.
  • Vocabulary used in the context of the lesson may include words that are unfamiliar or have several meanings. In particular, the following mathematical terms may need clarification or a definition provided:
    • Residual
    • Squared
    • Slope
    • y-intercept
    • Positive and negative associations
    • Strong and weak associations
  • In addition, the following contextual terms may need clarification or a definition provided:
    • Organic
    • Access
    • Zip code
    • Low income and high income
  • In class conversation, it can be helpful to describe the magnitude of the slope as the steepness of the line and describe the magnitude of r or r² as the strength of the relationship. Consider also showing students examples of steep lines with weak relationships (steep lines with data spread out far from the line) and shallow lines with strong relationships (almost flat lines with data closely hugging the line). This will not only help students refine their language when discussing steepness versus strength, but it will also help them conceptually differentiate the meaning of a high slope value (steep line) from the meaning of a high r or r² value (strong association).