Prediction & R²
Checkpoints on this Page:
Making Predictions
Re-enter your color values and nitrate concentrations from the previous activity. Remember that it doesn’t remember them from page to page, so this is repetitive.
NOTE: You should be able to go back to the previous page and copy/paste the two lists here.
Click the ▶️ Run Code button to re-load your data.
Now that we have our regression model, we can use it to predict nitrate concentrations for new color values — even ones we didn’t measure!
No code edits needed!
Click the ▶️ Run Code button to generate an interactive scatterplot with regression line. Then type any color value (x) into the box to see where that point falls (in terms of nitrate_ppm) on your group’s regression line.
Predict The Nitrate Concentrations for New Test Pads
Materials Needed:
- RGB Applet V2
- Three Additional “Nitrate Test Pad” Cards
- Handout
- Pencil
- Use the applet linked above to find either the R, G, or B value (depending on your group’s assignment) for the new cards.
- Then, use the graphing tool above to predict the nitrate concentration (ppm) the strip pad is reporting.
- Record these predictions on your handout.
How Good Is Our Model? R²
Our regression line doesn’t pass through every data point perfectly — and that’s okay! But how do we know if our model is good enough to trust?
That’s where R² (pronounced “R-squared”) comes in. R² tells us how well our regression line fits the data. It’s reported between 0% and 100%, like a report card or grade:
| R² value | What it means |
|---|---|
| Close to 100% | The line fits the data very well — predictions will be accurate |
| Close to 0% | The line barely fits — predictions won’t be reliable |
| Around 70–90% | A reasonably strong fit |
No code edits needed!
Click the ▶️ Run Code button to calculate your model’s R² value.
Materials Needed:
- Poster Marker
Write your group’s R squared model on the poster at the front of the room. Compare your group’s R squared value with the values of the other groups. What do you notice?
How might we improve our model and, therefore, prediction?
Applying to Another Agriculture Scenario
Materials Needed: Handout, Pencil
Scenario: A local strawberry farm sells berries at small stands around town. They want to sell out every day! Some days are slower than others, so they’re thinking about offering discounts to sell more. What makes a day slow or busy? What clues could help them predict when to offer a discount?