Flags, validity and who is counted
Q8 · 10 points
An IQR flag describes unusualness, while the dictionary and source establish different evidence. Deleting verified older students changes the population behind a rate.
Week 3: unusual values, PDF pp. 40–44
Your task
Compare age 220 with the verified older age, then interpret the separate withdrawal example before and after excluding older students.
Evidence to include
Use review limits and verification, then quote both withdrawal rates with their counts and denominators.
Notebook questions and code
Read here; run in your downloaded notebook. Start with its setup cells and run in order. Use your own ID and outputs where requested.
Download Lab 3 notebook5 · Flagged does not mean wrong
The code computes an IQR review rule for you. You only need to use the output: a flag marks a value worth investigating; it is not an instruction to delete.
This review table uses the original 12 students, before correcting the invalid age. The dictionary and source evidence remain essential.
Python · cell 22 — read here, run in your notebook
ages = pd.to_numeric(base.age)
q1, q3 = ages.quantile([0.25,0.75])
low, high = q1-1.5*(q3-q1), q3+1.5*(q3-q1)
review = pd.DataFrame({"student_id":base.student_id, "age":ages,
"flagged_for_review": (ages<low)|(ages>high)})
print("Computed review limits:", round(low,2), "to", round(high,2), "years")
display(review[review.flagged_for_review])
# A separate fully verified cohort illustrates the consequences of deleting older students.
older_n = int(rng.integers(4,8))
older_withdrawals = older_n-1
other_n, other_withdrawals = 100-older_n, 6
impact = pd.DataFrame({"population":["All enrolled students","After excluding verified older students"],
"students":[100,other_n], "withdrawals":[older_withdrawals+other_withdrawals,other_withdrawals]})
impact["withdrawal_percent"] = 100*impact.withdrawals/impact.students
display(impact.round(2))Your explanation
Q8 · Same flag, different actions (10 points).
- Compare age 220 and your verified older age. Use the output and source evidence to justify different actions.
- Does an age inside the review limits guarantee accuracy? Give a plausible recording error that could pass.
- Quote the two withdrawal rates and their denominators. Did deleting valid older students improve the underlying outcome, or change who was counted?
- If the intended population is all enrolled students, which rate should lead your report? What useful comparison could you still show?
Write here: …
Saved only in this browser. This note doesn’t fill in the downloaded notebook; “reviewed” is a personal checklist, not a grade.