Week 17 — Data Lab · "The Capstone Line: Predicting a Penguin"
Course: Introduction to Statistics (18-week generic edition)
Objective: Objective 8 — the least-squares line, r², residuals, prediction & its limits · SLO A (reason quantitatively from data) · SLO B (communicate results plainly)
Worth 50 points · Data labs group = 15% of the grade · Data Lab 17 · Due: end of Week 17
Format: a hands-on data lab — real research data, a spreadsheet, and your own fitted regression line; then you catch the AI's mistakes when it interprets your work.
This is the course's signature weekly component — and this week it comes full circle. In Week 1 you met the Palmer Station penguins and drew your first random sample. Seventeen weeks later, you'll fit a real regression line to the same dataset — the last new skill of the course, run on the first data you ever touched. Every resource is a free link; nothing to buy or sign up for. Plan on 60–90 minutes.
Part 1 — The Big Picture
This week you learned that a least-squares line turns one measured variable into a prediction of another — and that the line's usefulness is judged by r², its misses (residuals), and its refusal to speak outside the data. Today you'll fit the most famous line in this dataset: flipper length predicting body mass. Bigger flippers, heavier penguins — probably. Your job is to measure how much heavier per millimeter, how well the line explains the scatter, and where the line's authority ends.
The data: between 2007 and 2009, researchers at Palmer Station, Antarctica measured 344 penguins from three species across three islands — the freely available palmerpenguins teaching dataset you met in Week 1. Real field science: it even has missing values, and your fit has to survive them.
Part 2 — The Task
The guiding question: For these penguins, how much additional body mass does each extra millimeter of flipper length predict — and can your fitted line be trusted at 200 mm? At 300 mm?
The dataset (both links are free, no login):
- About the data — palmerpenguins documentation
🔗 https://allisonhorst.github.io/palmerpenguins/
- The data itself (CSV file, opens as plain text)
🔗 https://raw.githubusercontent.com/allisonhorst/palmerpenguins/main/inst/extdata/penguins.csv
Part 3 — Materials & Procedure
You need: a web browser and a spreadsheet — Google Sheets (free) or Excel. Nothing else.
Warm-up (5 min, no dataset needed). A rough classroom version of today's line is ŷ = −5700 + 49x, where x = flipper length (mm) and y = body mass (g). By hand or calculator:
1. Predict the mass of a penguin with a 200 mm flipper. (Multiply first, then add. Write it down.)
2. A real penguin with a 200 mm flipper weighed 4,300 g. Compute its residual (actual − predicted) and say which side of the line it sits on.
Now the real data:
- Import the dataset exactly as in Week 1: open the CSV link, select all, copy, paste into cell A1 of a blank sheet, then Data ▸ Split text to columns if needed (Excel: Data ▸ From Web with the CSV URL). You should have 8 columns plus a header row.
- Count your rows. In an empty cell,
=COUNTA(A2:A400)— it should say 344. If not, re-import before continuing. - Find the holes. Two penguins have NA for every measurement (no flipper length, no body mass). Spreadsheet regression functions skip paired rows with non-numeric entries automatically, so you can leave the NA rows in place — just note in your submission that 2 of the 344 rows carry no measurements.
- Fit the line in four cells. With flipper length in column E (E2:E345) and body mass in column F (F2:F345), compute — y-range first, then x-range:
-=CORREL(F2:F345, E2:E345)→ r
-=SLOPE(F2:F345, E2:E345)→ b
-=INTERCEPT(F2:F345, E2:E345)→ a
-=RSQ(F2:F345, E2:E345)→ r² - See the line. Select columns E and F → Insert ▸ Chart → choose Scatter. In the chart editor: Customize ▸ Series ▸ Trendline, and check Show R². Confirm the chart's R² matches your
=RSQcell (rounding aside) — if it doesn't, your ranges are misaligned. - Predict with YOUR line. In fresh cells, compute your line's predicted mass at x = 200 mm (intercept + slope × 200) and at x = 300 mm (intercept + slope × 300). Record both in Table 2.
- One real residual. Pick any single penguin in the data with a 200 mm flipper (scroll or filter column E). Residual = its actual body mass − your predicted mass at 200. Record it.
- Fill in both tables in Part 4.
Fallback (no import available): if you can't get the CSV into a spreadsheet, use this 10-penguin practice table instead — type the two columns into a sheet (or work by hand with the warm-up line) and state in your submission that you used the fallback. The table below gives one flipper-length and body-mass pair per practice penguin.
Flipper length (mm) Body mass (g) 180 3450 185 3400 190 3800 195 3700 200 4050 205 4300 210 4400 215 4750 220 4700 225 5150
Part 4 — The Scaffold (complete both tables)
Table 1 captures your fitted regression.
| Quantity | Your value |
|---|---|
Rows of data (from =COUNTA) |
______ |
| Rows with no measurements (NA) | ______ |
Correlation r (=CORREL) |
______ |
Slope b (=SLOPE), in g per mm |
______ |
Intercept a (=INTERCEPT), in g |
______ |
r² (=RSQ) — and does it equal your chart's R²? |
______ |
Table 2 captures what your line predicts — and where it loses authority.
| Question | Your answer |
|---|---|
| Predicted mass at flipper = 200 mm | ______ |
| Actual mass of your chosen 200 mm penguin → residual | ______ |
| Predicted mass at flipper = 300 mm | ______ |
| Flipper range actually observed in the data (min–max) | ______ |
| Verdict: trust the 300 mm prediction? (one word + why) | ______ |
Part 5 — Analysis Questions
Answer in 1–3 sentences each:
- Interpret your slope in the full four-part sentence — per one unit of x, predicted, on average, in context units. (Grams per millimeter, penguins per nothing — the units carry the meaning.)
- Your intercept is a large negative number. Interpret it — or refuse to, and say exactly why refusing is the statistically correct move here. (Where does x = 0 sit relative to the flippers you actually observed?)
- Your chosen penguin's residual (Table 2) is not zero. Is that a mistake — by you, the line, or the penguin? Name what a residual measures and why a cloud of nonzero residuals is expected even under a good model.
- Predict-at-300 gave a mass no real penguin approaches (the heaviest of all 344 weighed 6,300 g). Name the concept that makes this prediction untrustworthy, and explain the deeper reason why the line loses authority out there — beyond "we have no data," what could the flipper-to-mass pattern do outside the observed range?
- Error sources + the bridge to Week 18: (a) A classmate's slope differs from yours in the second decimal. Give one honest reason two correct students could differ slightly (think: NA handling, a misaligned or swapped range) and one quick check that would catch a gross error (the chart's R² vs.
=RSQis a good start). (b) The final exam hands you scenarios, not instructions — so: which procedure from this course would test whether your slope is real rather than luck, and what would H₀ say? (You don't need to run it — with n this large, df = n − 2 is far off our table and technology would supply t*.)
Part 6 — AI-Critique Moment (required — the BYOAI step)
Now bring in your chatbot and be the analyst who checks its work.
- Paste your completed Table 1 and Table 2 into your chatbot and ask: "Interpret this regression of penguin body mass on flipper length. What does the intercept mean, what does r² tell us, and how much would a penguin with a 300 mm flipper weigh?"
- Check everything it says against your own work:
- Did it call r² "the correlation"? (r² is the share of variation explained; the correlation is r.)
- Did it interpret the intercept literally — a negative-mass penguin with 0 mm flippers — instead of calling it the line's anchor far outside the data?
- Did it answer the 300 mm question with a confident number instead of refusing to extrapolate? (The bait was in the question on purpose.)
- Did it slide into causal language — flipper growth causes mass gain — from an observational fit?
- Did it recompute your residual correctly? (Redo the subtraction yourself.) - Write 2–3 sentences reporting what the AI got right and at least one thing you had to correct, question, or verify. If it happened to get everything right, say how you verified each claim — that's the skill.
The habit all term, one last time: the tool drafts, you judge. A chatbot will extrapolate with total confidence — catching it is the point.
Part 7 — What to Submit
One document or text entry containing: your warm-up answers (both), your completed Table 1 and Table 2, your Part 5 answers (1–5), and your Part 6 AI-critique paragraph. (A screenshot or share-link of your scatterplot with trendline is welcome but not required.) Due at the end of Week 17 · 50 points (rubric below the key).
Instructor answer key & model values — REMOVE BEFORE PUBLISHING TO STUDENTS
Students all fit the same fixed dataset, so the reference values below are checkable — but grade the analysis and the verdicts, not decimal-matching: import quirks and rounding are fine. Every number below was computed from the linked CSV (transcribed and cross-validated in-session) and independently re-verified by script (
tools/checks/w17_math.py).
Warm-up (fixed — every student should match): predicted at 200 mm: −5700 + 49 × 200 = −5700 + 9800 = 4,100 g. Residual: 4,300 − 4,100 = +200 g — the penguin is 200 g heavier than predicted; the point sits above the line. ✓
Dataset facts (verified against the linked CSV): 8 columns with headers exactly species, island, bill_length_mm, bill_depth_mm, flipper_length_mm, body_mass_g, sex, year; 344 data rows; 2 rows have NA for all four measurements (data rows 4 and 272), leaving n = 342 complete (flipper, mass) pairs; observed flipper range 172–231 mm; heaviest body mass 6,300 g; first data row is an Adélie from Torgersen Island (flipper 181 mm, mass 3750 g).
Table 1 reference values (full data, n = 342 pairs):
| Quantity | Verified value |
|---|---|
=COUNTA rows |
344 (fixed) |
| Rows with no measurements | 2 |
| r | 0.871 (students will see ≈ 0.87) |
| Slope b | 49.69 g per mm (49.686) |
| Intercept a | −5,780.83 g (accept ≈ −5,781) |
| r² | 0.759 (≈ 76%; chart R² should match) |
Table 2 reference values: predicted at 200 mm = −5780.83 + 49.686 × 200 ≈ 4,156 g. Residual: depends on which 200 mm penguin the student picked — masses at 200 mm vary, so re-do their subtraction from their own two numbers; the arithmetic is what's graded. Predicted at 300 mm ≈ 9,125 g — a nine-kilogram penguin, far beyond the heaviest real bird (6,300 g). Observed flipper range: 172–231 mm. Verdict: No — 300 mm is far outside the fitted range; extrapolation.
Fallback table reference values (if used): slope ≈ 38.18 g/mm, intercept ≈ −3,561.82 g, r ≈ 0.980, r² ≈ 0.960; predicted at 200 mm ≈ 4,074 g. Same grading standard: method and interpretation, not decimals.
Part 5 expected answers:
1. "Each additional millimeter of flipper length predicts, on average, about 49.7 g more body mass." All four parts required (per mm · predicts · on average · grams); dock the sentence, not the point total, for a first offense — but "causes" is a real error.
2. Refuse. x = 0 mm sits absurdly far below the observed range (172–231 mm); the intercept ≈ −5,781 g is a mathematical anchor for the line, not a claim about flipperless penguins. Full credit requires pointing at the data range, not just "it's negative so it's wrong."
3. Not a mistake. A residual is actual − predicted — the individual scatter around the average pattern. Under any honest model, individuals miss the line in both directions; r² ≈ 0.76 says about a quarter of mass variation is not explained by flipper length. (Connecting to Week 1's "two honest samples differ" instinct earns warmth, not extra points.)
4. Extrapolation. Beyond "no data out there": the pattern itself can change outside the observed range — growth doesn't scale linearly forever, and no real penguin morphology extends the 172–231 mm line to 300 mm. Any answer naming extrapolation + pattern-change (or an impossibility argument citing the 6,300 g maximum) earns full credit.
5. (a) Honest small differences: how NA rows were handled or a slightly different selection range; gross-error catches: chart R² vs. =RSQ mismatch, a slope with impossible units/sign, or swapped =SLOPE arguments (swapping y and x gives ≈ 0.0153 mm per g — a tiny slope is the tell). (b) The t-test for the slope, H₀: β = 0 ("the flat line — flipper length tells you nothing about mass"), t = b ⁄ SE(b), df = n − 2 = 340, t* technology-supplied. Naming the procedure + H₀ earns the points; running it is not asked.
AI-critique full credit: names a specific claim checked or corrected — most commonly the chatbot answering the 300 mm bait with a confident ~9,000 g figure, calling r² "the correlation," interpreting the intercept literally, or using causal language — OR documents verification of each claim. Zero credit for "the AI agreed with everything" with no evidence of checking.
Grading rubric — 50 points
The rubric below maps each part to its points; bands are full / partial / none.
| Criterion | Full | Partial | None |
|---|---|---|---|
| Warm-up + import — warm-up prediction 4,100 g and residual +200 g; 344 rows and the 2 NA rows found (5) | 5 | 3 | 0–1 |
| The fit — r, slope, intercept, r² computed with correct ranges (y first); scatterplot with trendline made; chart R² cross-checked (15) | 15 | 8–12 | 0–6 |
| Prediction & limits — predictions at 200 and 300 computed from their own line; residual computed correctly from their own numbers; extrapolation verdict with the observed range cited (10) | 10 | 5–8 | 0–4 |
| Analysis questions — Q1–Q5 hit the expected ideas, especially the four-part slope sentence, the intercept refusal, and the extrapolation reasoning (15) | 15 | 8–12 | 0–6 |
| AI-critique — specific catch or verification reported in 2–3 sentences (5) | 5 | 3 | 0–2 |
Quality gate (self-checked): warm-up arithmetic re-verified (−5700 + 9800 = 4,100; 4,300 − 4,100 = +200); dataset links live and free (documentation page + raw CSV both load without login); column names, row count, NA positions, flipper range, and all regression reference values verified against the fetched CSV and re-derived in tools/checks/w17_math.py; fallback-table values script-verified; no numeric claim in the key depends on an unverified dataset-wide value; no graded-item leakage (no quiz/assignment/practice item uses the penguins data); rubric sums 5 + 15 + 10 + 15 + 5 = 50. ✓