Statistics
Two-proportion z-test API
Compares two independent proportions with a pooled-variance z-test, returning z, p-value, both rates, the pooled proportion and the difference. Answers 'Are these two conversion rates significantly different?', 'What is the z-statistic comparing two proportions?'.
Price$0.04per request
MethodPOST
Route/v1/stats/two-proportion-z-test
StatusLive
MIME typeapplication/json
Rate limit120/minute
Cache0s public
statisticsproportionz-testtwo-sampleab-testp-valueinferenceconversion
API URL
Integration docshttps://x402.hexl.dev/v1/stats/two-proportion-z-testExample request
{
"successes1": 120,
"n1": 200,
"successes2": 90,
"n2": 200
}Example response
{
"z": 3.003757,
"pValue": 0.00266682,
"tail": "two",
"alpha": 0.05,
"proportion1": 0.6,
"proportion2": 0.45,
"pooledProportion": 0.525,
"difference": 0.15,
"standardError": 0.049937,
"rejectNull": true,
"rating": "significant",
"interpretation": "Two-proportion z=3.004, p=0.00267; p1=0.6 vs p2=0.45; reject H0 (equal proportions) at alpha=0.05."
}Input schema
{
"type": "object",
"required": [
"successes1",
"n1",
"successes2",
"n2"
],
"properties": {
"successes1": {
"type": "integer",
"examples": [
120
]
},
"n1": {
"type": "integer",
"examples": [
200
]
},
"successes2": {
"type": "integer",
"examples": [
90
]
},
"n2": {
"type": "integer",
"examples": [
200
]
},
"tail": {
"type": "string",
"enum": [
"two",
"left",
"right"
]
},
"alpha": {
"type": "number",
"examples": [
0.05
]
}
}
}Output schema
{
"type": "object",
"additionalProperties": true
}