T-Statistic Calculator Formula

Understand the math behind the t-statistic calculator. Each variable explained with a worked example.

Formulas Used

T-Statistic

t_stat = (x_bar - mu) / se

Standard Error

standard_error = se

Degrees of Freedom

df = n - 1

|t|

abs_t = abs((x_bar - mu) / se)

Variables

VariableDescriptionDefault
x_barSample Mean52
muHypothesized Mean (mu)50
sSample Standard Deviation5
nSample Size25
seDerived value= s / sqrt(n)calculated

How It Works

How to Calculate the T-Statistic

Formula

t = (x_bar - mu) / (s / sqrt(n))

The t-statistic measures how many standard errors the sample mean is from the hypothesized population mean. It follows a t-distribution with n-1 degrees of freedom. Use the t-test instead of the z-test when the population standard deviation is unknown and estimated by the sample SD.

Worked Example

Sample mean = 52, hypothesized mean = 50, sample SD = 5, n = 25.

x_bar = 52mu = 50s = 5n = 25
  1. 01SE = 5 / sqrt(25) = 5 / 5 = 1
  2. 02t = (52 - 50) / 1 = 2
  3. 03df = 25 - 1 = 24
  4. 04Compare t = 2 to the t-distribution with 24 df
  5. 05Critical value at alpha=0.05 (two-tailed): approximately 2.064
  6. 06Since |t| = 2 < 2.064, the result is not quite significant at 5% (two-tailed).

Ready to run the numbers?

Open T-Statistic Calculator