One sample t-test calculator
The this one-sample t-test calculator helps you determine whether the mean of a single sample is significantly different from a known or hypothesized population mean.
Results:
t-Statistic:
p-value (one-tailed, Ha: mean > μ):
p-value (one-tailed, Ha: mean < μ):
p-value (two-tailed, Ha: mean ≠ μ):
Degrees of freedom:
Standard error (SE):
Confidence interval: ( , )
Related calculators:
What is a one-sample t-test?
A one-sample t-test is a statistical test used to determine whether the mean of a single sample is significantly different from a known or hypothesized population mean. It is commonly used when the population standard deviation is unknown, and the sample size is small (typically n < 30), but it can also be used for larger samples.
One-sample t-test formula
The test statistic (t-statistic) is calculated as:
t = \frac{\bar{x} - \mu}{s / \sqrt{n}}where:
- \bar{x} = sample mean
- \mu = hypothesized population mean
- s = sample standard deviation
- n = sample size
The resulting t-statistic follows a t-distribution with n−1 degrees of freedom (df).
Example of a one-sample t-test
Scenario
A factory claims that the average weight of a product is 500 grams. A quality control inspector randomly selects 25 products and finds an average weight of 495 grams with a standard deviation of 10 grams. The inspector wants to test if the average weight is significantly different from 500 grams at a 5% significance level \alpha = 0.05).
Step 1: Define hypotheses
Null hypothesis (H_0): The true mean is 500 grams
H_0: \mu = 500
Alternative hypothesis (H_a): The true mean is not 500 grams
H_a: \mu \neq 500
Step 2: Calculate the t-Statistic
Using the formula:
t = \frac{495 - 500}{10 / \sqrt{25}}
t = \frac{-5}{2} = -2.5Step 3: Find the critical t-Value
Since n=25, the degrees of freedom is:
df=25−1=24
Using a t-table, the critical t-value for a two-tailed test at \alpha = 0.05 and df = 24 is ±2.064.
Step 4: Compare t-Statistic with critical value
The calculated t=−2.5 is beyond −2.064, meaning we reject the null hypothesis.
Step 5: Conclusion
Since t=−2.5 is less than −2.064, we conclude that the average weight of the product is significantly different from 500 grams at the 5% significance level.
Interpreting p-Values
Alternatively, we can use a p-value approach:
- Using a p-value calcualtor from t-statistic, the p-value for t=−2.5 with 24 degrees of freedom is 0.020.
- Since p<0.05, we reject H_0 and conclude that the average weight is significantly different from 500g.
When to use a one-sample t-test?
Use a one-sample t-test when:
- You have one sample.
- You do not know the population standard deviation.
- The sample is randomly selected and follows a normal distribution (or nnn is large enough for the Central Limit Theorem to apply).
Summary
| Concept | Explanation |
|---|---|
| Purpose | Compare a sample mean to a known/hypothetical population mean |
| Formula | t = \frac{\bar{x} - \mu}{s / \sqrt{n}} |
| Degrees of freedom | df=n−1 |
| When to use | Unknown population standard deviation, small sample size, normally distributed data |
| Example | Checking if a factory’s product weight differs from 500g |
