Sunteți pe pagina 1din 40

Confidence Intervals and

Hypothesis Tests for Means


Sampling distribution of a sample mean

The mean and standard deviation of
For normally distributed populations
The central limit theorem

x
Reminder: What is a sampling distribution?
The sampling distribution of a statistic is the
distribution of all possible values taken by the
statistic when all possible samples of a fixed size n
are taken from the population. It is a theoretical
idea we do not actually build it.

The sampling distribution of a statistic is the
probability distribution of that statistic.

Sampling distribution of the sample mean
We take many random samples of a given size n from a
population with mean and standard deviation o.
Some sample means will be above the population mean
and some will be below, making up the sampling distribution.

Sampling
distribution
of x bar
Histogram
of some
sample
averages
Sampling distribution of x bar

o/n
For any population with mean and standard deviation o:
The mean, or center of the sampling distribution of , is
equal to the population mean
The standard deviation of the sampling distribution is o/n,
where n is the sample size

x

Mean of a sampling distribution of
There is no tendency for a sample mean to fall systematically above or
below , even if the distribution of the raw data is skewed. Thus, the mean
of the sampling distribution is an unbiased estimate of the population
mean it will be correct on average in many samples.


Standard deviation of a sampling distribution of
The standard deviation of the sampling distribution measures how much
the sample statistic varies from sample to sample. It is smaller than the
standard deviation of the population by a factor of n. Averages are
less variable than individual observations.

x

x
For normally distributed populations
When a variable in a population is normally distributed, the sampling
distribution of for all possible samples of size n is also normally
distributed.
If the population is N(, o)
then the sample means
distribution is N(, o/n).
Population
Sampling distribution

x
IQ scores: population vs. sample
In a large population of adults, the mean IQ is 112 with standard deviation 20.
Suppose 200 adults are randomly selected for a market research campaign.

The distribution of the sample mean IQ is:
A) Exactly normal, mean 112, standard deviation 20
B) Approximately normal, mean 112, standard deviation 20
C) Approximately normal, mean 112 , standard deviation 1.414
D) Approximately normal, mean 112, standard deviation 0.1
C) Approximately normal, mean 112 , standard deviation 1.414

Population distribution : N( = 112; o = 20)
Sampling distribution for n = 200 is N( = 112; o /n = 1.414)
Example
Suppose a population has mean = 8 and
standard deviation = 3 and random sample
of size n = 36 is selected.

What is the probability that the sample mean
is between 7.8 and 8.2?
Example
Solution:
Even if the population is not normally
distributed, the central limit theorem can be
used (n > 25)
so the sampling distribution of is
approximately normal
with mean = = 8
and standard deviation

(continued)
x
x

0.5
36
3
n

x
= = =
Example
Solution (continued) -- find z-scores:

(continued)

P(7.8 < x < 8.2) = P
7.8- 8
3
36
< z <
8.2- 8
3
36
|
\


|
.
|
|
= P(-0.4< z < 0.4) = 0.3108
z
7.8 8.2
-0.4 0.4
Sampling
Distribution
Standard Normal
Distribution
Population
Distribution
?
?
?
?
?
?
? ?
?
?
?
?
Sample Standardize
8 =
8
x
=
0
z
=
x
x
Practical note

Large samples are not always attainable.
Sometimes the cost, difficulty, or preciousness of what is
studied drastically limits any possible sample size.
Opinion polls have a limited sample size due to time and
cost of operation. During election times, though, sample
sizes are increased for better accuracy.

Not all variables are normally distributed.
Income, for example, is typically strongly skewed.
Is still a good estimator of then?

x
The central limit theorem
Central Limit Theorem: When randomly sampling from
any population with mean and standard deviation o,
when n is large enough, the sampling distribution of is
approximately normal: ~ N(, o/n).
Population with
strongly skewed
distribution
Sampling
distribution of
for n = 2
observations
Sampling
distribution of
for n = 10
observations
Sampling
distribution of
for n = 25
observations

x

x

x

x
Income distribution
Lets consider the very large database of individual incomes from the Bureau of Labor
Statistics as our population. It is strongly right skewed.

We take 1000 SRSs of 100 incomes, calculate the
sample mean for each, and make a histogram of these
1000 means.
We also take 1000 SRSs of 25 incomes, calculate the
sample mean for each, and make a histogram of these
1000 means.
Which histogram
corresponds to
samples of size 100?
25?
In many cases, n = 25 isnt a huge sample. Thus, even
for strange population distributions we can assume a
normal sampling distribution of the mean and work
with it to solve problems.
How large a sample size?
It depends on the population distribution. More
observations are required if the population
distribution is far from normal.

A sample size of 25 is generally enough to obtain a
normal sampling distribution from a strong skewness or
even mild outliers.
A sample size of 40 will typically be good enough to
overcome extreme skewness and outliers.
Inference for the mean of a population

Confidence intervals for the population mean
The t distributions
The one-sample t confidence interval
The one-sample t test
Robustness
Sample size calculation

Confidence intervals
The confidence interval is a range of values with an associated
probability or confidence level C. The probability quantifies the chance
that the interval contains the true population parameter.
4.2 is a 95% confidence interval for the population parameter .
This equation says that in 95% of the cases, the actual value of will be within
4.2 units of the value of .

x

x
Implications
We dont need to take a lot of
random samples to rebuild
the sampling distribution and
find at its center.
n
n
Sample


Population

All we need is one SRS of size
n and rely on the properties of
the sample means distribution
to infer the population mean
.
Reworded
With 95% confidence, we can
say that should be within
roughly 2 standard deviations
(2*o/n) from our sample
mean .

In 95% of all possible samples
of this size n, will indeed fall
in our confidence interval.
In only 5% of samples would
be farther from .

o n

x

x
A confidence interval can be expressed as:
Mean m
m is called the margin of error
within m
Example: 120 6
Two endpoints of an interval
within ( m) to ( + m)
ex. 114 to 126
A confidence level C (in %)
represents the area under the
normal curve within m of the
center of the curve.
m m

x

x

x
Confidence intervals contain the population mean in C% of samples.
Different areas under the curve give different confidence levels C.
Example: For an 80% confidence level
C, 80% of the normal curves
area is contained in the interval.
C
z* z*
Varying confidence levels
Practical use of z: z*
z* is related to the chosen
confidence level C.
C is the area under the standard
normal curve between z* and z*.

x z *o n
The confidence interval is thus:
Link between confidence level and margin of error
The confidence level C determines the value of z*.
The margin of error also depends on z*.

m = z *o n
C
z* z*
m m
Higher confidence C implies a larger
margin of error m (thus less precision in
our estimates).

A lower confidence level C produces a
smaller margin of error m (thus better
precision in our estimates).
When o is unknown
When the sample size is large, the
sample is likely to contain elements
representative of the whole
population. Then s is a good
estimate of o.

Population
distribution
Small sample Large sample
But when the sample size is small,
the sample contains only a few
individuals. Then s is a mediocre
estimate of o.

The sample standard deviation s provides an estimate of the population
standard deviation o.
A study examined the effect of a new medication on the seated systolic
blood pressure. The results, presented as mean SEM for 25 patients,
are 113.5 8.9.
What is the standard deviation s of the sample data?
Standard deviation s standard error s/n
For a sample of size n,
the sample standard deviation s is:
n 1 is the degrees of freedom.

The value s/n is called the standard error of the mean SEM.
Scientists often present sample results as mean SEM.

=
2
) (
1
1
x x
n
s
i
SEM = s/n <=> s = SEM*n
s = 8.9*25 = 44.5
The t distributions
Suppose that an SRS of size n is drawn from an N(, ) population.
When o is known, the sampling distribution is N(, o/n).
When o is estimated from the sample standard deviation s, the
sampling distribution follows a t distribution t(, s/n) with degrees
of freedom n 1.

is the one-sample t statistic.

t =
x
s n
When n is very large, s is a very good estimate of o, and the corresponding t
distributions are very close to the normal distribution.

The t distributions become wider for smaller sample sizes, reflecting the lack
of precision in estimating o from s.
Standardizing the data before using Table D
Here, is the mean (center) of the sampling distribution,
and the standard error of the mean s/n is its standard deviation (width).
You obtain s, the standard deviation of the sample, with your calculator.
t

t =
x
s n
As with the normal distribution, the first step is to standardize the data. Then
we can use Table T to obtain the area under the curve.

s/n
t(,s/n)
df = n 1
t(0,1)
df = n 1

x
0
1
The one-sample t-confidence interval
The level C confidence interval is an interval with
probability C of containing the true population parameter.

We have a data set from a population with both and o
unknown. We use to estimate and s to estimate o,
using a t distribution (df=n1).
C
t* t*
m m

m = t * s n
Practical use of t : t*
C is the area between t* and t*.
We find t* in the line of Table T for
df = n1 and confidence level C.
The margin of error m is:

x
29
Finding t* and z* values from
table

A typical t-table is shown here.
The table shows the critical values
for varying degrees of freedom,
df, and for varying confidence
intervals.
Since the t-models get closer to
the normal as df increases, the
final row has critical values from
the Normal model and is labeled
.
2011 Pearson Education, Inc.
Red wine, in moderation
Drinking red wine in moderation may protect against heart attacks. The polyphenols it
contains act on blood cholesterol, likely helping to prevent heart attacks.

To see if moderate red wine consumption increases the average blood level of
polyphenols, a group of nine randomly selected healthy men were assigned to drink
half a bottle of red wine daily for two weeks. Their blood polyphenol levels were
assessed before and after the study, and the percent change is presented here:
Firstly: Are the data approximately normal?
0.7 3.5 4 4.9 5.5 7 7.4 8.1 8.4
Histogram
0
1
2
3
4
2.5 5 7.5 9 More
Percentage change in polyphenol
blood levels
F
r
e
q
u
e
n
c
y
There is a low value,
but overall the data
can be considered
reasonably normal.
0
1
2
3
4
5
6
7
8
9
P
e
r
c
e
n
t

c
h
a
n
g
e
-2 -1 0 1 2
Normal quantiles
What is the 95% confidence interval for the average percent
change?
The sample average=5.5, s=2.517, df=n-1=8
The sampling distribution is a t distribution with n 1 degrees of freedom.
For df = 8 and C = 95%, t* = 2.306 (see table T in the back of the book).
The margin of error m is: m = t*s/n = 2.306*2.517/9 1.93.
The 95% CI for the population mean is (5.5-1.93, 5.5+1.93)
With 95% confidence, the population average percent increase in
polyphenol blood levels of healthy men drinking half a bottle of red wine
daily is between 3.57% and 7.43%. Important: The confidence interval shows
how large the increase is, but not if it can have an impact on mens health.
The one-sample t-test
As in the previous chapter, a test of hypotheses requires a few steps:

1. Stating the null and alternative hypotheses (H
0
versus H
a
)
2. Deciding on a one-sided or two-sided test
3. Choosing a significance level o
4. Calculating t and its degrees of freedom
5. Finding the area under the curve with Table T
6. Stating the P-value and interpreting the result
n s
x
t
0

=
One-sided
(one-tailed)
Two-sided
(two-tailed)
The P-value is the probability, if H
0
is true, of randomly drawing a
sample like the one obtained or more extreme, in the direction of H
a
.

The P-value is calculated as the corresponding area under the curve,
one-tailed or two-tailed depending on H
a
:
Sweetening colas
Cola manufacturers want to test how much the sweetness of a new cola drink
is affected by storage. The sweetness loss due to storage was evaluated by 10
professional tasters (by comparing the sweetness before and after storage):
Taster Sweetness loss
1 2.0
2 0.4
3 0.7
4 2.0
5 0.4
6 2.2
7 1.3
8 1.2
9 1.1
10 2.3
Obviously, we want to test if
storage results in a loss of
sweetness, thus:

H
0
: = 0 versus H
a
: > 0
This looks familiar. However, here we do not know the population parameter o.
The population of all cola drinkers is too large.
Since this is a new cola recipe, we have no population data.

This situation is very common with real data.
Sweetening colas (continued)
Is there evidence that storage results in sweetness loss for the new cola
recipe at the 0.05 level of significance (o = 5%)?
H
0
: = 0 versus H
a
: > 0 (one-sided test)


The critical value t
o
= 1.833.
t > t
o
thus the result is significant or
2.262 < t = 2.70 thus 0.025 > p (see next page)
p < o thus the result is significant.
The t-test has a significant p-value. We reject H
0
.
There is a significant loss of sweetness, on average, following
storage.
Taster Sweetness loss
1 2.0
2 0.4
3 0.7
4 2.0
5 -0.4
6 2.2
7 -1.3
8 1.2
9 1.1
10 2.3
___________________________
Average 1.02
Standard deviation 1.196
Degrees of freedom n 1 = 9
0
1.02 0
2.70
1.196 10
x
t
s n

= = =
36
Finding t-Values by Hand

For our example, weve
performed a one-sample t-test
with 9 df and a value of 2.7, and
we want the upper tail P-value.

From the table, we see that 2.7 is
greater than 1.833 which is the
lower bound of the rejection
region. Also 2.7 falls between
2.262 and 2.821 (not shown
here). All we can say is that the P-
value lies between the P-values
of these two critical values, so
0.01 < Pvalue < 0.025.
One-Sample t-Test
2011 Pearson Education, Inc.
Robustness
The t procedures are exactly correct when the population is distributed
exactly normally. However, most real data are not exactly normal.
The t procedures are robust to small deviations from normality the
results will not be affected too much. Factors that strongly matter:
Random sampling. The sample must be an SRS from the population.
Outliers and skewness. They strongly influence the mean and
therefore the t procedures. However, their impact diminishes as the
sample size gets larger because of the Central Limit Theorem.
Specifically:
When n < 15, the data must be close to normal and without outliers.
When 15 < n < 40, mild skewness is acceptable but not outliers.
When n > 40, the t-statistic will be valid even with strong skewness.
Sample size
You may need a certain margin of error (e.g., drug trial, manufacturing
specs). If the population variability (o) is fixed then we can choose the
number of measurements (n).
So plan ahead what sample size to use to achieve that margin of error.

m = z *
o
n
n =
z *o
m
|
\

|
.
|
2
Remember, though, that sample size is not always stretchable at will. There are
typically costs and constraints associated with large samples. The best approach is to
use the smallest sample size that can give you useful results.
Sample size
You may need a certain margin of error (e.g., drug trial,
manufacturing specs). If the population variability (o) is not
known then we estimate it by s. The larger n the better the
estimate. The margin of error in this case becomes

m =
n1
*
t
o
n
n =
n1
*
t
o
m
|
\


|
.
|
|
2
But t* depends on n which we want to find, so t* is unknown. One common approach
is to use the corresponding z
*
value from the Normal model. If your estimated sample
size is 60 or more, your z
*
was probably a good guess. If its smaller, use z
*
at first,
finding n, and then replacing z
*
with the corresponding and calculating the
sample size once more (see example in the book).



n1
*
t
Sample Size Example
If o = 45, what sample size is needed to be
90% confident of being correct within 5?
(Always round up)

n =
z
2
o
2
m
2
=
1.645
2
(45)
2
5
2
= 219.19
So the required sample size is n = 220

S-ar putea să vă placă și