One sample t-test
The t-test is one of the most common hypothesis tests in statistics. The t-test determines either whether the sample mean and the mean of the population differ or if two sample means differ statistically. The t-test distinguishes between
The choice of which t-test to use depends on whether one or two samples are available. If two samples are available, a distinction is made between dependent and independent samples. In this tutorial you will find everything about the one-sample t-test.
Tip: Do you want to calculate the t-value? You can easily calculate it for all three t-tests online in the t-test calculator on DATAtab
The one-sample t-test is used to test whether the population differs from a fixed value. So, the question is: Are there statistically significant differences between a sample mean and the fixed value? The set value may, for example, reflect the remaining population percentage or a set quality target that is to be controlled.
Social science example:
You want to find out whether the health perception of managers in Canada differs from that of the population as a whole. For this purpose you ask 50 managers about their perception of health.
You want to find out if the screws your company produces really weigh 10 grams on average. To test this, weigh 50 screws and compare the actual weight with the weight they should have (10 grams).
A pharmaceutical company promises that its new drug lowers blood pressure by 10 mmHg in one week. You want to find out if this is correct. To do this, compare the observed reduction in blood pressure of 75 test subjects with the expected reduction of 10 mmHg.
In a one-sample t-test, the data under consideration must be from a random sample, have metric scale of measurement, and be normally distributed.
One tailed and two tailed t-test
So if you want to know whether a sample differs from the population, you have to calculate a one sample t-test. But before the t-test can be calculated, a question and the hypotheses must first be defined. This determines whether a one-tailed (directional) or a two-tailed (non-directional) t-test must be calculated.
The question helps you to define the object of investigation. In the case of the one-sample t-test the question is:
Is there a statistically significant difference between the mean value of the sample and the population?
Is the mean value of the sample significantly larger (or smaller) than the mean value of the population?
For the examples above, this gives us the following questions:
- Does the health perception of managers in Canada differ from that of the overall population in Canada?
- Does the production plant produce screws with a weight of 10 grams?
- Does the new drug lower blood pressure by 10 mmHg within one week?
In order to perform a one-sample t-test, the following hypotheses are formulated:
- Null hypothesis H0: The mean value of the population is equal to the specified value.
- Alternative hypothesis H1: The mean value of the population is not equal to the specified value.
- Null hypothesis H0: The mean value of the population is equal to or greater than (or less than) that of the specified value.
- Alternative hypothesis H1: The mean value of the population is smaller (or larger) than the specified values.
One Sample t-test equation
You can calculate the t-test either with a statistics software like DATAtab or by hand. For the calculation by hand you first need the test statistics t, which can be calculated for the one sample t-test with the equation
In order to check whether the mean sample value differs significantly from that of the population, the critical t-value must be calculated. First the number of degrees of freedom, abbreviated df, is required, which is calculated by taking the number of samples minus one.
where the standard deviation is the population standard deviation estimated using the sample.
If the number of degrees of freedom is known, the critical t-value can be determined using the table of t-values. For a sample of 12 people, the degree of freedom is 11, and the significance level is assumed to be 5 %. The table below shows the t values for a one-tailed open distribution. Depending on whether you want to calculate a one-tailed (directional) or two-tailed (non-directional) t test, you must read the t value at either 0.95 or 0.975. For the non-directional hypothesis and an significance level of 5%, the critical t-value is 2.201.
If the calculated t value is below the critical t value, there is no significant difference between the sample and the population; if it is above the critical t value, there is a significant difference.
|Area one tailed|
|Degree of Freedom||0.5||0.75||0.8||0.85||0.9||0.95||0.975||0.99||0.995||0.999||0.9995|
The t-value is calculated by dividing the measured difference by the scatter in the sample data. The larger the magnitude of t, the more this argues against the null hypothesis. If the calculated t-value is larger than the critical t-value, the null hypothesis is rejected.
Number of degrees of freedom - df
The number of degrees of freedom indicates how many values are allowed to vary freely. The degrees of freedom are therefore the number of independent individual pieces of information.
One sample t-test example
As an example for the t-test for one sample, we examine whether an online statistics tutorial newly introduced at the university has an effect on the students' examination results.
The average score in the statistics test at a university has been 28 points for years. This semester a new online statistics tutorial was introduced. Now the course management would like to know whether the success of the studies has changed since the introduction of the statistics tutorial: Does the online statistics tutorial have a positive effect on exam results?
The population considered is all students who have written the statistics exam since the new statistics tutorial was introduced. The reference value to be compared is 28.
Null hypothesis H0
The mean value from the sample and the predefined value does not differ significantly. The online statistics tutorial has no significant effect on exam results.
Here's how it goes on DATAtab:
Do you want to calculate a t-test independently? Calculate the example in the Statistics Calculator. Just copy the upper table including the first row into the t-Test Calculator. Datatab will then provide you with the tables below.
You would now like to know whether your hypothesis (the score is 28) is significant or not. To do this, you first specify a significance level in Datatab, usually 5% is used, which is preselected. Now you will get the table below in Datatab.
|n||Mean value||Standard deviation||Standard error of the mean value|
One sample t-test (Test Value = 28)
95% confidence interval of the difference
|Mean value difference||Lower||Upper|
To interpret whether your hypothesis is significant one of the two values can be used:
- p-value (2-tailed)
- lower and upper confidence interval of the difference
In this example p-value (2-tailed) is equal to 0.02, i.e. 2 %. Put into words this means: The probability that a sample with a mean difference of 4.33 or more will be drawn from the population is 2%. The significance level was set at 5%, which is greater than 2%. For this reason, a significant difference between the sample and the population is assumed.
Whether or not there is a significant difference can also be read from the confidence interval of the difference. If the lower and upper limits go throw zero, there is no significant difference. If this is not the case, there is a significant difference. In this example, the lower value is 0.86 and the upper value is 7.81. Since the lower and upper values do not touch zero, there is a significant difference.
APA Style | One sample t-test
If we were to write the top results for publication in an APA journal, that is, in an APA format, we would write it that way:
A t-test showed a statistically reliable difference between the score of students who attended the online course and the average score of students who did not attend an online course. (M = 32.33, s = 5.47) and 28, t(11) = 2.75, p < 0.02, α = 0.05.
Statistics made easy
- many illustrative examples
- ideal for exams and theses
- statistics made easy on 276 pages
- 3rd revised edition (July 2023)
- Only 6.99 €
"Super simple written"
"It could not be simpler"
"So many helpful examples"