Definition
Conditioning on valid trials means computing a statistic only over the trials that a rule marks valid, for example the attempts that completed before a deadline. Selection bias is the error that arises when that rule is related to the quantity measured: the kept trials then differ systematically from all trials, and their summary misdescribes the system. A latency averaged over completed attempts says how fast the successful attempts were, not how often attempts failed.
Where it fits
Main entry: Prospective exclusion rule (§13.15).
A prospective exclusion rule fixes in advance which runs are stopped, left out or counted as failures; conditioning on valid trials is what such a rule does to the statistics. Every statistic has a denominator, the set of trials it is computed over. A mean over completed attempts estimates the expected latency given that an attempt completed, in the sense of conditional probability §15.43, not the latency of a submitted attempt.
Selection can favor the worse system. Two systems each receive 10 attempts, and a deadline stops any attempt still running at 100 ms. System A completes all 10, 8 in 3 ms and 2 in 50 ms, a mean of ms. System B completes 8 in 3 ms and is stopped on the other 2, so its mean over completed attempts, 3 ms, makes B look about four times faster than A. B’s other 2 attempts were still unfinished at the 100 ms stop while A’s slow attempts finished at 50 ms. B therefore has worse deadline performance; the eventual completion times of its stopped attempts are unknown. A correct report gives both numbers: B completed of attempts, and those took 3 ms. When crashed runs never reach the results table, the same error is called survivorship bias §11.30.
B’s 2 stopped attempts are right-censored, known only to exceed 100 ms: recording them as 100 ms understates them, and dropping them hides them. Likewise a retry, a new attempt made after one failed, adds an observation but does not erase the failure.
Questions answered
How do you present retries honestly?
Present every retry as an additional attempt, a new attempt made after one failed, and keep the failed attempt it followed, so that no failure turns into a success on paper.
Keep one record per attempt, with its identifier, the attempt it retries, its outcome (completed, refused, timed out or interrupted) and its timing.
Report the counts of requests, attempts, failures of each kind, retries, and requests that succeeded only after a retry.
State the denominator of every statistic, and give the first-attempt success fraction and the success fraction within a stated number of retries as separate numbers. If 2 of 10 requests time out on their first attempt and both succeed on one retry, 12 attempts were made, and the two fractions are and ; “10 of 10 succeeded” alone hides both failures.
Say whether a latency is per attempt or per request; a retried request’s latency runs from the start of its first attempt to the end of its successful one.
Fix the retry rule before the experiment, as a prospective exclusion rule: which failures are retried, how often, and which attempts each statistic uses.
Apply the same rule to every system compared and show where the failures fall, because a deadline that removes slow attempts can make the slower system look faster.
Related entries: Survivorship bias (§11.30), Conditional probability (§15.43), Missing data and attrition (§11.29), Censoring (§11.28).