one_proportion_z_test
Test whether an observed proportion differs from a hypothesized value using a z-test, returning z-statistic, p-value, confidence interval, and assumption warnings.
Instructions
Test whether an observed proportion (successes out of n) differs from a hypothesized proportion p0 -- e.g. "is this coin fair (p0=0.5) given 55 heads in 100 flips?" Uses the normal approximation, which degrades for small n or p0 near 0 or 1; a warning is included when that assumption looks shaky. Returns the z-statistic, two-tailed p-value, a confidence interval for the true proportion, a citation, and warnings.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"successes": "<successes>",
"n": "<n>",
"p0": "<p0>"
},
"name": "one_proportion_z_test"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| n | Yes | total number of trials/observations | |
| p0 | Yes | the hypothesized true proportion to test against, in [0, 1] | |
| alpha | No | significance level for the test (and any confidence interval); default 0.05 | |
| successes | Yes | number of successes observed |