{"uid":"cap_VqEj4MSgsBR0kyR48M58x","slug":"paired-t-test-statistical-analysis-161309de","name":"Paired T-Test Statistical Analysis","description":"Paired t-test on before and after data: mean change, t, degrees of freedom, p-value, confidence interval and Cohen dz.","url":"https://stats-tests.x402tookit.com/paired-t-test?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"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":["before","after"],"properties":{"after":{"type":"string","description":"Second measurements, same subjects in the same order"},"alpha":{"type":"number","description":"Significance level 0.001 to 0.2 (default 0.05)"},"before":{"type":"string","description":"First measurements"}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object","properties":{"asOf":{"type":["null","string"]},"pairs":{"type":["null","number"]},"source":{"type":["null","string"]},"reasons":{"type":["array","null"],"items":{"type":"string"}},"summary":{"type":["null","string"]},"verdict":{"type":["null","string"]},"cohensDz":{"type":["null","number"]},"degraded":{"type":["boolean","null"]},"meanAfter":{"type":["null","number"]},"disclaimer":{"type":["null","string"]},"meanBefore":{"type":["null","number"]},"notChecked":{"type":["array","null"],"items":{"type":"string"}},"tStatistic":{"type":["null","number"]},"differences":{"type":["array","null"],"items":{"type":"number"}},"significant":{"type":["boolean","null"]},"sdDifferences":{"type":["null","number"]},"standardError":{"type":["null","number"]},"meanDifference":{"type":["null","number"]},"pValueTwoSided":{"type":["null","number"]},"degreesOfFreedom":{"type":["null","number"]},"confidenceInterval":{"type":["null","object"],"properties":{"level":{"type":["null","number"]},"lower":{"type":["null","number"]},"upper":{"type":["null","number"]}}}}}}}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.02","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.02/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.02","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.02","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_7DjyGZqiNU9Ug3dklZ1v1","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.02","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Runs a paired t-test on before/after measurements from the same subjects, returning mean change, t-statistic, degrees of freedom, p-value, confidence interval, and Cohen's dz effect size.","exampleAgentPrompt":"Run a paired t-test on these before measurements [120, 115, 130, 125, 118] and after measurements [112, 108, 119, 117, 110] — use a 0.05 significance level and tell me if the change is significant, what the p-value is, and what Cohen's dz is.","exampleUseCases":[{"title":"Clinical trial pre/post blood pressure","prompt":"I have blood pressure readings from 8 patients before and after a new medication: before [145, 138, 152, 160, 143, 137, 155, 148] and after [132, 125, 140, 149, 131, 128, 141, 136]. Can you run a paired t-test at alpha 0.05 and tell me if the drug significantly lowered blood pressure, including the effect size?"},{"title":"A/B test learning scores for same students","prompt":"I tested the same 10 students before and after a new training module. Scores before: [72, 65, 80, 58, 90, 74, 68, 83, 77, 61], scores after: [81, 73, 88, 66, 95, 79, 75, 89, 84, 70]. Run a paired t-test with alpha 0.01 and let me know if the improvement is statistically significant."},{"title":"Evaluating weight loss program results","prompt":"I have weight data for 6 participants before and after a 12-week program — before: [210, 185, 225, 198, 240, 172], after: [198, 176, 211, 188, 226, 165]. Do a paired t-test and give me the mean weight change, p-value, confidence interval, and Cohen's dz to assess the practical significance."}],"resultDescription":"Returns a JSON object with: mean before and after values, array of pairwise differences, mean difference, standard deviation and standard error of differences, t-statistic, degrees of freedom, two-sided p-value, confidence interval (lower, upper, level), Cohen's dz effect size, a boolean significant flag, a plain-language summary and verdict, and metadata such as number of pairs and timestamp.","failureModes":["Mismatched array lengths between before and after parameters cause an error — both must have the same number of subjects in the same order","Fewer than 2 pairs results in insufficient degrees of freedom to compute the test","Non-numeric values in the before or after strings will cause a parsing error","Alpha outside the range 0.001–0.2 is rejected as an invalid significance level","Missing required before or after query parameters returns a 400 error","Payment failure or insufficient USDC balance returns a 402 Payment Required response"],"whenToPreferThis":"Use this endpoint when you have repeated measurements on the same subjects (within-subjects or pre/post design) and want to test whether the mean change is statistically significant. It is the correct choice over a two-sample t-test when the same individuals are measured twice, as pairing controls for individual variability. It also returns Cohen's dz, making it useful when you need both significance testing and effect size in one call. Prefer this over Mann-Whitney U when data is approximately normal and you want parametric results with confidence intervals.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-21T07:20:24.951Z","isFirstParty":false,"canonicalSlug":"paired-t-test-statistical-analysis-161309de"}