Learn by Directing AI
Unit 3

Compute the no-show rate

Step 1: What the specification asks for

Open materials/analysis-specification.md and read the section on computing the overall no-show rate. The specification asks for a single number — the no-show rate as a percentage — along with a 95% confidence interval.

That second part matters. Wanjiku does not just need "about 13%." She needs to know whether it could be 10% or 16%, because those numbers mean different things when she is deciding whether to double-book afternoon slots. A point estimate gives her a number. A confidence interval tells her how much to trust it.

Before you compute anything, open materials/verification-targets.md. Find the target for the overall no-show rate. It says the rate should be in the low teens. Keep that number in your head — it is the reference point you will check against when AI produces output.

Step 2: Compute the rate

Direct Claude to compute the overall no-show rate from the dataset. You do not need to specify the method — at this point, a straightforward calculation is what you are after. Ask for the result as a percentage.

Look at the number that comes back. Does it fall in the low teens? If it does, you are in good shape. If the number is noticeably lower — somewhere around 10% or below — something is off. The number might look perfectly reasonable. A 10% no-show rate is not an absurd result for an appointment-based business. But "reasonable-looking" and "correct" are not the same thing.

This is a pattern worth recognizing early: AI produces output that looks plausible. It comes back formatted cleanly, with no errors, no warnings, no hedging. The number sits there looking like a fact. The only way to know whether it is right is to check it against something external — in this case, the verification target you just read.

Step 3: Check the denominator

If the rate came back lower than expected, the most common cause is the denominator. Think about what goes into a no-show rate. The numerator is clear: the number of appointments where the client did not show up. But what goes in the denominator?

There are two options. One uses every record in the dataset — shows, no-shows, and cancellations. The other uses only scheduled appointments — shows and no-shows, excluding cancellations.

The difference matters. A cancellation means the client called ahead and removed themselves from the schedule. A no-show means the client simply did not appear. If you include cancellations in the denominator, you are treating cancelled appointments as if they were opportunities for a no-show. They were not. The client already told the clinic they were not coming. Including them dilutes the rate — the denominator gets bigger, but the numerator stays the same, so the percentage drops.

Both numbers look plausible. That is what makes this kind of error hard to catch without a reference point. The wrong rate is not wildly off — it is systematically lower. If you had no verification target, you would have no reason to question it.

Rate calculations in general carry this risk. Whenever you compute a rate, the denominator is a decision about which population the rate applies to. AI picks a denominator based on what is available in the data. It does not know which records are eligible and which are not — that is a judgment that depends on what the number means in the real world.

Step 4: Fix the denominator

If the rate was wrong, direct Claude to recompute using only scheduled appointments — that is, exclude records where appointment_status is "Cancelled." The denominator should be the count of shows plus no-shows.

Check the new result against the verification target. It should land in the low teens now.

If the rate was already correct in Step 2, Claude happened to exclude cancellations on its own. That is fine, but do not assume it will make the right call next time. The point of the verification target is that it works regardless — it catches errors when they happen and confirms correctness when they do not.

Step 5: Add the confidence interval

The rate is one number. Wanjiku needs to know how precise it is.

A confidence interval is a range that tells you how precise your estimate is. If the no-show rate is 13.2% with a 95% confidence interval of 12.1% to 14.3%, that means you can be fairly confident the true rate falls somewhere in that range. With around 8,000 records, the interval should be narrow — roughly plus or minus 1 to 2 percentage points.

Direct Claude to compute a 95% confidence interval for the no-show rate.

Check the result against the verification target. The interval should be tight. If it is unusually wide, something may be wrong with how the calculation was set up.

A number without a range is not finished. When Wanjiku presents to her staff, "our no-show rate is 13%" invites the question "is it really 13% or could it be 9%?" A confidence interval answers that question before it is asked. It is the difference between a guess and a finding.

✓ Check

✓ Check: The no-show rate should be in the low teens (approximately 12-15%). The confidence interval should be narrow (roughly +/- 1-2 percentage points given ~8,000 rows).