---
title: "Calculate the p-value for a z-score or t-statistic. Supports one-tailed (left or right) and two-tailed hypothesis tests using either the standard normal distribution or the Student's t-distribution when degrees of freedom are specified. Returns significance flags at the 0.01, 0.05, and 0.10 alpha levels. Essential for interpreting results from t-tests, z-tests, ANOVA post-hoc comparisons, and regression coefficients. Uses the Abramowitz & Stegun normal CDF approximation and regularized incomplete beta function for the t-distribution."
method: POST
path: "/api/p_value"
tags: ["general"]
---

# Calculate the p-value for a z-score or t-statistic. Supports one-tailed (left or right) and two-tailed hypothesis tests using either the standard normal distribution or the Student's t-distribution when degrees of freedom are specified. Returns significance flags at the 0.01, 0.05, and 0.10 alpha levels. Essential for interpreting results from t-tests, z-tests, ANOVA post-hoc comparisons, and regression coefficients. Uses the Abramowitz & Stegun normal CDF approximation and regularized incomplete beta function for the t-distribution.

`POST /api/p_value`

## Request

- Base URL: `https://calc.engineer`
- URL: `https://calc.engineer/api/p_value`
- Auth: none declared

## Request body

- object
  - `test_statistic` number, required: The z-score or t-statistic from your hypothesis test. Positive values indicate the observed value is above the null hypothesis mean.
  - `test_type` 'one_tail_left' | 'one_tail_right' | 'two_tail': Tail type: one_tail_left (p from left), one_tail_right (p from right), or two_tail (both tails combined).
  - `degrees_of_freedom` number: Degrees of freedom for the t-distribution. Omit to use the standard normal (z) distribution.

## Response `200`

Computed result for p_value

- object
  - `result` object, required
    - `p_value` number, required: The computed p-value representing the probability of observing a result at least as extreme as the test statistic under the null hypothesis.
    - `significant_at_01` boolean, required: Whether the result is statistically significant at the 0.01 (1%) level.
    - `significant_at_05` boolean, required: Whether the result is statistically significant at the 0.05 (5%) level.
    - `significant_at_10` boolean, required: Whether the result is statistically significant at the 0.10 (10%) level.
    - `test_type` 'one_tail_left' | 'one_tail_right' | 'two_tail', required: The tail type used for this calculation.
  - `tool` string, required
  - `version` string, required
  - `computed_at` string, date-time, required
  - `chain` object, required
    - `feeds` unknown[]
      - unknown
    - `accepts_from` unknown[]
      - unknown

## Other responses

- `400`: Validation error or invalid JSON
- `404`: Tool not found

---

[API](https://skmtc.dev/calc/apis/calc-engineer-api.md) · [All operations](https://skmtc.dev/calc/apis/calc-engineer-api/llms.txt) · [OpenAPI document](https://skmtc.dev/calc/apis/calc-engineer-api/revisions/8830480ec488?raw)
