Português

Binomial test and one-proportion Z-test

Proportions (counts) · One sample · reference distribution: Binomial or N(0, 1)

When to use it

Compare the proportion in a sample with a reference value, such as a pass rate against 50%.

Null hypothesis

The population proportion is p₀.

Assumptions

Test statistic

z = \dfrac{\hat{p} - p_0}{\sqrt{p_0(1 - p_0)/n}}

Effect size

Cohen’s h: the difference between the proportions on the arcsine scale. Benchmarks: 0.2, 0.5 and 0.8.

h = 2\arcsin\sqrt{\hat{p}} - 2\arcsin\sqrt{p_0}

How to report it

62 of 100 (62%), binomial test against 50%, p = .021, h = 0.24

In R and Python

R
binom.test(62, 100, p = 0.5)  # exact; prop.test() does the Z-test
Python
stats.binomtest(62, 100, p=0.5)

In Python, stats is scipy.stats and np is numpy.

Variants and alternatives

Where it sits in the catalog

Proportions (counts). For categorical answers, such as yes or no, hit or miss: the data are how often each category appears, and the test compares proportions.

One sample. A single group compared with a reference value set in advance, such as a target or a standard.

In the decision tree

  1. What do you want to do? Compare groups, or one group with a reference value
  2. What kind of response did you measure? Categorical: yes or no, or categories
  3. How many groups or measurements? One group, against a reference proportion

Open the decision tree