Introduction
Before we get to hypothesis testing, we need to discuss one function that can be useful -- estimating a population mean given a mean calculated from a sample. Of course, if we are estimating a population mean from a sample mean, then there is going to be some error involved in that estimation because samples are never perfect estimates of the population. The way in which we handle the error is to not specify a specific value for the population but rather a range of population values that are likely to be correct given our sample mean. An example will surely help...
 
If we collect IQ data from a group of 25 students from a large university with a mean IQ of 115, what can we say about the population of all the students at the university? First, if the students were randomly selected from the university population, then there is no reason to expect any bias in that sample, so certainly our best guess of the student population mean is going to be 115 (same as the sample mean). But it is extremely unlikely that the population mean will be exactly 115. Instead, we can specify a range of value that the population mean is likely to be, but the width of that range is going to depend on how confident we want to be correct.
 
If we collect IQ data from a group of 25 students from a large university with a mean IQ of 115, what can we say about the population of all the students at the university? First, if the students were randomly selected from the university population, then there is no reason to expect any bias in that sample, so certainly our best guess of the student population mean is going to be 115 (same as the sample mean). But it is extremely unlikely that the population mean will be exactly 115. Instead, we can specify an interval of values that the population mean is likely to be, but the width of that range is going to depend on how confident we want to be correct. This interval of values is called the confidence interval.  If we want to be 100% confident that our interval contains the population mean, we can just make the interval infinitely wide. Because the sample mean is our best estimate of the population mean, we would write this like this.

-∞<μ<∞

Of course, this is a little silly and not very helpful, but it does make the point that 100% certainty is unattainable. If we want to be 99% confident, then we are going to have to make an interval which is very wide. In fact, we would need to construct a distribution and then find a value which contains 99% of the population means. This would look something like this

Distribution with 1% in both tails (i.e. 99% in the middle of the distribution)

As you can see, this is a familiar picture -- the distribution that has 1% in both tails is the same as the distribution with 99% in the middle. This shows a strong link between confidence intervals and the t distributions you learned about at the end of the last chapter -- the confidence intervals are focused on the middle of the distributions and hypothesis testing focuses on the regions on the outside, even though both functions relate to this same display.
 
The difficulty in determining confidence intervals is calculating how wide the confidence interval is on each side of the mean. Once we have the width (W) from the mean to the edges of the confidence interval, we can state the confidence interval as

X-W <μ< X+W

In the display above for a 99% confidence interval, W would be the distance from the center of the confidence interval to the beginning of the red areas on both sides. This makes sense because the sample mean is the best estimate of the population mean and so we expect the confidence interval to be the part of the distribution between a value below the mean (
X-W) and a value above the mean (X+W). The key to solving confidence intervals is determining the width of the interval, but how do we do that? Unfortunately, there are two different types of solutions, depending on the answer to the question 'Where did the standard deviation come from?'

Once we have determined which equation is appropriate, then the actual calculations are not all that difficult.
 
To solve any confidence interval problem, you need to be given three things.
 
In most cases, we won't have the population standard deviation information, so we will have to use the sample standard deviation. Why do we only have 99%, 95% and 99.9% confidence intervals? Because most of the time we only have the sample standard deviation, so we have to use the t distribution.  But we only have the t statistics for those six area values in the last section, of which 3 are the most commonly used.
 
To summarize, confidence intervals specify a range of means that is likely to contain the population mean. The larger the range, the more confident you can be that the true population mean will be in the confidence interval.
 
 
Known σ
In the introduction, we learned that a confidence interval is a range of population of means that are likely to contain the true population mean. In order to calculate a confidence interval, we need
This section will deal with confidence intervals created when the population σ is known. As such, σ will come directly from the population scores. Although it is not very common to have this population standard deviation, the calculation of this confidence interval will lay a foundation for the other type of confidence interval.
 
The best way to understand how to solve a confidence interval is to jump right in with a sample problem.
A sample mean of 103 was collected from a population that has a known standard deviation of 12. There were 16 subjects in the sample that created this mean. What is the 95% confidence interval for the range of population means?

 
The best way to understand how to solve a confidence interval is to jump right in with a sample problem.
A sample mean of 103 was collected from a population that has a known standard deviation of 12. There were 16 subjects in the sample that created this mean. What is the 95% confidence interval for the range of population means?
 
A picture will help. 

95% Confidence Interval for sample problem

As you can see, the middle 95% of this mean distribution is from -1.96 standard errors to +1.96 standard errors. Stated in raw scores, this range is from 97.12 to 108.88.
 
Another problem will be helpful. For a normally distributed population of scores, what is the 99% confidence interval of the population mean if the sample mean is 85 (N=64) and the standard deviation (σX) of the population scores is 25?

 Because the standard deviation from the population is given to us, this will be a z distribution problem. Here's the solution with a graph...

Answer:76.96<μ<93.04
Step 1:Calculate Standard Error. σX=σX/N
σX=σX/N=25/64=3.13
Step 2:Find area to lookup. Area=(CI%)/200
Area=(CI%)/200=99/200 = 0.495
Step 3:Find Z closer to Area. Use Z table

Z lower=2.57,area=0.4949,distance=0.495-0.4949=0.0001
Z higher=2.58,area=0.4951,distance=0.4951-0.495=0.0001
Z closer=2.57
Step 4:Calculate CI. CI=X - (Z closer* σX)<μ<X + (Z closer* σX)
CI=X - (Z closer* σX)<μ<X + (Z closer* σX)=85- (2.57*3.13)<μ<85+ (2.57*3.13)
=76.96 < μ <93.04

99% Confidence Interval for sample problem

Notice that this confidence interval extends from -2.58 standard errors to +2.58 standard errors, which corresponds to the means from 76.96 to 93.04, so the solution is 76.96 < μ <93.04.
 
 
Unknown σ
In the introduction, we learned that a confidence interval is a range of population of means that are likely to contain the true population mean. In order to calculate a confidence interval, we need..
This chapter will deal with confidence intervals created when the population σ is unknown. As such, σ will have to be estimated from the sample standard deviation S. Using the sample standard deviation to estimate σ is very common.
 
In the last section we solved the following problem.
 
A sample mean of 103 was collected from a population that has a known standard deviation of 12. There were 16 subjects in the sample that created this mean. What is the 95% confidence interval for the range of population means?

What if we had the same information, but the standard deviation was from a sample instead of a population? The problem would now look like this...

A sample mean of 103 was collected and the sample standard deviation was calculated to be 12. There were 16 subjects in the sample that created this mean. What is the 95% confidence interval for the range of population means?

Think a bit about what differences would there be in the way we solved this problem...
 
The only important difference between solving confidence intervals for known and unknown σ is the shape of the distribution. When σ is known, we use the standardized z distribution, but when σ is unknown, we need to use the t distribution. The challenge with using t distributions is to remember that the shape of the t distribution depends on the degrees of freedom (i.e. sample size -1). The t distribution affects the solution by changing how far on each side the confidence interval needs to extend in order to contain the appropriate middle portion that is likely to contain the true population mean. More specifically, confidence intervals using the t distribution will always require us to go out a little further to contain the same middle portion of the distribution , compared to the z distribution.
 
The only important difference between solving confidence intervals for known and unknown σ is the shape of the distribution. When σ is known, we use the standardized z distribution, but when σ is unknown, we need to use the t distribution. The challenge with using t distributions is to remember that the shape of the t distribution depends on the degrees of freedom (i.e. sample size -1). This impacts the solution by changing how far on each side the confidence interval needs to extend in order to contain the appropriate middle portion that is likely to contain the true population mean. More specifically, confidence intervals using the t distribution will always require us to go out a little further to contain the same middle portion of the distribution , compared to the z distribution. Below, we can compare the z distribution with the t distribution where df=5 (sample size=6).

Comparison of z distribution with t distribution where df=5

As you can see the t distribution is wider and flatter so we have to go out further to have 95% of the curve in the middle for the 95% confidence interval. To determine exactly how far we need to go, we have to use the t critical table that we learned about in the sampling mean chapter.
 
Here are the first 5 rows of the t critical table..

.05(1).05(2).01(1).01(2).001(1).001(2)
df
16.31412.70631.82163.657318.313636.62
22.924.3036.9659.92522.32731.598
32.3533.1824.5415.84110.21512.924
42.1322.7763.7474.6047.1738.61
52.0152.5713.3654.0325.8936.869
Since we have df=5 and we have a 95% confidence interval, we use the .05(2) column because 95% in the middle corresponds to 5%(.05) divided between 2 tails. This value of 2.571 is highlighted.
 
So , the procedure for calculating confidence intervals with a sample standard deviation will be the same as with a population standard deviation except we will use a different critical value to account for the wider t distribution.
 
Here is the problem again with the complete solution. For a normally distributed population of scores with an UNKNOWN population standard deviation, what is the 95% confidence interval of the population mean if the sample mean is 103 (N=16) and the sample estimate of standard deviation (SX) of the population scores is 12?

Answer:96.61<μ<109.39
Step 1:Calculate Estimated Standard Error. SX=SX/N
SX=SX/N=12/16=3
Step 2:Find tCrit value. Look up t critical
:Since this is a 95% CI, Use .05,2 tailed column
Look up tCrit from table (Df=N-1=16-1=15). So tCrit=2.131
Step 3:Calculate CI. CI=X - (tCrit* SX)<μ<X +(tCrit* SX)
CI=X - (tCrit* SX)<μ<X +(tCrit* SX)=103- (2.131*3)<μ<103+ (2.131*3)
=96.61 < μ <109.39

Complete solution of confidence interval with only sample information given

 
Let's do one more problem. For a normally distributed population of scores with an UNKNOWN population standard deviation, what is the 99% confidence interval of the population mean if the sample mean is 104 (N=9) and the sample estimate of standard deviation (SX) of the population scores is 6?
Answer:97.29<μ<110.71
Step 1:Calculate Estimated Standard Error. SX=SX/N
SX=SX/N=6/9=2
Step 2:Find tCrit value. Look up t critical
:Since this is a 99% CI, Use .01,2 tailed column
Look up tCrit from table (Df=N-1=9-1=8). So tCrit=3.355
Step 3:Calculate CI. CI=X - (tCrit* SX)<μ<X +(tCrit* SX)
CI=X - (tCrit* SX)<μ<X +(tCrit* SX)=104- (3.355*2)<μ<104+ (3.355*2)
=97.29 < μ <110.71
 
Definitions
Confidence Interval: A range of values that is likely to contain the population mean. Confidence Intervals are estimated from a sample mean and a source of variability.
 
Easy Questions
1. What are the most common confidence intervals? Why?
2. Which of these confidence intervals will have the widest range, 95, 99, 99.9 or 99.99?
3. When the population standard deviation is known, what kind of a distribution do we use to estimate a confidence interval?
4. When the population standard deviation is NOT known, then what kind of a distribution do we use to estimate a confidence interval?
5. A confidence interval has been determined to be 120 < u < 126, what was the sample mean that was used to produce this confidence
interval?
6. A sample mean of 132 is used to create a confidence interval of 120 < u < X. What is X?
7. For a normally distributed population of scores with an UNKNOWN population standard deviation, what is the 95% confidence interval of the population mean if the sample mean is 100 (N=25) and the sample estimate of standard deviation (SX) of the population scores is 25?
8. For a normally distributed population of scores with an UNKNOWN population standard deviation, what is the 99% confidence interval of the population mean if the sample mean is 25 (N=25) and the sample estimate of standard deviation (SX) of the population scores is 25?
Medium Questions
9. You don't know the sample mean and you have no information about the standard deviation, but you want to create a 100% confidence interval. What will it be?
10. For a normally distributed population of scores, what is the 95% confidence interval of the population mean if the sample mean is 85 (N=64) and the standard deviation (σX) of the population scores is 12?
11. For a normally distributed population of scores, what is the 99% confidence interval of the population mean if the sample mean is 85 (N=100) and the standard deviation (σX) of the population scores is 10?
12. For a normally distributed population of scores with an UNKNOWN population standard deviation, what is the 80% confidence interval of the population mean if the sample mean is 100 (N=25) and the sample estimate of standard deviation (SX) of the population scores is 25?