p value
p_valueCalculate 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.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| test_type | No | Tail type: one_tail_left (p from left), one_tail_right (p from right), or two_tail (both tails combined). | two_tail |
| test_statistic | Yes | The z-score or t-statistic from your hypothesis test. Positive values indicate the observed value is above the null hypothesis mean. | |
| degrees_of_freedom | No | Degrees of freedom for the t-distribution. Omit to use the standard normal (z) distribution. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| p_value | Yes | The computed p-value representing the probability of observing a result at least as extreme as the test statistic under the null hypothesis. | |
| test_type | Yes | The tail type used for this calculation. | |
| significant_at_01 | Yes | Whether the result is statistically significant at the 0.01 (1%) level. | |
| significant_at_05 | Yes | Whether the result is statistically significant at the 0.05 (5%) level. | |
| significant_at_10 | Yes | Whether the result is statistically significant at the 0.10 (10%) level. |