Skip to content
Omnikalc

Sequential probability ratio test (SPRT) calculator

Enter the acceptable and unacceptable defect rates and the risks of the two kinds of error to get the accept and reject lines of Wald’s sequential test, the average sample number and the saving against a fixed sample.

Updated on
Your inputs
%

Value out of range

%

Value out of range

%

Value out of range

%

Value out of range

Results

Accept line intercept

-3.013

Reject line intercept

3.868

Common slope of the two lines
0.07236
Average sample number at the acceptable rate
119.4
Average sample number at the unacceptable rate
115.0
Fixed sample size for the same risks
221
Saving at the acceptable rate
46.0 %
Large saving: sequential sampling pays off
Fewest units to accept (no defects)
42
Fewest units to reject (all defective)
5

The SPRT calculator gives the accept and reject lines of Wald’s sequential test for a defect rate, the average sample number and the saving against a fixed-size plan.

How the calculation works

  • Enter the acceptable and unacceptable defect rates.
  • Enter the risks alpha and beta.
  • The calculator gives the two intercepts, the slope, the average sample numbers, the fixed-plan size, the saving and the minimum counts.

Example

The acceptable rate is 5 %, the unacceptable one 10 %, alpha is 5 % and beta 10 %. The lines are d = -3.013 + 0.07236 × n to accept and d = 3.868 + 0.07236 × n to reject. At the acceptable rate, the test needs 119.4 units on average, against 221 for a fixed plan, a saving of 46.0 %. A lot with no defect can be accepted after 42 units.

Why it matters

The calculator helps quality engineers who design inspection plans, clinical researchers who plan sequential trials, auditors, and students of statistics.

Good to know

The lines are drawn for a binomial defect count and assume independent units. The real number of units needed varies from run to run, and a few lots will need many more than the average. It is wise to set a maximum, a truncation, at about three times the fixed-plan size. In clinical research, a sequential design must be planned before the study, with proper adjustment for repeated looks at the data. The saving is largest when the true rate is clearly good or clearly bad, and smallest when it falls between the two rates. The fixed plan size shown uses a normal approximation.

The acceptance sampling calculator evaluates fixed plans, the statistical power calculator links risk and sample size, the binomial calculator gives defect probabilities and the A/B test calculator compares two rates.

Frequently asked questions

What is the SPRT?

Wald’s sequential probability ratio test examines units one at a time and, after each, decides to accept, reject or continue. The decision uses the likelihood ratio between two rates. On average, it needs far fewer units than a fixed-size plan for the same error risks.

How do I read the two lines?

After n units, count the defects d. If d is at or below h0 + s × n, accept. If d is at or above h1 + s × n, reject. In between, keep sampling. The intercept h0 is negative, so acceptance needs enough clean units first.

What are alpha and beta?

Alpha is the risk of rejecting a lot whose defect rate is the acceptable one. Beta is the risk of accepting a lot whose rate is the unacceptable one. Smaller risks or closer rates push the lines apart and raise the average sample number.

Was this calculator helpful?

Thanks for your feedback!

Results are estimates provided for information purposes. They do not replace professional advice.