{"success":true,"version":"v1","request":{"tool":"get_calculator_schema","calculator_id":"p-value"},"result":{"entity_type":"calculator","id":"p-value","calculator_id":"p-value","canonical_url":"https://tttkmbb.com/statistics/p-value","name":"P-Value Calculator","title":"P-Value Calculator – From a z, t or Chi-Square Test Statistic (One- or Two-Tailed)","category":"statistics","category_name":"Statistics & Probability","tool_name":"calculate_p_value","featured_mcp_tool":false,"description":"Converts a test statistic into a p-value for the standard normal (z), Student t or chi-square distribution, with the chosen tails, the cumulative probability and the critical value at a given significance level.","use_when":"You already have a z, t or chi-square statistic (and its degrees of freedom) from a test or a paper and need the p-value or the critical value.","do_not_use_when":"You have the raw data and still need the statistic (use t-test, chi-square-test or proportion-z-test), or the statistic follows another distribution such as F.","inputs":[{"name":"statistic","label":"Test statistic","type":"number","required":true,"description":"Observed value of the statistic (z, t or χ²).","example":2},{"name":"distribution","label":"Distribution","type":"enum","required":false,"default":"z","values":[{"value":"z","label":"Standard normal (z)","aliases":["normal","gaussian"]},{"value":"t","label":"Student t (needs degrees_of_freedom)","aliases":["student","students_t"]},{"value":"chi_square","label":"Chi-square (needs degrees_of_freedom; upper tail only)","aliases":["chi2","chisq","chi-square","chi_squared"]}],"description":"Reference distribution of the statistic under the null hypothesis.","example":"t"},{"name":"degrees_of_freedom","label":"Degrees of freedom","type":"number","required":false,"max":10000000,"exclusive_min":0,"description":"Required for t and chi_square; ignored for z. May be fractional (Welch t-test).","example":10},{"name":"tails","label":"Tails","type":"enum","required":false,"default":"two","values":[{"value":"two","label":"Two-tailed: P(|X| ≥ |statistic|)","aliases":["two_sided","two-sided","2"]},{"value":"right","label":"Right-tailed: P(X ≥ statistic)","aliases":["upper","greater","one_sided_upper"]},{"value":"left","label":"Left-tailed: P(X ≤ statistic)","aliases":["lower","less","one_sided_lower"]}],"description":"Which tail(s) count as at least as extreme. For chi_square the p-value is always the upper tail.","example":"two"},{"name":"alpha","label":"Significance level (α)","type":"number","required":false,"default":0.05,"exclusive_min":0,"exclusive_max":1,"description":"Significance level as a probability (0.05 = 5 %), not a percentage. Confidence intervals and critical values use level 1 − alpha.","example":0.05}],"outputs":[{"name":"p_value","label":"p-value","type":"number","decimals":6,"description":"Probability, under H0, of a statistic at least as extreme as the observed one in the chosen tail(s)."},{"name":"cumulative_probability","label":"CDF at statistic","type":"number","decimals":6,"description":"P(X ≤ statistic) under the reference distribution."},{"name":"critical_value","label":"Critical value","type":"number","decimals":4,"description":"Statistic value at which p would equal alpha (two-tailed: the positive bound ±value; left-tailed: negative)."},{"name":"distribution_used","label":"Distribution used","type":"string","decimals":4,"description":"Reference distribution and degrees of freedom."},{"name":"significant","label":"Significant at alpha","type":"boolean","decimals":4,"description":"true when p_value < alpha."},{"name":"decision","label":"Decision","type":"string","decimals":4,"description":"Plain-language conclusion."}],"input_schema":{"type":"object","properties":{"statistic":{"description":"Observed value of the statistic (z, t or χ²).","type":"number","examples":[2]},"distribution":{"description":"Reference distribution of the statistic under the null hypothesis.","type":"string","enum":["z","t","chi_square"],"default":"z","examples":["t"]},"degrees_of_freedom":{"description":"Required for t and chi_square; ignored for z. May be fractional (Welch t-test).","type":"number","maximum":10000000,"exclusiveMinimum":0,"examples":[10]},"tails":{"description":"Which tail(s) count as at least as extreme. For chi_square the p-value is always the upper tail.","type":"string","enum":["two","right","left"],"default":"two","examples":["two"]},"alpha":{"description":"Significance level as a probability (0.05 = 5 %), not a percentage. Confidence intervals and critical values use level 1 − alpha.","type":"number","exclusiveMinimum":0,"exclusiveMaximum":1,"default":0.05,"examples":[0.05]}},"additionalProperties":false,"required":["statistic"]},"output_schema":{"type":"object","properties":{"p_value":{"description":"Probability, under H0, of a statistic at least as extreme as the observed one in the chosen tail(s).","type":"number"},"cumulative_probability":{"description":"P(X ≤ statistic) under the reference distribution.","type":"number"},"critical_value":{"description":"Statistic value at which p would equal alpha (two-tailed: the positive bound ±value; left-tailed: negative).","type":"number"},"distribution_used":{"description":"Reference distribution and degrees of freedom.","type":"string"},"significant":{"description":"true when p_value < alpha.","type":"boolean"},"decision":{"description":"Plain-language conclusion.","type":"string"}}},"formula":"two-tailed (z, t): p = 2 × (1 − F(|statistic|)); right: p = 1 − F(statistic); left: p = F(statistic); chi_square: p = 1 − F(statistic) where F is the CDF of the reference distribution","method":"The normal CDF uses the Abramowitz & Stegun erf approximation (error < 1.5·10⁻⁷); the t CDF uses the regularized incomplete beta function and the chi-square CDF the regularized incomplete gamma function (Numerical Recipes continued fractions). Critical values are found by bisection.","sources":[{"name":"Wikipedia – p-value","url":"https://en.wikipedia.org/wiki/P-value","type":"reference","retrieved_at":"2026-09-24"},{"name":"NIST/SEMATECH e-Handbook of Statistical Methods, 1.3.6.6.4 t Distribution","url":"https://www.itl.nist.gov/div898/handbook/eda/section3/eda3664.htm","type":"government","retrieved_at":"2026-09-24"},{"name":"NIST/SEMATECH e-Handbook of Statistical Methods, 1.3.6.6.6 Chi-Square Distribution","url":"https://www.itl.nist.gov/div898/handbook/eda/section3/eda3666.htm","type":"government","retrieved_at":"2026-09-24"}],"freshness":{"type":"static","max_age_seconds":null,"note":"Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output."},"examples":[{"name":"t = 2.0 with 10 df, two-tailed","inputs":{"statistic":2,"distribution":"t","degrees_of_freedom":10,"tails":"two"},"expected":{"p_value":0.073388,"cumulative_probability":0.963306,"critical_value":2.2281,"significant":false},"url":"https://tttkmbb.com/api/v1/calculate/p-value?statistic=2&distribution=t&degrees_of_freedom=10&tails=two"},{"name":"Chi-square = 3.84 with 1 df","inputs":{"statistic":3.84,"distribution":"chi_square","degrees_of_freedom":1},"expected":{"p_value":0.050044,"cumulative_probability":0.949956,"critical_value":3.8415,"significant":false},"url":"https://tttkmbb.com/api/v1/calculate/p-value?statistic=3.84&distribution=chi_square&degrees_of_freedom=1"}],"faq":[{"q":"One-tailed or two-tailed?","a":"Two-tailed unless the direction of the effect was specified before looking at the data. A two-tailed p is twice the one-tailed p in the observed direction."},{"q":"Why is the chi-square p-value always upper-tailed?","a":"The chi-square statistic measures total discrepancy, so only large values contradict H0; goodness-of-fit and independence tests use the upper tail."},{"q":"What does p < 0.05 mean?","a":"If H0 were true, a statistic at least this extreme would occur in fewer than 5 % of repetitions. It is not the probability that H0 is true."}],"tags":["p value","p-value from z score","p-value from t statistic","chi square p value","critical value","significance"],"related":[{"calculator_id":"t-test","reason":"Compute t and its p-value from data."},{"calculator_id":"chi-square-test","reason":"Chi-square statistic from observed counts."},{"calculator_id":"z-score","reason":"Standardise a value to obtain a z statistic."}],"links":{"html":"https://tttkmbb.com/statistics/p-value","markdown":"https://tttkmbb.com/statistics/p-value.md","json":"https://tttkmbb.com/statistics/p-value.json","api":"https://tttkmbb.com/api/v1/calculate/p-value","schema":"https://tttkmbb.com/api/v1/calculators/p-value","openapi":"https://tttkmbb.com/openapi.json","mcp":"https://tttkmbb.com/mcp"},"version":"v1","updated_at":"2026-09-24"},"timestamp":"2026-09-24T01:58:30Z","next_actions":[{"tool":"run_calculator","calculator_id":"p-value","reason":"Run P-Value Calculator with the inputs above."}],"links":{"markdown":"https://tttkmbb.com/statistics/p-value.md"}}