AP Statistics Chapter 11 - William H. Peacock, LCDR USN

Download Report

Transcript AP Statistics Chapter 11 - William H. Peacock, LCDR USN

AP Statistics
Chapter 23
Inference for
Means
Objectives:
•
•
•
•
The t-Distributions
Degrees of Freedom (df)
One-Sample t Confidence Interval for Means
One-Sample t Hypothesis Test for Means
Getting Started
• Now that we know how to create confidence intervals and test
hypotheses about proportions, it’d be nice to be able to do the
same for means.
• Just as we did before, we will base both our confidence interval
and our hypothesis test on the sampling distribution model.
• The Central Limit Theorem told us that the sampling distribution
model for means is Normal with mean μ and standard deviation
SD  y  

n
Getting Started (cont.)
• All we need is a random sample of quantitative
data.
• And the true population standard deviation, σ.
– Well, that’s a problem…
Getting Started (cont.)
• Proportions have a link between the proportion value and the
standard deviation of the sample proportion.
• This is not the case with means—knowing the sample mean tells
us nothing about
SD( y)
• We’ll do the best we can: estimate the population parameter σ
with the sample statistic s.
s
• Our resulting standard error is SE  y  
n
Getting Started (cont.)
• We now have extra variation in our standard error
from s, the sample standard deviation.
– We need to allow for the extra variation so that it does not
mess up the margin of error and P-value, especially for a
small sample.
• And, the shape of the sampling model changes—the
model is no longer Normal. So, what is the sampling
model?
Gosset’s t
• William S. Gosset, an employee of the Guinness Brewery in
Dublin, Ireland, worked long and hard to find out what the
sampling model was.
• The sampling model that Gosset found has been known as
Student’s t.
• The Student’s t-models form a whole family of related
distributions that depend on a parameter known as degrees of
freedom.
– We often denote degrees of freedom as df, and the model as tdf.
t - Distributions
• When we do not know σ, we substitute the
s
standard error y of
for its standard
n

deviation
. The resulting test statistic does
n
not have a normal distribution, but has a
t – distribution.
t - Distributions
• Unlike the standard normal distribution, there is
a different t – distribution for each sample size n.
• We specify a particular t – distribution by giving
its degrees of freedom (df).
• df = n-1
• We write the t – distribution with k degrees of
freedom as t(k) for short.
Properties of the
t – Distribution.
• The model of the t – distributions are similar in shape to the
standard normal curve. They are symmetric about zero, singlepeaked, and bell-shaped.
• The spread of the t – distributions is a bit greater than that of the
standard normal distribution.
– The t – distributions have more probability in the tails and less in the
center than does the standard normal.
– This is true because substituting the estimate s for the fixed parameter σ
introduces more variation into the statistic.
• As the degrees of freedom k increase, the t(k) model approaches
the N(0,1) curve ever more closely.
– This happens because s estimates σ more accurately as the sample size
increases.
Properties of the
t – Distribution.
• Student’s t-models are unimodal, symmetric, and
bell shaped, just like the Normal.
• But t-models with only a few degrees of freedom
have much fatter tails than the Normal. (That’s
what makes the margin of error bigger.)
Properties of the
t – Distribution
• As the degrees of freedom increase, the t-models look more and
more like the Normal.
• In fact, the t-model with infinite degrees of freedom is exactly
Normal.
Properties of the
t – Distribution
Finding t-Values By Hand
• The Student’s t-model
is different for each
value of degrees of
freedom.
• Because of this,
Statistics books usually
have one table of tmodel critical values for
selected confidence
levels.
Finding t-Values By Hand
(cont.)
• The critical value t – use Table T to find, enter
table with probability p or Confidence level C.
The table gives the t* with probability p lying to
its right and probability C lying between –t* and
t*.
Table T - t*
Finding t*
• Suppose you want to construct a 95% confidence
interval for the mean of a population based on an
SRS of size n=12. What critical value t* should
you use?
Solution
• In Table T, consult the
row corresponding to
df = 11. Move across
that row to the entry
that is directly above
95% CI on the bottom
of the chart. The
desired critical value is
t*=2.201.
Finding t-Values By
Hand (cont.)
• Alternatively, we could use technology to find t
critical values for any number of degrees of
freedom and any confidence level you need.
• The TI-84 calculator contains an inverse t
function that works much the same as invNorm
function. t* = invT (area to the left of t*, df).
A Confidence Interval for Means?
A practical sampling distribution model for means
When the conditions are met, the standardized sample
mean
y 
t
SE  y 
follows a Student’s t-model with n – 1 degrees of
freedom.
s
We estimate the standard error with SE  y  
n
A Confidence Interval for
Means? (cont.)
• When Gosset corrected the model for the extra
uncertainty, the margin of error got bigger.
– Your confidence intervals will be just a bit wider and
your P-values just a bit larger than they were with
the Normal model.
• By using the t-model, you’ve compensated for
the extra variability in precisely the right way.
A Confidence Interval for
Means? (cont.)
One-sample t-interval for the mean
• When the conditions are met, we are ready to find the confidence
interval for the population mean, μ.
• The confidence interval is

n1
y t
 SE  y 
s
where the standard error of the mean is SE  y  
n
• The critical value tn*1 depends on the particular confidence
level, C, that you specify and on the number of degrees of
freedom, n – 1, which we get from the sample size.
Assumptions and
Conditions
• Gosset found the t-model by simulation.
• Years later, when Sir Ronald A. Fisher showed
mathematically that Gosset was right, he needed
to make some assumptions to make the proof
work.
• We will use these assumptions when working
with Student’s t.
Assumptions and Conditions
(cont.)
• Independence Assumption:
– The data values should be independent.
– Randomization Condition: The data arise from a random
sample or suitably randomized experiment. Randomly
sampled data (particularly from an SRS) are ideal.
– 10% Condition: When a sample is drawn without
replacement, the sample should be no more than 10% of the
population.
Assumptions and Conditions
(cont.)
• Normal Population Assumption:
– We can never be certain that the data are from a
population that follows a Normal model, but we can
check the
– Nearly Normal Condition: The data come from a
distribution that is unimodal and symmetric.
• Check this condition by making a histogram or
Normal probability plot.
Assumptions and Conditions
(cont.)
– Nearly Normal Condition:
• The smaller the sample size (n < 15 or so), the
more closely the data should follow a Normal
model.
• For moderate sample sizes (n between 15 and 40
or so), the t works well as long as the data are
unimodal and reasonably symmetric.
• For larger sample sizes, the t methods are safe to
use unless the data are extremely skewed.
One Sample t Confidence
Interval for Means
• The confidence interval for the population
mean is: y  tn1  SE  y 
s
SE  y  
n
• The critical value t* depends on the particular
confidence level, C, that you specify and on the
number of degrees of freedom, n-1.
Example: t Confidence
Interval
• Some AP Statistics students are concerned about safety near an
elementary school. Though there is a 25 MPH SCHOOL ZONE
sign nearby, most drivers seem to go much faster than that, even
when the warning sign flashes. The students randomly selected
20 flashing zone times during the school year, noted the speeds
of the cars passing the school during the flashing zone times, and
recorded the averages. They found that the overall average speed
during the flashing school zone times for the 20 time periods was
24.6 mph with a standard deviation of 7.24 mph. Find a 90%
confidence interval for the average speed of all vehicles passing
the school during those hours. A histogram of their data follows.
Solution
•
Choose method
– One-sample t confidence interval for the mean.
• Why? – because σ is unknown.
•
Check conditions
– Randomization – Yes (it is a random selection of days from the year).
– Population Size (10n ≤ N) – Yes (it is reasonable to assume that at least 200 flashing zone times
exist during the school year since the sign flashes both morning and afternoon).
– Sample Size – Yes (n = 20, the distribution shows roughly symmetric and unimodal, no strong
skew or outliers).
•
•
Construct the confidence interval
–
df = n-1 = 20-1 = 19 and the 90% t* = 1.729
–
–
90% CI: (21.8,27.4)
Conclusion
– We are 90% confident that the true mean speed of cars passing the school when the warning sign
is flashing is between 21.8 and 27.4 mph.
Your Turn:
• A SRS of 75 male adults living in a particular
suburb was taken to study the amount of time
they spent per week doing rigorous exercises. It
indicated a mean of 73 minutes with a standard
deviation of 21 minutes. Find the 95%
confidence interval of the mean foe all males in
the suburb.
Solution
•
Check conditions
– Randomization – Yes data from SRS.
– Population Size (10n ≤ N) – Yes (it is reasonable to assume that at least 750 males live in
that suburb).
– Sample Size – Yes (n is large, n>40).
•
Construct the confidence interval
–
df = n-1 = 75-1 = 74 and the 95% t* = 1.990
y  t* 
–
•
s
21
 73  1.990 
 73  4.83
n
75
95% CI: (68.17, 77.83)
Conclusion
– We are 95% confident that the true mean time of rigorous exercise for males in the suburb is
between 68.17 min. and 77.83 min.
Ti-83/84 Calculator
• One-sample t Confidence
Interval
– STAT/TESTS/TInterval
• Stats
–x :
–
–
–
–
Sx:
n:
C-Level:
Calculate:
• One-sample t Confidence
Interval
– STAT/TESTS/TInterval
• Data
–
–
–
–
List:
Freq:
C-Level:
Calculate
Example: Use TI-84
• Environmentalists, government officials, and vehicle manufacturers are all
interested in studying the auto exhaust emissions produced by motor vehicles.
The major pollutants in auto exhaust from gasoline engines are hydrocarbons,
monoxide, and nitrogen oxides (NOX). The table gives the NOX levels (in
grams per mile) for a random sample of light-duty engines of the same type.
1.28
1.17
1.16
1.08
0.60
1.32
1.24
0.71
0.49
1.38
1.20
0.78
0.95
2.20
1.78
1.83
1.26
1.73
1.31
1.80
1,15
0.97
1.12
0.72
1.31
1.45
1.22
1.32
1.47
1.44
0.51
1.49
1.33
0.86
0.57
1.79
2.27
1.87
2.94
1.16
1.45
1.51
1.47
1.06
2.01
1.39
• Construct a 95% confidence interval for the mean amount of NOX emitted by
light-duty engines of this type.
Solution
• 95% Confidence Interval (1.185, 1.473)
• We are 95% confident that the true mean level of
NOX emitted by this type of light-duty engine is
between 1.185 and 1.473 grams/mile.
More Cautions About Interpreting
Confidence Intervals
• Remember that interpretation of your confidence
interval is key.
• What NOT to say:
– “90% of all the vehicles on Triphammer Road drive at a
speed between 29.5 and 32.5 mph.”
• The confidence interval is about the mean not the
individual values.
– “We are 90% confident that a randomly selected vehicle
will have a speed between 29.5 and 32.5 mph.”
• Again, the confidence interval is about the mean not the
individual values.
More Cautions About Interpreting
Confidence Intervals (cont.)
• What NOT to say:
– “The mean speed of the vehicles is 31.0 mph 90% of the
time.”
• The true mean does not vary—it’s the confidence
interval that would be different had we gotten a different
sample.
– “90% of all samples will have mean speeds between 29.5
and 32.5 mph.”
• The interval we calculate does not set a standard for
every other interval—it is no more (or less) likely to be
correct than any other interval.
More Cautions About Interpreting
Confidence Intervals (cont.)
• DO SAY:
– “90% of intervals that could be found in this way
would cover the true value.”
– Or make it more personal and say, “I am 90%
confident that the true mean is between 29.5 and
32.5 mph.”
Make a Picture, Make a Picture,
Make a Picture
• Pictures tell us far more about our data set than a
list of the data ever could.
• The only reasonable way to check the Nearly
Normal Condition is with graphs of the data.
– Make a histogram of the data and verify that its
distribution is unimodal and symmetric with no
outliers.
– You may also want to make a Normal probability
plot to see that it’s reasonably straight.
A Test for the Mean
One-sample t-test for the mean
• The conditions for the one-sample t-test for the mean are the
same as for the one-sample t-interval.
• We test the hypothesis H0:  = 0 using the statistic
y  0
tn1 
SE  y 
• The standard error of the sample mean is SE  y  
s
n
• When the conditions are met and the null hypothesis is true, this
statistic follows a Student’s t model with n – 1 df. We use that
model to obtain a P-value.
Check Conditions
• Randomization Condition – the data come from a
random sample or a randomized experiment.
• Population-size Condition – the sample size is less
than 10% of the population.
• Nearly Normal Condition – the data come from a
unimodal, symmetric, bell-shaped distribution. This can
be verified by constructing a histogram or a normal
probability plot of the data.
Check Conditions
• If the underlying population is approximately normal,
the t-statistic is appropriate regardless of sample size, n.
• For n ≥ 40, the t-statistic is appropriate provided that
there are no outliers.
• For 15 ≤ n < 40, the t-statistic is appropriate provided
that there are no outliers or strong skew.
• For n < 15, the t-statistic is appropriate provided that
the distribution of the data is approximately normal.
One-Sample t Test
Statistic for Means
y 
• The one-sample t statistic is: t 
SE  y 
s
SE  y  
n
• Has the t-distribution with n-1 degrees of
freedom.
Example: One-Sample t
Hypothesis Test for Mean
• A recent report on the evening news stated that teens watch an average of 13
hours of TV per week. A teacher at Central High School believes that the
students in her school actually watch more than 13 hours per week. She
randomly selects 25 students from the school and directs them to record their
TV hours for one week. The 25 students reported the following number of
hours:
5
5
6
18
23
13
0
18
20
5
23
11
0
25
22
13
24
6
14
20
23
20
11
22
11
• Is there enough evidence at the 5% significance level to support the teacher’s
claim?
Solution:
•
Choose method
–
•
Check conditions
–
–
–
•
One-sample t hypothesis test
Randomization – Yes (stated the students were randomly selected).
Population Size – Yes (reasonable to think there are more than 250 students in the school).
Nearly Normal – Yes (n=30, 15<n<40 and no outliers or strong skew).
Hypothesis
–
–
H0: μ = 13
Ha: μ > 13
•
Calculate the t test statistic:
•
•
Calculate the p-value: df = 29, p-value = P(t > .83) = .2077
Conclusion
–
The p-value of .2077 is not significant at the 5% significance level ( .2077 > .05). Therefore, we fail to reject the
null hypothesis. There is not enough evidence to conclude that the true mean hours of TV viewing per week for
students in this school is greater than 13 hours.
Your Turn:
• The belief is that the mean number of hours per
week of part-time work of high school seniors in
a city is 10.6 hours. Data from a SRS of 50
seniors indicated that their mean number of
hours of part-time work was 12.5 with a standard
deviation of 1.3 hours. Test whether these data
cast doubt on the current belief (α=.05).
Solution
•
Check conditions
–
–
–
•
Randomization – Yes (stated from SRS).
Population Size – Yes (reasonable to think there are more than 500 High School seniors students in the
city).
Sample Size – Yes (no outliers or strong skew).
Hypothesis
–
–
H0: μ = 10.6
Ha: μ ≠ 10.6
t
y   12.5  10.6

 10.33
s
1.3
n
50
•
Calculate the t test statistic:
•
•
Calculate the p-value: df = 49, p-value = 2P(t > 10.33) = 6.77x10-14
Conclusion
–
The p-value of 6.77x10-14 is significant at the 5% significance level (6.77x10-14 < .05). Therefore, we
reject the null hypothesis. There is enough evidence at the 5% significance level to conclude that the true
mean hours of part-time work by High School seniors in this city is greater than 10.6 hours per week.
Significance and
Importance
• Remember that “statistically significant” does
not mean “actually important” or “meaningful.”
– Because of this, it’s always a good idea when we test
a hypothesis to check the confidence interval and
think about likely values for the mean.
Intervals and Tests
• Confidence intervals and hypothesis tests are
built from the same calculations.
– In fact, they are complementary ways of looking at
the same question.
– The confidence interval contains all the null
hypothesis values we can’t reject with these data.
Intervals and Tests
(cont.)
• More precisely, a level C confidence interval contains
all of the plausible null hypothesis values that would
not be rejected by a two-sided hypothesis text at alpha
level
1 – C.
– So a 95% confidence interval matches a 0.05 level twosided test for these data.
• Confidence intervals are naturally two-sided, so they
match exactly with two-sided hypothesis tests.
– When the hypothesis is one sided, the corresponding alpha
level is (1 – C)/2.
Sample Size
• To find the sample size needed for a particular
confidence level with a particular margin of error
(ME), solve this equation for n:
ME  t

n 1
s
n
• The problem with using the equation above is that we
don’t know most of the values. We can overcome this:
– We can use s from a small pilot study.
– We can use z* in place of the necessary t value.
Sample Size (cont.)
• Sample size calculations are never exact.
– The margin of error you find after collecting the data won’t
match exactly the one you used to find n.
• The sample size formula depends on quantities you
won’t have until you collect the data, but using it is an
important first step.
• Before you collect data, it’s always a good idea to know
whether the sample size is large enough to give you a
good chance of being able to tell you what you want to
know.
Degrees of Freedom
• If only we knew the true population mean, µ, we would find
the sample standard deviation as
2
(
y


)

s
n
.
• But, we use y instead of
µ, though, and that
causes a problem.
2
2
• When we use y  y  instead of y    to calculate s, our
standard deviation estimate would be too small.
• The amazing mathematical fact is that we can compensate for
the smaller sum exactly by dividing by n – 1 which we call the
degrees of freedom.
What Can Go Wrong?
• Don’t confuse proportions and means.
Ways to Not Be Normal:
• Beware of multimodality.
– The Nearly Normal Condition clearly fails if a histogram of
the data has two or more modes.
• Beware of skewed data.
– If the data are very skewed, try re-expressing the variable.
• Set outliers aside—but remember to report on these
outliers individually.
What Can Go Wrong?
(cont.)
…And of Course:
• Watch out for bias—we can never overcome the
problems of a biased sample.
• Make sure data are independent.
– Check for random sampling and the 10% Condition.
• Make sure that data are from an appropriately
randomized sample.
What Can Go Wrong?
(cont.)
…And of Course, again:
• Interpret your confidence interval correctly.
– Many statements that sound tempting are, in fact,
misinterpretations of a confidence interval for a
mean.
– A confidence interval is about the mean of the
population, not about the means of samples,
individuals in samples, or individuals in the
population.
What have we learned?
• Statistical inference for means relies on the same
concepts as for proportions—only the mechanics and
the model have changed.
– What we say about a population mean is inferred from the
data.
– Student’s t family based on degrees of freedom.
– Ruler for measuring variability is SE.
– Find ME based on that ruler and a student’s t model.
– Use that ruler to test hypotheses about the population mean.
What have we learned?
• The reasoning of inference, the need to verify
that the appropriate assumptions are met, and the
proper interpretation of confidence intervals and
P-values all remain the same regardless of
whether we are investigating means or
proportions.
Assignment
• Pg. 554 – 559: #1, 5, 13, 15, 19, 23, 25, 29, 31,
37