# Welch T-Test (Two-Sample & One-Sample)

> Welch T-Test (Two-Sample & One-Sample) is a paid API for AI agents from math-stats.x402tookit.com, paid per call via x402, $0.02/call, status unknown (last checked 2026-10-30).

Performs a Welch two-sample or one-sample t-test, returning t statistic, degrees of freedom, p-value, confidence interval, and Cohen's d effect size.

## Facts

- Endpoint: GET https://math-stats.x402tookit.com/t-test?utm_source=zero.xyz
- Price: $0.02/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-30
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/welch-t-test-two-sample-one-sample-dd037c4c
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_n8Xsb2NoVH9p33U6cZA7T

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 welch-t-test-two-sample-one-sample-dd037c4c
```

Example prompt: Run a Welch two-sample t-test on these two groups — Group A: 23,25,28,22,27 and Group B: 30,35,33,31,29 — at the 0.05 significance level and tell me the p-value, t statistic, confidence interval, and Cohen's d.

## When to prefer this

Choose this endpoint when you need a rigorous parametric significance test comparing two independent groups (Welch t-test handles unequal variances) or testing a sample against a known population mean. It is more appropriate than a z-test when population variance is unknown or sample sizes are small, and better than a proportion z-test (see sibling endpoint) when the outcome variable is continuous. Prefer the correlation endpoint for measuring linear association rather than mean differences.

## Known failure modes

- Missing required sample A values returns an error
- Sample with fewer than 2 values causes invalid degrees of freedom
- Non-numeric values in sample strings cause parsing errors
- Alpha outside 0.001–0.2 range rejected
- Providing both b and mu simultaneously may cause ambiguous test specification
- Very small samples may produce unreliable p-values flagged via degraded or reasons fields

## How this service works

Welch two-sample or one-sample t-test: t statistic, degrees of freedom, p-value, confidence interval and Cohen's d.

## Output

Returns a JSON object with: t statistic, degrees of freedom, two-sided p-value, confidence interval (lower, upper, level), Cohen's d effect size, means of each sample, sample sizes, difference between means, standard error, a boolean 'significant' flag, a human-readable summary and verdict, and the alpha level used.

## 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": [
      "a"
     ],
     "properties": {
      "a": {
       "type": "string",
       "description": "Sample A values"
      },
      "b": {
       "type": "string",
       "description": "Sample B values (two-sample test)"
      },
      "mu": {
       "type": "number",
       "description": "Hypothesised mean for a one-sample test (use instead of b)"
      },
      "alpha": {
       "type": "number",
       "description": "Significance level 0.001 to 0.2 (default 0.05)"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "nA": {
       "type": [
        "null",
        "number"
       ]
      },
      "nB": {
       "type": [
        "null",
        "number"
       ]
      },
      "asOf": {
       "type": [
        "null",
        "string"
       ]
      },
      "test": {
       "type": [
        "null",
        "string"
       ]
      },
      "alpha": {
       "type": [
        "null",
        "number"
       ]
      },
      "meanA": {
       "type": [
        "null",
        "number"
       ]
      },
      "meanB": {
       "type": [
        "null",
        "number"
       ]
      },
      "source": {
       "type": [
        "null",
        "string"
       ]
      },
      "cohensD": {
       "type": [
        "null",
        "number"
       ]
      },
      "reasons": {
       "type": [
        "array",
        "null"
       ],
       "items": {
        "type": "string"
       }
      },
      "summary": {
       "type": [
        "null",
        "string"
       ]
      },
      "verdict": {
       "type": [
        "null",
        "string"
       ]
      },
      "degraded": {
       "type": [
        "boolean",
        "null"
       ]
      },
      "difference": {
       "type": [
        "null",
        "number"
       ]
      },
      "disclaimer": {
       "type": [
        "null",
        "string"
       ]
… (truncated)
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/welch-t-test-two-sample-one-sample-dd037c4c/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from math-stats.x402tookit.com](https://www.zero.xyz/host/math-stats.x402tookit.com/llms.txt)
