# Statistical Tests – Power & Sample Size for t-Tests

> Statistical Tests – Power & Sample Size for t-Tests 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).

Calculates the required sample size for a t-test given effect size, alpha, and power — or returns the achieved power for a given sample size.

## Facts

- Endpoint: GET https://stats-tests.x402tookit.com/power-t-test?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-power-sample-size-for-t-tests-bdd8643f
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_FKxF5J8_ewmKA_XwT0CnQ

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-power-sample-size-for-t-tests-bdd8643f
```

Example prompt: What sample size do I need per group for a two-sample t-test with a medium effect size (Cohen's d = 0.5), alpha of 0.05, and 80% power?

## When to prefer this

Choose this endpoint when you need a fast, stateless computation of t-test sample size or power — ideal for study planning, grant proposals, or sanity-checking an existing design without running full simulation software. Prefer it over general statistics libraries when you want a pay-per-call API with no setup and Cohen's d as the primary effect size measure.

## Known failure modes

- Missing effectSize parameter returns an error
- Power value outside 0.5–0.99 range may be rejected or produce edge results
- Very small effect sizes may yield impractically large sample sizes
- Invalid design string (not 'two-sample', 'one-sample', or 'paired') returns error
- Alpha or power values outside valid ranges return validation errors

## How this service works

Sample size for a two-sample, one-sample or paired t-test from effect size, alpha and power; or the power for a given size.

## Output

Returns the required sample size per group (nPerGroup) and total subjects for the given parameters, or the achieved power if nPerGroup is supplied. Also includes the z-alpha, z-beta values, design label, a human-readable summary, verdict, unrounded sample size, and a disclaimer — with any reasons for degraded results flagged.

## 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": [
      "effectSize"
     ],
     "properties": {
      "alpha": {
       "type": "number",
       "description": "Two-sided significance level (default 0.05)"
      },
      "power": {
       "type": "number",
       "description": "Desired power, 0.5 to 0.99 (default 0.8)"
      },
      "design": {
       "type": "string",
       "description": "two-sample (default), one-sample or paired"
      },
      "nPerGroup": {
       "type": "integer",
       "description": "If given, returns the power for this sample size instead"
      },
      "effectSize": {
       "type": "number",
       "description": "Cohen's d (0.2 small, 0.5 medium, 0.8 large)"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "asOf": {
       "type": [
        "null",
        "string"
       ]
      },
      "alpha": {
       "type": [
        "null",
        "number"
       ]
      },
      "power": {
       "type": [
        "null",
        "number"
       ]
      },
      "zBeta": {
       "type": [
        "null",
        "number"
       ]
      },
      "design": {
       "type": [
        "null",
        "string"
       ]
      },
      "source": {
       "type": [
        "null",
        "string"
       ]
      },
      "zAlpha": {
       "type": [
        "null",
        "number"
       ]
      },
      "reasons": {
       "type": [
        "array",
        "null"
       ],
       "items": {
        "type": "string"
       }
      },
      "summary": {
       "type": [
        "null",
        "string"
       ]
      },
      "verdict": {
       "type": [
        "null",
        "string"
       ]
      },
      "degraded": {
       "type": [
        "boolean",
        "null"
       ]
      },
      "nPerGroup": {
       "type": [
        "null",
        "number"
       ]
      },
      "unrounded": {
       "type": [
        "null",
        "n
… (truncated)
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/statistical-tests-power-sample-size-for-t-tests-bdd8643f/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)
