What is the one-sample t-test?
The one-sample t-test is used to determine whether the population mean is different from a hypothesized value. For example, let’s say we are given some sample balls. We need to measure the average weight of the sample balls and determine whether the average weight of the balls is statistically different from 10 grams. To determine that, we can use the one-sample t-test.
In one of our previous articles, we discussed one sample Z-test. We discussed that when the population variance is known and the test statistic under the null hypothesis is normally distributed or the sample size is large enough, usually more than or equal to 30, we perform a Z-test. But it is not always possible to know the population variance. So, when the population variance is not known, and the sample size is small, usually less than 30, we perform a t-test.
How to calculate the test statistic in a one-sample t-test?
The t-score can be calculated using the following formula:
One-sample t-test using Python
We can use the following Python code to calculate the one-sample t-test. …






0 Comments