Title: Week 16 Data Lab — Chi-Square Tests for Categorical Data
Course: Introduction to Statistics (18-Week Generic Edition)

Course: Introduction to Statistics (18-week generic edition) Objective: Objective 9 — test of independence on a real two-way table (expected counts, df, conditions, contributions) · SLO A (reason quantitatively from data) Worth 50 points · Data labs group = 15% of the grade · Data Lab 16 · Due: end of Week 16 Format: a hands-on data lab — real research data, a spreadsheet, and a full chi-square test of independence built cell by cell; then you catch the AI's mistakes when it interprets your work.

This is the course's signature weekly component. Every instructional week has a Data Lab: real, free, linked public data — nothing to buy, download from a store, or sign up for — worked in your spreadsheet, finished with an AI-critique step. Plan on 60–90 minutes.

Part 1 — The Big Picture

Way back in Data Lab 1 you met the 344 Palmer Station penguins and built your first frequency tables. In Week 4 you learned to describe a two-way table. This week those two threads finally meet the inference machine: you'll build the penguins' species × island two-way table yourself, straight from the raw data, and run a full chi-square test of independence on it.

Here's what makes today special: most textbook chi-square examples produce polite statistics like 7 or 12. The penguins will hand you a chi-square near 300 — the largest you will compute in this course — because species and island are about as far from independent as nature gets. Your job isn't just to compute it; it's to read it: which cells drive it, why four observed zeros don't break the test, and what a gigantic χ² does — and does not — let you conclude.

Part 2 — The Task

The guiding question: If species and island were unrelated, each island would host each species in proportion to its size. How far does reality drift from that — and is the drift luck, or structure?

The dataset (both links are free, no login — the same dataset from Data Lab 1): - 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 wildlife tour guide claims sightings on her route split equally across three islands. Her logbook's last 60 sightings: 26 / 18 / 16. By hand: expected counts (60 ÷ 3 = 20 each), the three contributions ((O − E)² ⁄ E), the χ² total, df, and the 5% verdict from the chapter's mini table (df = 2 → 5.991). Write your answer down — you'll check it against the key's method later.

Now the real data:

1. Import the dataset. Open the CSV link above in your browser, select all (Ctrl/Cmd-A), copy, paste into cell A1 of a blank sheet, then Data ▸ Split text to columns if needed. (Excel alternative: Data ▸ From Web, paste the CSV URL.) You should end with 8 columns and a header row: species, island, bill_length_mm, bill_depth_mm, flipper_length_mm, body_mass_g, sex, year — species is column A, island is column B.
2. Count your rows. In J1 type =COUNTA(A2:A400) — it should return 344. (Species and island have no NA gaps, so the whole 344 counts — a contrast with the body-mass work of earlier labs.) If it differs, re-import before continuing.
3. Build the observed table with =COUNTIFS. Type the three species names down K2:K4 (Adelie, Chinstrap, Gentoo) and the three island names across L1:N1 (Biscoe, Dream, Torgersen). In L2: =COUNTIFS($A$2:$A$345,$K2,$B$2:$B$345,L$1) and fill it across L2:N4. Nine formulas — your whole observed table. (A pivot table — Insert ▸ Pivot table, species as rows, island as columns, COUNTA of species as values — is an equivalent route.)
4. Add the margins and cross-check. Row totals in O2:O4 (=SUM(L2:N2) filled down); column totals in L5:N5 (=SUM(L2:L4) filled across); grand total in O5 (=SUM(O2:O4)). O5 must equal 344 — if it doesn't, a species or island name is misspelled in your COUNTIFS labels. Fix before continuing.
5. Build the expected table. In L9 (a parallel 3 × 3 block, same layout): =$O2*L$5/$O$5 filled across L9:N11 — that's (row total × column total) ⁄ grand total for every cell. Round mentally to 2 decimals when you copy them into the scaffold; leave the cells un-rounded.
6. Check the expected-count condition. Find the smallest expected cell. Is it at least 5? Note it — Part 5 asks about it.
7. Build the contribution table. In L14 (a third 3 × 3 block): =(L2-L9)^2/L9 filled across L14:N16 — each cell's (O − E)² ⁄ E.
8. Total the statistic and get the verdict. In L18: =SUM(L14:N16) — your χ². df = (3 − 1)(3 − 1) = 4; the 5% critical value from the chapter's mini table is 9.488. In L19, let technology double-check the tail: =CHISQ.DIST.RT(L18, 4) — with a statistic this size the sheet shows a p-value in scientific notation so close to zero it may display as 0.
9. Fill in the scaffold tables in Part 4, then answer Part 5.

Fallback (no import available): if you can't get the CSV into a spreadsheet, start from the observed table below (verified against the linked CSV) and do steps 4–8 with a calculator — margins, expected counts, contributions, χ², verdict. State in your submission that you used the fallback.

The fallback table gives the observed species × island counts.

Observed | Biscoe | Dream | Torgersen
Adelie | 44 | 56 | 52
Chinstrap | 0 | 68 | 0
Gentoo | 124 | 0 | 0

Part 4 — The Scaffold (complete both tables)

Table 1 captures your observed table with margins, and the two headline checks.

Quantity | Value
Rows of data (=COUNTA) | ______
Observed counts, Adelie row (Biscoe / Dream / Torgersen) | __ / _ / ___
Observed counts, Chinstrap row | __ / _ / ___
Observed counts, Gentoo row | __ / _ / ___
Row totals (Adelie / Chinstrap / Gentoo) | __ / _ / ___
Column totals (Biscoe / Dream / Torgersen) | __ / _ / ___
Grand total (must be 344) | ______

Table 2 captures the test itself.

Quantity | Value
Expected count, Adelie–Biscoe (show the formula's numbers) | ______
Smallest expected count in the table (which cell, and is it ≥ 5?) | ______
Largest two contributions (which cells, what values) | ______
χ² (the sum of all 9 contributions) | ______
df | ______
5% critical value (mini table) | ______
Verdict (reject / fail to reject) + one careful sentence | ______

Part 5 — Analysis Questions

Answer in 1–3 sentences each:

1. State the hypotheses you tested, in plain words — and explain why this calls for the test of independence rather than a goodness-of-fit test. (How many categorical variables are in play? Who supplied a "claimed" distribution?)
2. Your observed table contains four zeros, yet the test is still valid. Explain why, naming the exact condition — and the smallest expected count in your table.
3. Read your contribution table: name the two largest contributions and translate each into a plain-English sentence about penguin geography (what does each cell's observed count do relative to what independence predicted?).
4. Error hunt: name one specific way this analysis could quietly go wrong in the spreadsheet — a misspelled species name in a =COUNTIFS label, expected cells built from the wrong row/column totals, or ranges that miss row 345 — and say exactly which cross-check in the procedure would catch your chosen error.
5. The guardrail + the arc: your χ² is enormous and the association is real — yet "Biscoe causes Gentoos" (or "species choose islands at random except when they don't") would still be sloppy science. Write the careful conclusion, note who these 344 penguins are (Week 1: measured at study sites near one research station — representativeness matters), and say in one line where this tool now sits in your Weeks 11–16 toolkit as you head into the Week 17 synthesis.

Part 6 — AI-Critique Moment (required — the BYOAI step)

Now bring in your chatbot and be the analyst who checks its work.

1. Paste your completed observed table with margins (from Table 1) into your chatbot and ask: "Compute the expected counts and the chi-square statistic for a test of independence, state the degrees of freedom and the 5% critical value, and give the conclusion."
2. Check everything it says against your own spreadsheet: - Did it get df = 4? (Chatbots love df = 8 — cells minus one — for a 3 × 3 table.) - Did its expected counts match yours? Recompute one by hand ((row × column) ⁄ 344) — mis-multiplied expected tables and mis-added margins are the classic failures. - Did it quote the critical value from memory? Spot-check against the chapter's mini table (df 4 → 9.488). - Did it claim the observed zeros are a problem? (They aren't — the ≥ 5 condition is about expected counts, and your smallest expected cell clears it.) - Did it slide into causal language ("islands determine species") — or dismiss your χ² as "too large to be right"? (Near-300 is correct here; verify against your sheet's sum.)
3. 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: the tool drafts, you judge. A chatbot will confidently botch a df, mis-multiply an expected count, or upgrade an association into a cause — catching it is the point.

Part 7 — What to Submit

One document or text entry containing: your warm-up test (all steps), your completed Table 1 and Table 2, your Part 5 answers (1–5), and your Part 6 AI-critique paragraph. Due at the end of Week 16 · 50 points (rubric below the key).

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 χ² = 2.8 with correct verdict language; 344 rows confirmed (5) | 5 | 3 | 0–1
Observed table + margins — COUNTIFS/pivot table correct (44/56/52 · 0/68/0 · 124/0/0); margins cross-checked to 344 (10) | 10 | 5–8 | 0–4
The test — expected counts by formula (one shown by hand), condition checked via smallest expected cell, contributions, χ² ≈ 299.6, df 4, verdict vs. 9.488 (15) | 15 | 8–12 | 0–6
Analysis questions — Q1–Q5 hit the expected ideas, especially the expected-vs-observed condition (Q2) and the careful conclusion (Q5) (15) | 15 | 8–12 | 0–6
AI-critique — specific catch or verification reported in 2–3 sentences (5) | 5 | 3 | 0–2