In order to do a 1-sample t-test, we first need to provide our single (one) sample that we will be analysing. Below you can choose pre-uploaded data to analyse, or you can manually enter data.
What data source will you be using?
Enter data into the text box below.
Warning: You must have at least two unique values in your manually specified data.
In order to proceed, you must select some data to act as your sample.
We start by using the box model to represent our null hypothesis.
The only thing we need to do to set up the box in this test is specify the sample data (which we have already done) and specify the null hypothesis. In this test we are focusing on the mean, so the null hypothesis is that the population mean is equal to some value which we set below.
Given \(\mu \), where \(\mu \) is the population mean of the variable being analysed:
\( H_0: \) \(\mu = \)
In case you are confused about where all the values in the diagram have come from, these come from the sample data that you previously specified. In particular:
Specify what type of alternate hypothesis you will be using below:
Null Hypothesis
Alternate Hypothesis
For the hypothesis test to be valid, we need to check the following assumptions:
The first assumption is that our sample is independent and randomly chosen from the population we want to draw a conclusion about.
How do we check? We check by investigating the experimental setup. No plot or number on this
page can tell us whether this holds — it is a question about how the data was collected.
In Mr. Han's case study the assumption is satisfied: the board handed him 25 papers drawn at random from across the country, so every
student who sat the exam was equally likely to be in his pile, and one paper landing there tells us nothing about which others did. With real
data you would read the methodology section of the accompanying publication and ask exactly this question of it.
The second assumption is that the sample mean follows a normal distribution — that is, if we kept drawing fresh samples of this size from the box and recorded each sample mean, those means would form a normal curve. Note that the assumption is about the sample mean, not about the individual values.
How do we check?
Idea 1: Large n
Idea 2: QQ-plot, Boxplot and Histogram
The other route is the shape of the data itself. The central limit theorem is what rescues us when the values in the box are not
normal. If they are already normal, we do not need it at all: the sample mean is then exactly normal for any sample size. So the
closer our data looks to normal, the less we are leaning on a large n.
You might reasonably ask: if the sample mean is normal, why does this test not use a normal curve? The answer is the one difference between this test and the z-test. There, the population standard deviation \(\sigma \) was known, so the standard error was a known quantity too. Here \(\sigma \) is unknown and the sample's own standard deviation \(s \) stands in for it. That substitution is what the t-curve below exists to account for.
Step 1) Calculate Expected Value (EV) and Standard Error (SE)
Step 2) Test Statistic Calculation
One way to tell whether we reject the null hypothesis is to observe whether our p-value is below or above the significance level.
Step 1) What is your significance level?
\( \alpha = \)
Error: The value for α must be strictly between 0 and 1. Reverted to 0.05.
Step 2) Final Conclusion
A confidence interval gives us a second route to the same decision. It is built around our observed sample mean and gives a plausible range for the unknown population mean. If the null hypothesis value falls outside that range, the null value is not among the plausible ones, and we reject the null hypothesis.
Step 1) Where does the confidence level come from?
There is nothing to set here. The confidence level is not a free choice alongside \(\alpha\) — it is determined by it:
\( \text{confidence level} = 1 - \alpha \)
This matters. The confidence interval and the p-value are two ways of reading the same calculation, so they always reach the same verdict — but only when they are set up to describe the same test. That means using \(1 - \alpha\) as the level, and matching the interval to the alternate hypothesis: a two-sided interval for a two-sided test, and a one-sided interval for a one-sided test. Both are done for you below. If you change \(\alpha\) or the alternate hypothesis above, the interval here follows.
Step 2) Final Conclusion