Calculators King

Hypothesis Tests

One Sample T-Test Calculator

A one-sample t test compares your sample mean with a hypothesized mean when the standard deviation comes from the sample itself.

Worksheet

Press Calculate to see the result.

A one-sample t test compares your sample mean with a hypothesized mean when the standard deviation comes from the sample itself.

What this calculator answers

A one-sample t test is the mean comparison you run when the population sigma is not on the shelf and the sample has to supply its own standard deviation. The page prefers a list of observations. From that list it computes the mean and the sample standard deviation with divisor n minus 1, then forms t as the gap from mu0 divided by s over the square root of n. Degrees of freedom are n minus 1. If the list is empty, the summary boxes are used instead, and the sd you type is treated as that same sample standard deviation. A known population sigma would have made this a z test.

The headline is t. Beside it are the p-value, the critical t, df, and the decision at your alpha. The sample sd is the n minus 1 version. Supporting counts and intermediate terms sit under the headline so a reader can see what was divided by what. When a checkbox or a tail setting changes the divisor or the rejection region, that choice appears in the steps rather than vanishing into a silent default.

The formula, written out

One-sample t statistic uses this relationship.

t = (mean - mu0) / (s / sqrt(n)), df = n - 1, with s using divisor n - 1

  • mean. Sample mean, from the list or the summary box.
  • s. Sample standard deviation with divisor n minus 1.
  • mu0. Null mean.
  • df. n minus 1.

Replacing the unknown sigma with the sample standard deviation makes the ratio follow a t distribution with n minus 1 degrees of freedom when the observations are normal and the null mean is right. The extra uncertainty is why the critical t sits farther out than the matching z. The algebra is the named textbook identity for this worksheet. Intermediate products and quotients appear in order so a calculator and a pencil can agree to the displayed rounding. If a neighbouring page uses a different divisor or a continuity correction, that page says so on its own ticket.

A full worked example

Example loaded in the worksheet

The loaded list is 5, 7, 8, 6, and 9, tested against mu0 of 6.

The list has 5 values and was used. The summary boxes were ignored. The sample mean is 7 and the sample standard deviation, divisor n minus 1, is 1.5811 on n equal to 5. Degrees of freedom are n minus 1, which is 4.

The standard error is s divided by the square root of n: 1.5811 divided by 2.2361 equals 0.7071. t equals (mean minus mu0) divided by that standard error: (7 minus 6) divided by 0.7071 equals 1.4142. The two-sided p-value on 4 degrees of freedom is 0.2302, and the critical t at alpha 0.05 is 2.7764.

At the 0.05 level, the result is outside the rejection region. The data are still compatible with the null hypothesis. A z test would have required a known population sigma. This run estimated the spread from the sample, so the reference curve is t with 4 degrees of freedom.

Figures from the worked example
T statistic1.4142
P-value0.2302
Critical t2.7764
Degrees of freedom4
DecisionAt the 0.05 level, the result is outside the rejection region. The data are still compatible with the null hypothesis.

A second situation

Summary boxes only: mean 20, sample sd 4, n 16, mu0 18

The data box was empty, so the summary mean 20, sd 4, and n 16 were used. The sample mean is 20 and the sample standard deviation, divisor n minus 1, is 4 on n equal to 16. Degrees of freedom are n minus 1, which is 15.

The standard error is s divided by the square root of n: 4 divided by 4 equals 1. t equals (mean minus mu0) divided by that standard error: (20 minus 18) divided by 1 equals 2. The two-sided p-value on 15 degrees of freedom is 0.0639, and the critical t at alpha 0.05 is 2.1314.

At the 0.05 level, the result is outside the rejection region. The data are still compatible with the null hypothesis. A z test would have required a known population sigma. This run estimated the spread from the sample, so the reference curve is t with 15 degrees of freedom.

Figures from the worked example
T statistic2
P-value0.0639
Critical t2.1314
Degrees of freedom15
DecisionAt the 0.05 level, the result is outside the rejection region. The data are still compatible with the null hypothesis.

Clearing the list and typing a mean, an sd, and n runs the same ratio without reprinting every observation. Changing mu0 moves t even when the data are fixed, because the gap in the numerator changed. The second example changes the feature that this formula is sensitive to, and the ticket shows the new figure beside the same definition. That contrast is the fastest way to see which input owns the movement.

What moves when the input moves

The hypothesized mean moved from 6 to 9. The five scores stayed put. The headline result went from 1.4142 to −2.8284.

The nudged inputs

The list has 5 values and was used. The summary boxes were ignored. The sample mean is 7 and the sample standard deviation, divisor n minus 1, is 1.5811 on n equal to 5. Degrees of freedom are n minus 1, which is 4.

The standard error is s divided by the square root of n: 1.5811 divided by 2.2361 equals 0.7071. t equals (mean minus mu0) divided by that standard error: (7 minus 9) divided by 0.7071 equals −2.8284. The two-sided p-value on 4 degrees of freedom is 0.0474, and the critical t at alpha 0.05 is 2.7764.

At the 0.05 level, the result is in the rejection region. The data are unlikely if the null hypothesis is the whole story. A z test would have required a known population sigma. This run estimated the spread from the sample, so the reference curve is t with 4 degrees of freedom.

Figures from the worked example
T statistic−2.8284
P-value0.0474
Critical t2.7764
Degrees of freedom4
DecisionAt the 0.05 level, the result is in the rejection region. The data are unlikely if the null hypothesis is the whole story.

How to read the result

A t inside the critical values is still compatible with mu0 at your alpha. The p-value is the tail probability beyond the t you obtained, on df equal to n minus 1. Say the unit, the sample size or contract terms, and the formula name in the same sentence as the figure. A number without those three pieces invites a later reader to invent a definition that this page never used.

Name n, df, the sample sd, mu0, and t together. A t without df cannot be checked against a table. Write the result with its unit, the inputs that produced it, and the name of the formula. If the ticket shows a decision sentence, quote the alpha and the tail with it. If the ticket shows a money or dose figure, quote the rate and the schedule that produced it.

Assumptions that have to stay true

  • The observations are independent.
  • The population is close to normal, or n is large enough that the mean is.
  • The sd is the sample standard deviation, divisor n minus 1, when you type it yourself.
  • The list, when present, is the whole analysis sample, with no silent deletion.

If an assumption above is false, do not average the discomfort away. Change the worksheet or change the question. A correct arithmetic step on the wrong model is still the wrong answer for the decision you are trying to make.

Mistakes that change the answer

  • Dividing by n when you compute the sd by hand, then typing that smaller number.
  • Calling the result a z test. Sigma was not known.
  • Using n as df. A one-sample mean keeps n minus 1.
  • Leaving a blank list and an empty summary, which is not a test.

Where a different calculator is the honest choice

The one-sample z-test calculator is the match when sigma is known. The t critical value calculator returns only the cutoff. The t-test calculator adds a chooser for paired data and an equal-variance two-sample test. Related links under the essay open pages that keep their own formulas instead of hiding a mode switch inside this ticket.

When the job changes, move to a page built for that job: T Critical Value Calculator, One Sample Z-Test Calculator, T-Test Calculator.

Check yourself

Scores 5, 7, 8, 6, and 9 are tested against mu0 of 6. What is the two-sided t statistic?

The mean is 7, the sample sd is 1.5811, and the t statistic is 1.4142 on 4 degrees of freedom.

Using the result in a sentence

A lab replicate tested against a labeled concentration, and a class section tested against a historical mean, are ordinary one-sample t questions. Paired before-and-after data belong on the paired page even though the arithmetic is a one-sample t on the differences. Keep the count, the unit, and the assumption list beside any copy of the number that leaves this browser tab.

Five observations cannot rescue a badly skewed measurement, and a large t in a huge sample can still be a trivial gap. The test says nothing about a second group. Pair the headline with the steps before you staff a route, set a grade boundary, or compare two contracts from a single number.

Questions people ask next

01What definition does the One Sample T-Test Calculator commit to?

This page uses One-sample t statistic: t = (mean - mu0) / (s / sqrt(n)), df = n - 1, with s using divisor n - 1. Replacing the unknown sigma with the sample standard deviation makes the ratio follow a t distribution with n minus 1 degrees of freedom when the observations are normal and the null mean is right. The extra uncertainty is why the critical t sits farther out than the matching z. If a textbook uses a different divisor, a different continuity correction, or a different rounding rule, the last digits can move, so the definition is printed above the result. The worksheet asks for Data, Hypothesized mean, Sample mean, Sample sd, Sample size n, Alpha, and related inputs, and it refuses a blank that the formula cannot interpret. Keep that printed definition in the sentence you write next to the figure so a later reader can rebuild the arithmetic without guessing which convention you chose.

02How should the worked example be read out loud?

In the loaded example the t statistic is 1.4142. A t inside the critical values is still compatible with mu0 at your alpha. The p-value is the tail probability beyond the t you obtained, on df equal to n minus 1. Say the unit and the count before you say whether the number is large or small. Read the steps in order rather than jumping to the headline, because the intermediate terms are where a swapped percent and proportion usually hide. If the ticket shows both a primary figure and a comparison figure, name which one you are quoting.

03What is the fastest way to get a misleading result?

Dividing by n when you compute the sd by hand, then typing that smaller number. Five observations cannot rescue a badly skewed measurement, and a large t in a huge sample can still be a trivial gap. The test says nothing about a second group. A second common failure is leaving a checkbox or tail setting in the wrong state and then treating the number as if the default had matched your plan. Reset the example, change one input, and confirm the ticket moves in the direction the formula predicts before you trust a live run.

04When should I leave this page for a different calculator?

The one-sample z-test calculator is the match when sigma is known. The t critical value calculator returns only the cutoff. The t-test calculator adds a chooser for paired data and an equal-variance two-sample test. The related links under the essay go to those worksheets, which keep their own formulas instead of hiding them in a mode switch. If the question changed from a summary to a test, from a payment to a refinance, or from a raw score to a percentile, switch pages rather than forcing this ticket to answer a job it was not built for.

05What belongs in the sentence next to the number?

The mean is 7, the sample sd is 1.5811, and the t statistic is 1.4142 on 4 degrees of freedom. Name n, df, the sample sd, mu0, and t together. A t without df cannot be checked against a table. A bare number without those three pieces cannot be audited when a score, a rate, or a lab value is challenged later. Store the inputs beside the result whenever the figure will travel into a report.