#### Transcript lecture29

```Reviewing Confidence Intervals
Anatomy of a confidence level
• A confidence level always consists of two
pieces:
• A statistic being measured
• A margin of error
X m
The margin of error can be determined by many different methods
depending on what kind of distribution we are using:
normal, t-test, paired tests etc
Go to applet that demonstrates the concept of a confidence level
Simple example
• Suppose that we know the standard
deviation for the active ingredient in a drug
is 0.025 mg and the variation in amount is
normally distributed. If we measure a
sample of the drug and find the amount of
active ingredient present is 0.15 mg, what
would be the acceptable range of active
ingredient at the 90% confidence level?
Solution…
• Use the correct z-value for 90%
5% of area left of this
point
95% of area
left of this point
The correct z values are -1.645 and +1.645 and are usually
denoted z* to indicate that these are special ones chosen with
a particluar confidence level “C” in mind. In this example C =
90%
X m
0.15 mg  (1.645)0.025 mg
0.15  0.041mg
Another way to express this is:
The amount of active ingredient is (0.109,0.191) mg at the 90% level
Using the z-score formula we get:
z* 
X 

  z *  X    z * , z*  1.645
0.15  1.645  0.025  X  0.15  1.645  0.025
90% of the readings will be expected to fall in the range
(0.109,0.191) mg
Using Confidence Intervals when Determining the True
value of a Population Mean
• We rarely ever know the population mean –
instead we can construct SRS’s and
measure sample means.
• A confidence interval gives us a measure of
how precisely we know the underlying
population mean
• We assume 3 things:
• We can construct “n” SRS’s
• The underlying population of sample means is
Normal
• We know the standard deviation
This gives …
Confidence interval for a population mean:
X  z*

n
   X  z*
Number of samples
or tests
We measure this
We infer this

n
Example: Fish or Cut Bait?
A biologist is trying to determine how many rainbow trout
are in an interior BC lake. To do this he uses a large net
that filters 6000 m3 of lake water in each trial. He drops
the net in a specific area and records the mean number of
fish caught in 10 trials. This represents one SRS. From
this he is able to determine a mean and standard
deviation for the number of fish in 100 SRS’s. Each SRS
has the same  = 9.3 fish with a sample mean of 17.5
fish. How precisely does he know the true mean of
fish/6000 m3? Use C = 90%
If the volume of the lake is
60 million m3, how many
trout are in the lake?
Solution:
• Since C = 0.90, z* = 1.645
  z *
n
 X    z *
n
17.5  1.645(9.3 )  X  17.5  1.645(9.3 )
10
10
There is a 90% chance that the true mean number of fish/6000 m3 lies
in the range (16.0,19.0) Total number of fish: He is 90% confident
that there are between 160 000 and 190 000 fish in the lake.
Why should you be skeptical of this result?
Margin of Error
• When testing confidence limits you are
saying that your statistical measure of
the mean is:
estimate +/- the margin of error
• ie: X = 3.2 cm +/- 1.1 cm with a 90%
confidence
Math view…
• Mathematically the margin of error is:
z *
n
• You can reduce the margin of error by
• increasing the number of samples you test
• making more precise measurements (makes 
smaller)
Matching Sample Size to Margin of Error
• An IT department in a large company is
testing the failure rate of a new high-end
graphics card in 200 of its work stations.
5 cards were chosen at random with the
following lifetime per failure (measured in
1000’s of hours) and  = 0.5:
1
1.4
2
1.7
3
1.5
4
1.9
5
1.8
Provide a 90% confidence level for the mean lifetime of these boards.
1.4  1.7  1.5  1.9  1.8
X
 1.66
5
X  z *
0.5
 1.66  1.645( )  1.66  0.37
n
5
IT is 90% confident that the mean lifetime of these boards is between 1290
and 2030 hours.
However – these are expensive boards and accounting wants to have the
margin of error reduced to 0.10 with a 90% confidence level. What should
IT do?
m  z*

n
 n  (z *

m
)2
IT needs to test 68 machines!
Using other statistical tests…
• The margin of error can be estimated in
many different ways…
• Consider 7.37
• Here we are using a confidence iterval to
test the likelihood of the null hypothesis
The main idea…
• Margin of error shows you the range in a
confidence interval
• The value of ME depends on the
confidence level you set and the type of
statistical analysis that is appropriate
```