Catalog/stat-ci-diff-proportions

Statistics

CI: difference of proportions API

Computes a Wald confidence interval for the difference between two independent proportions, returning the interval, z, standard error and margin of error. Answers 'What is the CI for the difference between two rates?', 'Is the lift between two proportions significant?'.

Price$0.04per request
MethodPOST
Route/v1/stats/ci-diff-proportions
StatusLive
MIME typeapplication/json
Rate limit120/minute
Cache0s public
statisticsconfidence-intervaldifference-of-proportionswaldtwo-sampleinferenceconversionab-test
API URLhttps://x402.hexl.dev/v1/stats/ci-diff-proportions
Integration docs
Example request
{
  "successes1": 120,
  "n1": 200,
  "successes2": 90,
  "n2": 200
}
Example response
{
  "proportion1": 0.6,
  "proportion2": 0.45,
  "difference": 0.15,
  "confidence": 0.95,
  "z": 1.96,
  "standardError": 0.049371,
  "marginOfError": 0.096765,
  "lower": 0.053235,
  "upper": 0.246765,
  "method": "Wald",
  "rating": "excludes zero (significant)",
  "interpretation": "95% CI for (p1 - p2): [0.0532, 0.2468]."
}
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
      ]
    },
    "confidence": {
      "type": "number",
      "examples": [
        0.95
      ]
    }
  }
}
Output schema
{
  "type": "object",
  "additionalProperties": true
}