1-Sample t Test (one-sample t-test)

The most common test for checking whether the mean of your measurements differs from a specification target or reference value. The population standard deviation does not need to be known; the results table and 5 charts (confidence interval, dot plot, box plot, histogram, QQ plot) show the conclusion together with the shape of the data.

1Data Table

Paste a table copied from Excel into a cell (Ctrl+V). Click a column header (A, B…) before pasting to use the first line as column names. Double-click a header to rename it, right-click to insert/delete rows and columns, and formulas such as =A1*2 work too.

21-Sample t Test Options

How to run a 1-sample t test

  1. Copy the measurement column to test together with the header.
  2. Select the measurement column and enter the target as the reference mean (μ0). If only one direction matters, change the alternative hypothesis to 'Mean is greater' or 'Mean is less'.
  3. Press Analyze and check the results table as well as the normality judgment on the QQ plot.

Worked example with sample data

The sample data are 20 coating thickness measurements from a painting process (46.1 to 52.5 μm), with a target thickness of 50 μm (loading the sample fills in μ0=50).

Mean and 95% confidence interval chart from the 1-sample t test of 20 coating thicknesses (reference 50)
Mean and 95% confidence interval chart from the 1-sample t test of 20 coating thicknesses (reference 50)

The mean is 49.43 μm, 0.57 μm thinner than the target. The standard error from the standard deviation of 1.468 is 0.3282, so t = -0.57 / 0.3282 = -1.737 (19 degrees of freedom), and the two-sided p-value of 0.09858 is above 0.05, giving 'Not significant (retain H0)'.

The 95% confidence interval in the result chart, 48.74 to 50.12 μm, contains the reference line at 50, so these data alone do not show that the thickness differs from the target. The interval reaches further below the target than above it, though, so more data could change the conclusion.

The Anderson-Darling judgment on the QQ plot is A²=0.3184, p=0.5113, so the normality assumption is reasonable. The dot plot and box plot flag the two extremes, 46.1 and 52.5, as IQR outliers - check that they are not measurement mistakes.

How it is calculated

t = (sample mean - μ0) / (s/√n) and the p-value comes from the t distribution with n-1 degrees of freedom (the same calculation as SciPy's ttest_1samp). The confidence interval is the sample mean ± t(1-α/2, n-1)·s/√n; at least 2 valid values are needed.

Checking normality

The t test assumes the data are close to a normal distribution. The QQ plot panel includes the Anderson-Darling normality judgment, so read the result with care if the points stray far from the line or p is below 0.05.

Box plot and dot plot

The box plot draws the reference value as a red dashed line, so you can see at a glance where the box sits relative to it. The dot plot stacks each value as a dot, which makes the distribution easy to see with small samples.

How to read the t test result

  • 'Significant (reject H0)' means the mean is statistically different from the reference. Check how different with the 'Mean difference' column.
  • If the reference lies inside the confidence interval, the result is not significant. A wide interval means more data are needed for a conclusion.
  • Even a statistically significant difference may not matter in practice if it is tiny compared with the specification tolerance.

Frequently asked questions

Can I do a 1-sample t test in Excel?

Excel's T.TEST compares two ranges, so a 1-sample test needs a hand-made formula. Here you just pick the column and enter the target.

What if the data are not normal?

With a small, strongly skewed sample, the nonparametric 1-sample Wilcoxon test is safer. It is available in the Nonparametric Tests menu of Statistics.

Why are the degrees of freedom n-1?

Because the sample mean is estimated once when computing the sample standard deviation, leaving n-1 values free to vary.

Other chart tools