Statistics
Power & sample size API
Solves the power equation for two-means (Cohen's d) or two-proportions (Cohen's h): give n to get power, or give target power to get required n per group. Answers 'How many subjects per group do I need?', 'What is my statistical power at this sample size?'.
Price$0.08per request
MethodPOST
Route/v1/stats/power-analysis
StatusLive
MIME typeapplication/json
Rate limit120/minute
Cache0s public
statisticspowersample-sizeeffect-sizecohens-dexperiment-designplanninginference
API URL
Integration docshttps://x402.hexl.dev/v1/stats/power-analysisExample request
{
"test": "two-means",
"effectSize": 0.5,
"power": 0.8
}Example response
{
"mode": "n-from-power",
"test": "two-means",
"effectSize": 0.5,
"power": 0.8,
"alpha": 0.05,
"tail": "two",
"nPerGroup": 63,
"totalN": 126,
"zAlpha": 1.96,
"zBeta": 0.8416,
"rating": "small study",
"interpretation": "Need n=63/group (total 126) to detect effect 0.5 with 80% power at alpha=0.05."
}Input schema
{
"type": "object",
"required": [],
"properties": {
"test": {
"type": "string",
"enum": [
"two-means",
"two-proportions"
]
},
"effectSize": {
"type": "number",
"examples": [
0.5
]
},
"p1": {
"type": "number"
},
"p2": {
"type": "number"
},
"n": {
"type": "integer"
},
"power": {
"type": "number",
"examples": [
0.8
]
},
"alpha": {
"type": "number",
"examples": [
0.05
]
},
"tail": {
"type": "string",
"enum": [
"two",
"one"
]
}
}
}Output schema
{
"type": "object",
"additionalProperties": true
}