r/AskStatistics • • 3d ago

Checking Claude's sampling methodology

I'm validating an automated text classifier for a research write-up and want to make sure I'm reporting the uncertainty correctly.

**Setup**

- Population: 22,477 text passages (excerpts from court opinions).

- A classifier sorted every passage into three strata: "yes" (N = 7,578), "unsure" (N = 3,170), "no" (N = 11,729).

- I drew a simple random sample within each stratum (fixed seed): 20 from yes, 15 from unsure, 15 from no, and hand-labeled them blind to the stratum.

**Hand-label results (positives / sampled)**

- yes: 20 / 20

- unsure: 11 / 15

- no: 3 / 15

**What I've calculated so far**

- Per-stratum Wilson 95% intervals: yes 84–100%, unsure 48–89%, no 7–45%.

- Estimated total positives = Σ N_h · p̂_h = 7,578(1.00) + 3,170(0.733) + 11,729(0.20) ≈ 12,250.

- Naive stratified SE = sqrt(Σ N_h² p̂_h(1−p̂_h)/n_h) ≈ 1,260, so roughly 9,800–14,700.

- Recall of the "yes" stratum ≈ 7,578 / 12,250 ≈ 62%, roughly 51–78% using the endpoints above.

**Questions**

  1. Is the stratified estimator above the right approach, and is my variance formula correct (I've ignored the finite population correction since n is tiny)?

  2. The "yes" stratum came back 20/20, so its plug-in variance is zero, which seems to understate total uncertainty. What's the standard fix: Wilson/Clopper-Pearson bounds per stratum, a Bayesian beta prior, or something else?

  3. For recall I'm dividing one estimate by another. Should I use the delta method, a bootstrap within strata, or report a range from the stratum bounds like I did?

  4. The "no" stratum is the biggest and dominates the variance. If I can hand-label ~50 more passages, is it right to put most of them there (Neyman allocation), or is there a better rule?

  5. The end use is comparing rates across time periods (positives per 10,000 documents, before vs. after 2023, ratio ≈ 3.4). If the classifier's recall might differ by period, what's the cleanest way to show the ratio is robust? Right now I recompute it counting the "unsure" stratum as positive (ratio drops to 3.2) and call that a sensitivity check.

Thanks. Happy to share more detail on the sampling.

0 Upvotes

2 comments sorted by

2

u/LoaderD MSc Statistics 2d ago

No, the approach is wrong.