← Back to the Introduction to Statistics outline The Course Maker
← Introduction to Statistics outline
Week 12 · Data Lab

Week 12 Data Lab: What Share of the Penguins Are Female?

Introduction to Statistics Free sample edition

Part 1 — The Big Picture

This week you learned to build a confidence interval for a proportion: the standard error of p̂, the large-counts check, the one-proportion z interval and its interpretation, a poll's margin of error in percentage points, and how to choose a sample size. In this lab you do all of it with real data. You count the female and male penguins in the field log, build the 95% interval for the share of females, and decide whether an even split is plausible. Then you compute the poll margin-of-error ladder and chart it, plan sample sizes for a target margin, and watch 20 simulated samples each build their own interval, so you can see what 95% confident means. Finally you audit a chatbot's answers about the same data.

Time budget: Plan for about 90 minutes.

Part 2 — The Task

Guiding question: What share of the penguins in the field log are female, how precisely does the sample pin that share down, and what does it mean that an interval built this way is 95% confident?

Workshop data: palmer-station-penguins

Get the data: palmer-station-penguins landing page or the direct data file — free, no login required.

Source: Measurements of 344 penguins of three species on three islands of Antarctica's Palmer Archipelago, recorded by field researchers and republished in the palmerpenguins package.

  • Rows: 344 penguins
  • Columns: species, island, bill_length_mm, bill_depth_mm, flipper_length_mm, body_mass_g, sex, year
  • Missing values: Numeric measurement columns and sex carry missing values for a small number of penguins

Part 3 — Materials & Procedure

Tools and materials

  • Google Sheets (free) or Excel
  • The palmerpenguins CSV file
  • A document or notebook for your written answers

Ways of working

  • interpret-real-data
  • compute-and-plot
  • structured-observation

Procedure

  1. Open a blank sheet and name the first tab Penguins. In cell A1 type =IMPORTDATA("https://raw.githubusercontent.com/allisonhorst/palmerpenguins/main/inst/extdata/penguins.csv") in Google Sheets, or in Excel use Data, then From Web, and paste the same address. Check that the sex column sits in column G. Tool: Google Sheets (free) or Excel. Check: Row 1 shows the eight column names, and the penguins fill rows 2 through 345; column G holds female, male, or NA.
  2. In empty cells type =COUNTIF(G2:G345, "female") for the female count, =COUNTIF(G2:G345, "male") for the male count, and =COUNTIF(G2:G345, "NA") for the penguins with no recorded sex. Add the female and male counts to get n, the sample size. Record all four in the first table, and check that both the female and the male counts are at least 10. Tool: Google Sheets (free) or Excel. Check: The counts add up to the 344 rows of the file, and both the female and the male counts are far above 10.
  3. Divide the female count by n for p̂. Then type =SQRT(p*(1-p)/n) with your own cells in place of p and n for the standard error, =NORM.S.INV(0.975) for the critical value z*, the product of the two for the margin of error, and p̂ minus and plus the margin for the two ends. Round each value to four decimals only at the end, and record them in the first table. Tool: Google Sheets (free) or Excel. Check: The interval is a little more than a tenth wide on the proportion scale and is centered on p̂.
  4. Make a second tab named Ladder. In A2 to A6 type the sample sizes 100, 400, 1000, 1500, and 2500. In B2 type =1.96*SQRT(0.25/A2) and fill it down to B6, then in C2 type =100*B2 and fill down to show each margin in percentage points. Below the table type =ROUNDUP((1.96/0.03)^2*0.25, 0) and =ROUNDUP((1.96/0.02)^2*0.25, 0) for the sample sizes that give margins of 3 and 2 percentage points. Record everything in the second and third tables. Tool: Google Sheets (free) or Excel. Check: The margins shrink as the sample size grows, and the margin for 400 people is half the margin for 100.
  5. Select A1 to B6 on the Ladder tab and choose Insert, then Chart, then a line chart with the sample size across the bottom and the margin of error up the side. Give the chart a title and labelled axes. Tool: Google Sheets (free) or Excel. Check: A line that drops steeply between 100 and 400 people and then flattens out.
  6. Make a third tab named Sexed. In A1 type =FILTER(Penguins!G2:G345, Penguins!G2:G345<>"NA") to list only the penguins with a recorded sex; this works in Google Sheets and in current versions of Excel. Make a fourth tab named Samples. In A2 type =IF(INDEX(Sexed!$A$1:$A$333, RANDBETWEEN(1, 333))="female", 1, 0) to pick one sexed penguin at random and score 1 for female. Fill the formula across to column AN and down to row 21, so each of the 20 rows holds one random sample of 40 picks, made with replacement. Tool: Google Sheets (free) or Excel. Check: The Sexed tab lists 333 entries, and the Samples tab shows a block of 20 rows by 40 columns of ones and zeros.
  7. In AP2 type =AVERAGE(A2:AN2) for that sample's p̂, in AQ2 type =1.96*SQRT(AP2*(1-AP2)/40) for its margin of error, in AR2 and AS2 type =AP2-AQ2 and =AP2+AQ2 for its two ends, and in AT2 type =IF(AND(AR2<=0.4955, AS2>=0.4955), 1, 0) to mark whether the interval captures the whole-file share 0.4955. Fill all five down to row 21. Copy columns AP to AT and paste them back as values only, so they stop changing. Then type =SUM(AT2:AT21) and =AVERAGE(AP2:AP21). Tool: Google Sheets (free) or Excel. Check: Each of the 20 samples has its own p̂ and its own interval; most of the intervals, but usually not all, capture 0.4955.

Fallback route

When to use it: Use this route if the penguin file will not import or no spreadsheet is available.

Use the counts and the simulated samples in the model data below in place of the file. Build the 95% interval from the female and male counts with a calculator, compute the ladder and the two sample sizes with the same formulas, and sketch the ladder chart on paper. For the simulation, each of the 20 rows below is the number of females in one computer-simulated random sample of 40 picks from the 333 sexed penguins; find each sample's p̂ and 95% interval, decide whether it captures 0.4955, and fill the same five tables. Answer every analysis question and the critique step from these values, and submit the same items for equal credit.

This route earns the same credit as the primary route.

These counts from the file and 20 simulated samples of 40 sexed penguins let you complete the lab without the file or a spreadsheet.

Fallback model data
Quantity Value
Female penguins in the file 165
Male penguins in the file 168
Penguins with no recorded sex 11
Simulated sample 1: females out of 40 18
Simulated sample 2: females out of 40 16
Simulated sample 3: females out of 40 18
Simulated sample 4: females out of 40 20
Simulated sample 5: females out of 40 19
Simulated sample 6: females out of 40 21
Simulated sample 7: females out of 40 15
Simulated sample 8: females out of 40 19
Simulated sample 9: females out of 40 26
Simulated sample 10: females out of 40 17
Simulated sample 11: females out of 40 20
Simulated sample 12: females out of 40 12
Simulated sample 13: females out of 40 15
Simulated sample 14: females out of 40 20
Simulated sample 15: females out of 40 22
Simulated sample 16: females out of 40 15
Simulated sample 17: females out of 40 24
Simulated sample 18: females out of 40 18
Simulated sample 19: females out of 40 20
Simulated sample 20: females out of 40 20
Your count of simulated intervals that capture 0.4955

Part 4 — The Scaffold

Build the 95% interval for the share of female penguins from the counts in the file, step by step, so every value can be checked.

Student scaffold table 1
Quantity Your value
Female penguins
Male penguins
Penguins with no recorded sex
Sample size n (female plus male)
Sample proportion p̂ (four decimals)
Standard error √(p̂(1 − p̂) ⁄ n) (four decimals)
Critical value z* for 95%
Margin of error z* × SE (four decimals)
Lower end of the 95% interval
Upper end of the 95% interval

Compute the poll margin-of-error ladder with the conservative p̂ = 0.5, so you can see how the margin shrinks as the sample grows.

Student scaffold table 2
Sample size Margin of error (proportion) Margin of error (percentage points)
100
400
1,000
1,500
2,500

Plan two sample sizes with the conservative p̂ = 0.5, so you can see what a tighter margin costs.

Student scaffold table 3
Target 95% margin Sample size from the formula, rounded up
3 percentage points (0.03)
2 percentage points (0.02)

Record the first five of your 20 simulated samples of 40 sexed penguins, so a reader can see each sample build its own interval.

Student scaffold table 4
Sample number Females out of 40 p̂ Lower end Upper end Captures 0.4955? (yes or no)
1
2
3
4
5

Summarize all 20 simulated intervals, so you can compare the capture rate with the 95% the method promises.

Student scaffold table 5
Quantity Your value
Intervals that capture 0.4955, out of 20
Average of the 20 sample proportions

Part 5 — Analysis Questions

  1. Using your first table, write the 95% interval for the share of female penguins, then write the interpretation sentence in the course template, and say whether an even split, 0.5, is a plausible value and why.
  2. Describe your ladder chart in words: what happens to the margin of error between 100 and 400 people, and between 1,000 and 2,500 people? Use your second table to explain why four times the people halves the margin.
  3. Using your fourth and fifth tables, how many of your 20 intervals captured 0.4955? Explain what that count says about the meaning of 95% confident, and why it does not mean there is a 95% chance that one particular interval contains the true share.
  4. Using your third table, how many penguins would a field team need to sex for a margin of 3 percentage points, and for 2 percentage points? Compare each with the 333 in the file, and explain why a sample size is always rounded up.
  5. Choose one reflection and answer it in 3–5 sentences. (a) The penguins come from a field study, not a random sample, and 11 of them have no recorded sex: name one way the true share of females could differ from your interval that the margin of error would not reveal. (b) Your simulation treats the 333 sexed penguins as the whole population and draws with replacement: what can the capture count show you about the method, and what can it not tell you about penguins outside the file?

Part 6 — AI-Critique Moment

Choose one equal-credit critique route. Route A: ask an approved AI tool to critique your completed work, then check its response against your own evidence. Route B is the no-AI equivalent printed below.

Approved tools: Claude, Gemini, ChatGPT, Grok, Microsoft Copilot.

Prompt to paste:

I've pasted my completed Week 12 Data Lab tables above. In the Palmer penguins file, 165 of the 333 penguins with a recorded sex are female. Please do five things. First, compute a 95% confidence interval for the share of female penguins and tell me in one sentence what it means. Second, tell me how precise this estimate is and whether its margin of error covers every way the estimate could be wrong. Third, if I pick 3 of the sexed penguins at random, with replacement, what is the chance that exactly 2 of them are female? Fourth, the Gentoo penguins in the file are much heavier on average than the Adelie penguins, and every Gentoo was logged on Biscoe island: does living on Biscoe make a penguin heavy? Fifth, the 342 measured body masses have mean 4,201.75 g and median 4,050 g: describe their shape and name the skew.

Test the response for these likely failures:

  • Chatbots often say there is a 95% probability that the true share of females lies between 0.4418 and 0.5492, or that 95% of the penguins fall inside the interval.
  • Chatbots sometimes quote a stock news-poll margin such as plus or minus 3 percentage points, or a share they did not compute, instead of working from 165 and 333, and they often claim the margin of error covers all possible error.
  • Chatbots often multiply the chance of one arrangement and stop, reporting 0.4955² × 0.5045, about 0.1239, as the chance that exactly 2 of 3 picks are female.
  • Chatbots sometimes slide from the file to a cause, saying Biscoe's food or climate makes penguins heavy because the heavy Gentoos were all logged there.
  • Chatbots often call the body masses left-skewed, or normal, because most penguins sit in a central pile, naming the shape by the pile instead of the tail.

Write 3–5 sentences: quote one thing the chatbot got right, and quote and correct at least two errors, citing the evidence from your own tables, your chart, your simulation, or the pinned file values.

Equivalent route (no AI required)

No AI account is required for this lab. Instead of the chatbot, critique this flawed analysis, printed here in full: "From 165 of 333 penguins, the share of females is 0.4955 with the usual margin of error of plus or minus 3 percentage points, so the interval is 0.4655 to 0.5255. There is a 95% probability that the true share of females is in this interval, and the margin of error covers every way the estimate could be wrong. The chance that exactly 2 of 3 random picks are female is 0.4955² × 0.5045, about 0.1239. Gentoos are heavier and all live on Biscoe, so Biscoe makes penguins heavy. The body masses are left-skewed, because most penguins sit in the middle." Mark it up: quote each flawed sentence, name what is wrong (a stock margin in place of a computed one, a misread confidence statement, a margin claimed to cover bias, a dropped number of ways, cause read from association, or a skew named by the pile), cite the evidence from your tables, chart, simulation, or the pinned file values, and write a corrected sentence beneath it. This route assesses the same objectives (Objective 1 and Objective 6) as the chatbot critique, takes comparable effort (about 30 minutes and 200–300 words), is scored by the same scoring criteria for the same credit, and its own submission artifact is the marked-up flawed analysis, posted in place of the chatbot share link and report.

Part 7 — What to Submit

  • All five completed scaffold tables
  • Your ladder chart, or a labelled sketch of it
  • Written answers to all five analysis questions
  • The chatbot critique report with its share link, or the equivalent route's marked-up flawed analysis

Deliverable:

A short Data Lab report on the share of female penguins: five completed tables (the interval built from the file's counts; the margin-of-error ladder; two planned sample sizes; five of your simulated samples with their intervals; and the capture count with the average of your 20 sample proportions), a ladder chart or a labelled sketch of it, written answers to five analysis questions, and a critique of a chatbot's answers about the same data, or, on the equivalent route, a marked-up correction of the printed flawed analysis. Submit in any accessible file type or as a link; a recorded response may be submitted as audio or video with a transcript, or as text. Choose a written, recorded, or visual form for your answers; every form is graded by the same scoring criteria.

Rubric

The rubric below shows how each submitted part is evaluated; bands are full, partial, or none.

Workshop evaluation criteria
Criterion Full Partial None
Building the interval from the real file The female, male, and unsexed counts come from the file or the fallback model data, the large-counts check is written, and p̂, the standard error, z*, the margin, and both ends are computed correctly and rounded only at the end. The interval is built, but one value is missing, the standard error divides by the wrong count, the check is skipped, or a value is rounded too early. No interval is built, or the counts and values are invented rather than produced.
Margin ladder, chart, and sample sizes All five ladder margins appear as proportions and in percentage points, the chart has a title and labelled axes, and both planned sample sizes are computed with the formula and rounded up. The ladder is computed, but one scale, the chart's labels, or one sample size is missing, or a sample size is rounded down. No ladder, chart, or sample size appears.
Simulating intervals and counting captures 20 simulated samples of 40, or the fallback samples, each get their own p̂ and interval; the results are frozen as values; the fourth table shows five of them; and the fifth table reports the capture count and the average of the sample proportions. The simulation is run, but the intervals are not checked against 0.4955, the values were not frozen, or fewer samples were used without saying so. No simulated intervals are recorded, or the results are invented rather than produced.
Reasoning about the interval, the confidence level, and limits Analysis questions 1 to 5 are answered accurately: the interval is interpreted with the template, 0.5 is judged plausible but not proven, the capture count is read as the method's track record, the rounding-up rule is explained, and the chosen reflection option names a specific limit the margin does not cover. The questions are attempted, but one or two answers put the 95% on one interval, read a margin as a percent of the share, or give a general reflection. The reasoning questions are missing or rest on the misreadings listed above throughout.
Critique of the chatbot or of the printed flawed analysis On either route, at least two errors are quoted and corrected with evidence from the student's own tables, chart, simulation, or the pinned file values, and one correct point is acknowledged; both routes earn this band equally. On either route, errors are named but corrected without evidence, or only one error is caught. No critique appears, or pasted output is submitted without any checking.

Quality Gate

  • Every count, proportion, margin, and interval in the tables comes from your own formulas, your own samples, or the fallback model data, never from memory or a chatbot.
  • The large-counts check is written before the interval: both the female and the male counts are at least 10.
  • The interval is interpreted with the course template, and the 95% is described as the method's long-run capture rate, never as a chance for one interval.
  • Every margin is reported on one scale at a time, as a proportion or in percentage points, and every sample size is rounded up.
  • Your simulated sample results are frozen as values before you count the captures.
  • The ladder chart has a title and labelled axes.
  • No statistic, count, or source is invented anywhere in the submission.
  • The critique quotes the chatbot or the flawed analysis and corrects at least two errors with evidence from your tables, chart, simulation, or the pinned file values.

Built with The Course Maker · samples.thecoursemaker.com