1-Proportion Test (defect or pass rate)

Test whether the proportion of counted data such as defects/inspected ('x out of n') differs from a target proportion. Rows from several lots are summed, and the result is shown as a results table, the proportion with its confidence interval and a composition bar chart.

1Data Table

Paste a table copied from Excel into a cell (Ctrl+V). Click a column header (A, B…) before pasting to use the first line as column names. Double-click a header to rename it, right-click to insert/delete rows and columns, and formulas such as =A1*2 work too.

21-Proportion Test Options

Data input
Test method

How to run a 1-proportion test

  1. Copy the event count column (e.g. defects) and the total count column (e.g. inspected) together with the header. If you only know the totals, choose 'Enter directly'.
  2. Set the event count and total count columns and enter the target as the reference proportion (p0) in decimal form (0.02 for 2%).
  3. Press Analyze and check the sample proportion, p-value, confidence interval and interpretation.

Worked example with sample data

The sample data are defect counts from 10 lots (L01 to L10) with 200 items inspected per lot (2 to 8 defects per lot). Using the defects column as events and the inspected column as totals sums all rows to 61 defects out of 2000; the target defect rate is 2% (p0=0.02).

Sample vs reference proportion (2%) chart from the 1-proportion test of 10 lots
Sample vs reference proportion (2%) chart from the 1-proportion test of 10 lots

The sample defect rate is 61/2000 = 3.05%, 1.05 percentage points above the target. The two-sided p-value of the exact binomial test is 0.001737, below 0.05, so the defect rate differs from (is higher than) the target.

The Wilson 95% confidence interval, 2.382% to 3.898%, does not contain 2%. In the result chart, the whole confidence interval bar also lies above the dashed reference line (2%).

Testing the same data with the normal approximation gives a p-value of 0.0007962, less than half the exact value. Small proportions such as defect rates make the binomial distribution skewed and the normal approximation inaccurate, so the default exact binomial test is the safer choice.

Test methods

The exact binomial test (default) calculates the p-value directly from the binomial distribution, so it stays exact for small samples or proportions near 0 or 1 (same as SciPy's binomtest). The normal approximation uses Z = (p̂ - p0)/√(p0(1-p0)/n).

Confidence interval and summing

The confidence interval uses the Wilson method and never leaves the 0-1 range. In column mode only rows where both columns are numbers are summed, and an error is shown if any row has more events than its total.

How to read the proportion test result

  • A p-value below the significance level means the true proportion differs from the target. For a defect rate, check whether the sample proportion is above or below the reference.
  • The composition bar chart splits events and non-events into 100% and overlays the reference proportion as a dashed line.
  • For small proportions such as defect rates the normal approximation can be inaccurate, so the default exact binomial test is recommended.

Frequently asked questions

How do I show the defect rate is below the target?

Choose 'p < reference proportion' as the alternative hypothesis to test, one-sided, whether there is evidence that the defect rate is below the target.

Can I do this in Excel?

In Excel you would have to add up tail probabilities with BINOM.DIST yourself. Here the two-sided exact p-value is calculated directly.

Which confidence interval is used?

The Wilson score interval. With a one-sided test it becomes a one-sided interval with one end at 0 or 1.

Other chart tools