# Statistical Tests – Effect Size from 2×2 Table

> Statistical Tests – Effect Size from 2×2 Table is a paid API for AI agents from stats-tests.x402tookit.com, paid per call via x402, $0.02/call, status unknown (last checked 2026-10-21).

Computes odds ratio, relative risk, risk difference, and number needed to treat with confidence intervals from a 2×2 contingency table of exposed/unexposed event counts.

## Facts

- Endpoint: GET https://stats-tests.x402tookit.com/effect-size-2x2?utm_source=zero.xyz
- Price: $0.02/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-21
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/statistical-tests-effect-size-from-2-2-table-d5c88e92
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_IyZLAVQxstN1bjei1Uv0D

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability statistical-tests-effect-size-from-2-2-table-d5c88e92
```

Example prompt: Calculate the odds ratio, relative risk, risk difference, and number needed to treat for a study where 45 out of 200 exposed people had the event and 20 out of 200 unexposed people had the event, using a 95% confidence interval.

## When to prefer this

Choose this endpoint when you have a completed 2×2 contingency table from an observational or experimental study and need all four canonical effect size measures (OR, RR, RD, NNT) with confidence intervals in a single call. Prefer this over Fisher's exact test sibling when the goal is effect size estimation rather than p-value hypothesis testing, and over chi-square when you need magnitude and direction of effect rather than just independence.

## Known failure modes

- Missing required cell counts (exposedEvents, exposedNoEvents, unexposedEvents, unexposedNoEvents) returns validation error
- Zero cell counts can cause undefined odds ratio or division-by-zero for relative risk
- Confidence level outside 0.8–0.999 range may be rejected or clamped to defaults
- Negative integer inputs will be rejected
- Very small cell counts may produce extremely wide confidence intervals that are statistically unreliable

## How this service works

Odds ratio, relative risk, risk difference and number needed to treat from a 2x2 table, each with a confidence interval.

## Output

Returns odds ratio, relative risk, risk difference, and number needed to treat, each with lower and upper confidence interval bounds. Also includes the raw risk in each group, a summary verdict, direction of effect, and optional disclaimer or data quality flags.

## Request schema (JSON Schema)

```json
{
 "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": [
      "exposedEvents",
      "exposedNoEvents",
      "unexposedEvents",
      "unexposedNoEvents"
     ],
     "properties": {
      "confidence": {
       "type": "number",
       "description": "0.8 to 0.999 (default 0.95)"
      },
      "exposedEvents": {
       "type": "integer",
       "description": "Events in the exposed (or treated) group"
      },
      "exposedNoEvents": {
       "type": "integer",
       "description": "Non-events in the exposed group"
      },
      "unexposedEvents": {
       "type": "integer",
       "description": "Events in the unexposed (or control) group"
      },
      "unexposedNoEvents": {
       "type": "integer",
       "description": "Non-events in the unexposed group"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "asOf": {
       "type": [
        "null",
        "string"
       ]
      },
      "source": {
       "type": [
        "null",
        "string"
       ]
      },
      "reasons": {
       "type": [
        "array",
        "null"
       ],
       "items": {
        "type": "string"
       }
      },
      "summary": {
       "type": [
        "null",
        "string"
       ]
      },
      "verdict": {
       "type": [
        "null",
        "string"
       ]
      },
      "degraded": {
       "type": [
        "boolean",
        "null"
       ]
      },
      "direction": {
       "type": [
        "null",
        "string"
       ]
      },
      "oddsRatio": {
       "type": [
        "null",
        "number"
       ]
      },
      "confidence": {
       "type": [
        "null",
        "number"
       ]
      },
      "disclaimer": {
       "type": [
        "null",
        "string"
       ]
      },
      "notChecked": {
       "type": [
        "array",
        "null"
       ],
       "items": {
        "type": "string"
       }
      },
      "oddsRat
… (truncated)
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/statistical-tests-effect-size-from-2-2-table-d5c88e92/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from stats-tests.x402tookit.com](https://www.zero.xyz/host/stats-tests.x402tookit.com/llms.txt)
