7. Hypothesis Testing: One-sample t-test
Confidence Interval for μ when σ is Unknown
Thus far, we have used the following formula to compute a for a population mean :
Just like the calculation of the -statistic, this calculation requires the population standard deviation to be known.
When is unknown, we will have to rely on the -distribution and the sample standard deviation to compute the confidence interval.
Confidence Interval for a Population Mean when σ is Unknown
Assuming the sampling distribution of the sample mean is (approximately) normal, the general formula for computing a CI for a population mean , based on a random sample of size , when σ is unknown, is:
Where is the critical value of the distribution such that .
Calculating t* with Statistical Software
Let be the confidence level in .
To calculate the critical value in Excel, make use of the function T.INV():
To calculate the critical value in R, make use of the function qt():
He collects a random sample of students. On average, these students spent hours a week on their homework with a standard deviation of hours.
Construct a confidence interval for the population mean . Round your answers to decimal places.
There are a number of different ways we can compute the confidence interval. Click on one of the panels to toggle a specific solution.
Since the population standard deviation is unknown, we will have to use the -distribution and the sample standard deviation to construct the confidence interval.
A sample size of is considered large enough for the Central Limit Theorem to apply.
This means that, although the sample in question comes from a population having an unknown distribution, the sampling distribution of the sample mean is approximately normal.
Assuming the sampling distribution of the sample mean is (approximately) normal, the general formula for computing a for the population mean , based on a random sample of size , is:
For a given confidence level (in ), the critical value of the is the value such that .
To calculate this critical value in Excel, make use of the following function:
T.INV(probability, deg_freedom)
- probability: A probability corresponding to the normal distribution.
- deg_freedom: The mean of the distribution.
Here, we have . Thus, to calculate such that , run the following command:
This gives:
Calculate the lower bound of the confidence interval:
Calculate the lower bound of the confidence interval:
Thus, the confidence interval for the population mean is:
Since the population standard deviation is unknown, we will have to use the -distribution and the sample standard deviation to construct the confidence interval.
A sample size of is considered large enough for the Central Limit Theorem to apply.
This means that, although the sample in question comes from a population having an unknown distribution, the sampling distribution of the sample mean is approximately normal.
Assuming the sampling distribution of the sample mean is (approximately) normal, the general formula for computing a for the population mean , based on a random sample of size , is:
For a given confidence level (in ), the critical value of the is the value such that .
To calculate this critical value in R, make use of the following function:
qt(p, df, lower.tail)
- p: A probability corresponding to the normal distribution.
- df: An integer indicating the number of degrees of freedom.
- lower.tail: If TRUE (default), probabilities are , otherwise, .
Here, we have . Thus, to calculate such that , run the following command:
This gives:
Calculate the lower bound of the confidence interval:
Calculate the lower bound of the confidence interval:
Thus, the confidence interval for the population mean is:
Connection to Hypothesis Testing
There exists a direct connection between a two-sided one-sample -test for and a confidence interval for based on the -distribution:
- If falls inside the , then should not be rejected at the level of significance.
- If falls outside of the , then should be rejected at the level of significance.
Suppose you use the same sample to test against at the level of significance.
What would be the conclusion?
Since the confidence interval does not contain the value , we would reject at the level of significance.