T-Test Calculator

T-Test Calculator

Compute the t‑statistic and p‑value for a one‑sample t-test using: $$ t = \frac{\bar{x} – \mu_0}{SD/\sqrt{n}}. $$

* Enter the sample mean (\(\bar{x}\)), hypothesized mean (\(\mu_0\)), sample standard deviation (SD), sample size (\(n\)), and select one‑tailed or two‑tailed test.

Step 1: Enter Test Data

e.g., 100

e.g., 95

e.g., 10

e.g., 30

Select whether the test is one-tailed or two-tailed.

How It Works

1. The T‑score is computed using: $$ t = \frac{\bar{x} – \mu_0}{SD/\sqrt{n}}, $$ where \(\bar{x}\) is the sample mean, \(\mu_0\) is the hypothesized mean, SD is the sample standard deviation, and \( n \) is the sample size.

2. The degrees of freedom for the test are \( n – 1 \).

3. The p‑value is calculated from the t‑distribution. For a two‑tailed test: $$ p = 2\Bigl[1 – F(|t|; n-1)\Bigr], $$ and for a one‑tailed test: $$ p = \begin{cases}1 – F(t; n-1), & t \ge 0,\\ F(t; n-1), & t < 0,\end{cases} $$ where \( F(t; n-1) \) is the cumulative distribution function (CDF) of the t‑distribution.

The calculator uses an approximate method to compute the t‑distribution CDF.

Formulas: \( t = \frac{\bar{x} – \mu_0}{SD/\sqrt{n}} \) and p‑value derived from the t‑distribution with \( n-1 \) degrees of freedom.

Related Calculators