Lecture 11 - University of Pennsylvania

Download Report

Transcript Lecture 11 - University of Pennsylvania

Lecture 11
• One-way analysis of variance (Chapter
15.2)
Review: Relat. between OneSided Hypothesis Tests and CIs
• Suppose we are given a (1   )100% CI for 
• For the one-sided hypothesis test H0 :   0
versus H1 :   0 at significance level  / 2 ,
we can conclude
– We reject the null hypothesis if x  0 and 0
does not belong to the confidence interval
– We do not reject the null hypothesis if either x  0
or 0 belongs to the confidence interval.
Review: CIs for Monotonic
Functions of Parameters
• A function f(x) is monotonic if it moves in
one direction as its argument increases.
• Suppose that we have a CI ( L,U ) for a
parameter  and that we want to find a CI
for the parameter f ( ) .
• If f is monotonically increasing, the CI is
( f (L ), f (U .)) If f is monotonically decreasing,
the CI is ( f (U ), f (L ))
Review of one-way ANOVA
• Objective: Compare the means of K populations
of interval data based on independent random
samples from each.
• H0: 1  2    K
• H1: At least two means differ
• Notation: xij – ith observation of jth sample;
x j - mean of the jth sample; n – number of
j
observations in jth sample; x - grand mean of all
observations
Example 15.1
• The marketing manager for an apple juice manufacturer needs to
decide how to market a new product. Three strategies are considered,
which emphasize the convenience, quality and low price of product
respectively.
• An experiment was conducted as follows:
• In three cities an advertisement campaign was launched .
• In each city only one of the three characteristics (convenience,
quality, and price) was emphasized.
• The weekly sales were recorded for twenty weeks following
the beginning of the campaigns.
Rationale Behind Test Statistic
• Two types of variability are employed when
testing for the equality of population means
– Variability of the sample means
– Variability within samples
• Test statistic is essentially (Variability of the
sample means)/(Variability within samples)
The rationale behind the test statistic – I
• If the null hypothesis is true, we would
expect all the sample means to be close to
one another (and as a result, close to the
grand mean).
• If the alternative hypothesis is true, at least
some of the sample means would differ.
• Thus, we measure variability between
sample means.
Variability between sample means
• The variability between the sample means is
measured as the sum of squared distances
between each mean and the grand mean.
This sum is called the
Sum of Squares for Treatments
SST
In our example treatments are
represented by the different
advertising strategies.
Sum of squares for treatments (SST)
k
SST   n j ( x j  x)
2
j 1
There are k treatments
The size of sample j
The mean of sample j
Note: When the sample means are close to
one another, their distance from the grand
mean is small, leading to a small SST. Thus,
large SST indicates large variation between
sample means, which supports H1.
Sum of squares for treatments (SST)
• Solution – continued
Calculate SST
x1  577.55 x 2  653.00 x 3  608.65
k
SST   n j ( x j  x) 2
j 1
The grand mean is calculated by
n1x1  n2 x 2  ... nk x k
X
n1  n2  ... nk
= 20(577.55 - 613.07)2 +
+ 20(653.00 - 613.07)2 +
+ 20(608.65 - 613.07)2 =
= 57,512.23
Sum of squares for treatments (SST)
Is SST = 57,512.23 large enough to
reject H0 in favor of H1?
Large compared to what?
30
25
x 3  20
20
x 2  15
16
15
14
11
10
9
x 3  20
20
19
x 2  15
x1  10
12
10
9
x1  10
7
A small variability within
the samples makes it easier
Treatment 1 Treatment 2 Treatment 3
to draw a conclusion about the
population means.
The
1 sample means are the same as before,
but the larger within-sample variability
Treatment 1
Treatment 2 Treatment 3
makes it harder to draw a conclusion
about the population means.
The rationale behind test statistic – II
• Large variability within the samples
weakens the “ability” of the sample means
to represent their corresponding population
means.
• Therefore, even though sample means may
markedly differ from one another, SST must
be judged relative to the “within samples
variability”.
Within samples variability
• The variability within samples is measured
by adding all the squared distances between
observations and their sample means.
This sum is called the
Sum of Squares for Error
SSE
In our example this is the
sum of all squared differences
between sales in city j and the
sample mean of city j (over all
the three cities).
Sum of squares for errors (SSE)
• Solution – continued
Calculate SSE
s12  10,775.00 s22  7,238,11 s32  8,670.24
k
SSE 
nj

(xij  x j ) 2 (n1 - 1)s12 + (n2 -1)s22 + (n3 -1)s32
j 1 i 1
= (20 -1)10,774.44 + (20 -1)7,238.61+ (20-1)8,670.24
= 506,983.50
Sum of squares for errors (SSE)
Is SST = 57,512.23 large enough
relative to SSE = 506,983.50 to
reject the null hypothesis that
specifies that all the means are
equal?
The mean sum of squares
To perform the test we need to calculate
the mean squares as follows:
Calculation of MST Mean Square for Treatments
SST
k 1
57,512.23

3 1
 28,756.12
MST 
Calculation of MSE
Mean Square for Error
SSE
nk
509,983.50

60  3
 8,894.45
MSE 
The F test rejection region
And finally the hypothesis test:
H0: 1 = 2 = …=k
H1: At least two means differ
MST
Test statistic: F
MSE
R.R: F>F,k-1,n-k
The F test
MST
MSE
28,756.12

8,894.17
 3.23
F
Ho: 1 = 2= 3
H1: At least two means differ
Test statistic F= MST/ MSE= 3.23
R.R. : F  Fk 1nk  F0.05,31,603  3.15
Since 3.23 > 3.15, there is sufficient evidence
to reject Ho in favor of H1, and argue that at least one
of the mean sales is different than the others.
Required Conditions for Test
• Independent simple random samples from each
population
• The populations are normally distributed (look for
extreme skewness and outliers, probably okay
regardless if each n j  30 ).
• The variances of all the populations are equal
(Rule of thumb: Check if largest sample standard
deviation is less than twice the smallest standard
deviation)
ANOVA Table – Example 15.1
Analysis of Variance
Source
DF
Sum of
Squares
Mean
Square
F Ratio
Prob > F
City
2
57512.23
28756.1
3.2330
0.0468
Error
57
506983.50
8894.4
C.
Total
59
564495.73
Model for ANOVA
• X ij = ith observation of jth sample
• X     
ij
j
ij
•  is the overall mean level,  j is the differential
effect of the jth treatment and  ij is the random
error in the ith observation under the jth treatment.
The errors are assumed to be independent,
2
normally distributed with mean
zero
and
variance

K
The  j are normalized:  j1 j  0
Model for ANOVA Cont.
• The expected response to the jth treatment is
E( X ij )     j
• Thus, if all treatments have the same expected
response (i.e., H0 : all populations have same
mean),  j  0, for j  1,, K . In general,  j   j ' is
the difference between the means of population j
and j’.
• Sums of squares decomposition:
SS(Total)=SST+SSE
Relationship between F-test and
t-test for two samples
• For comparing two samples, the F-statistic
equals the square of the t-statistic with equal
variances.
• For two samples, the ANOVA F-test is
equivalent to testing H0 : 1  2 versus
H1 : 1  2 .
Practice Problems
• 15.16, 15.22, 15.26
• Next Time: Chapter 15.7 (we will return to
Chapters 15.3-15.5 after completing
Chapter 15.7).