Line of best fit: make a table, run the regression, read a and b
An original SAT-style practice question on a line of best fit, worked step by step in Desmos — the same graphing calculator that's built into Bluebook — with the by-hand check alongside.
A lemonade stand recorded the daily high temperature, in degrees Fahrenheit, and the number of cups of lemonade sold on five days.
| High temperature (°F) | Cups sold |
|---|---|
| 60 | 31 |
| 65 | 43 |
| 70 | 60 |
| 75 | 77 |
| 80 | 89 |
Using the linear regression model (line of best fit) for the data, how many cups of lemonade would the stand be predicted to sell on a day with a high temperature of 72°F?
Step by step
Make a table and enter the data
Tap the + at the top of the expression list and choose table. Desmos labels the columns x₁ and y₁. Put the temperatures in the first column and the cups in the second. The points appear on the graph — zoom out or zoom-fit if they're off screen.
Run the regression
On a new line, type the regression with a tilde (~), not an equals sign, and use the subscripts so Desmos knows to use the table columns.
Plug in the value the question gives
The line of best fit is y = 3x − 150. The question gives a temperature, which is x, so substitute 72 for x on a new line.
The line of best fit is y = 3x − 150, so at 72°F it predicts 3(72) − 150 = 216 − 150 = 66 cups. That sits sensibly between the 70°F day (60 cups) and the 75°F day (77 cups).
Typing y~ax+b without the subscripts, or = instead of ~ — then Desmos doesn't fit anything to your table. Another one: answering with 3 or −150 straight from the panel. Those are the slope and intercept, not the prediction; the question wants the y-value at x = 72. And don't plug 72 in as y — temperature is the x column here.
Least squares, with friendly numbers: the mean temperature is 70 and the mean number of cups is 300 ÷ 5 = 60. Take each point's distance from those means: the temperatures are −10, −5, 0, 5, 10 away and the cups are −29, −17, 0, 17, 29 away. The slope is the sum of the products divided by the sum of the squared temperature distances: (290 + 85 + 0 + 85 + 290) ÷ (100 + 25 + 0 + 25 + 100) = 750 ÷ 250 = 3. The line passes through the mean point (70, 60), so 60 = 3(70) + b, which gives b = −150.
That's a lot of arithmetic for one question, and most real data isn't this tidy, so Desmos is the realistic route. Once you have a and b from either method, the prediction is a single substitution.
More walkthroughs: exponential growth · systems of linear equations · vertex and maximum value · quadratic roots · circle equations · sum of a quadratic's solutions · solving for x by graphing · linear inequalities · absolute value equations · Desmos cheat sheet · all walkthroughs
Stuck on a different practice question?
Snap a photo of any SAT-style math practice question and CalcHack walks you through the fastest route, in Desmos or by hand. Five free scans every day, no account needed to start.
Try it on your own question