{"uid":"cap_9EFXv7NFUCAK0E-xlSPW1","slug":"exact-binomial-test-with-clopper-pearson-ci-ca080054","name":"Exact Binomial Test with Clopper-Pearson CI","description":"Exact binomial test of k successes in n trials vs a hypothesised probability, with p-values and the Clopper-Pearson CI.","url":"https://stats-tests.x402tookit.com/binomial-test?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method"],"properties":{"type":{"type":"string","const":"http"},"method":{"enum":["GET"],"type":"string"},"queryParams":{"type":"object","required":["successes","trials"],"properties":{"p0":{"type":"number","description":"Hypothesised success probability (default 0.5)"},"trials":{"type":"integer","description":"Number of trials n"},"successes":{"type":"integer","description":"Number of successes k"},"confidence":{"type":"number","description":"Interval level 0.8 to 0.999 (default 0.95)"}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object","properties":{"asOf":{"type":["null","string"]},"source":{"type":["null","string"]},"trials":{"type":["null","number"]},"reasons":{"type":["array","null"],"items":{"type":"string"}},"summary":{"type":["null","string"]},"verdict":{"type":["null","string"]},"degraded":{"type":["boolean","null"]},"successes":{"type":["null","number"]},"disclaimer":{"type":["null","string"]},"notChecked":{"type":["array","null"],"items":{"type":"string"}},"pValueLess":{"type":["null","number"]},"pValueGreater":{"type":["null","number"]},"clopperPearson":{"type":["null","object"],"properties":{"level":{"type":["null","number"]},"lower":{"type":["null","number"]},"upper":{"type":["null","number"]}}},"pValueTwoSided":{"type":["null","number"]},"sampleProportion":{"type":["null","number"]},"significantAt5pct":{"type":["boolean","null"]},"hypothesisedProbability":{"type":["null","number"]}}}}}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.02","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.02/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.02","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.02","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_DKdnW9UoAe4_V1forp1xU","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.02","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Performs an exact binomial test for k successes in n trials against a hypothesised probability, returning two-sided and one-sided p-values plus the Clopper-Pearson confidence interval.","exampleAgentPrompt":"Run an exact binomial test: I observed 47 successes out of 120 trials and the hypothesised success probability is 0.5 — give me the two-sided p-value and the 95% Clopper-Pearson confidence interval.","exampleUseCases":[{"title":"A/B conversion rate significance test","prompt":"I ran an A/B test and got 312 conversions out of 1,050 visitors in the treatment group. Can you do an exact binomial test against a baseline conversion rate of 0.25 and tell me if it's statistically significant at the 5% level, with a 95% confidence interval?"},{"title":"Coin or dice fairness check","prompt":"I flipped a coin 200 times and got 118 heads. Run an exact binomial test to see if the coin is significantly biased away from a 50% probability, and give me the two-sided p-value and 95% Clopper-Pearson interval."},{"title":"Manufacturing defect rate audit","prompt":"Our quality audit found 9 defective units in a batch of 150. Test whether this is significantly higher than our accepted defect probability of 0.04, using a one-sided p-value and a 99% confidence interval."}],"resultDescription":"Returns the sample proportion, two-sided p-value, one-sided p-values (less and greater), Clopper-Pearson confidence interval (lower, upper, level), a significance verdict, a plain-language summary, the echo of inputs (trials, successes, hypothesised probability), and an asOf timestamp.","failureModes":["Missing required parameters (successes or trials) returns a validation error","successes greater than trials returns an invalid input error","p0 outside [0,1] is rejected","confidence outside [0.8, 0.999] is rejected","non-integer successes or trials may be rejected"],"whenToPreferThis":"Choose this endpoint when you need an exact (not approximate) binomial test — particularly for small sample sizes where the normal approximation is unreliable, or when you need the Clopper-Pearson interval (the gold-standard conservative exact CI for a proportion). Prefer it over z-proportion tests when n*p or n*(1-p) is small, or when regulatory/scientific rigor demands an exact method.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-21T07:20:45.859Z","isFirstParty":false,"canonicalSlug":"exact-binomial-test-with-clopper-pearson-ci-ca080054"}