Oneway Classification

advertisement
Oneway Classification
yij = μ + αi + ij
|ȳp . − ȳq .|
tc =
sd
iff tc > tα/2,ν ν = N − t
μi
ij ∼ iid N (0, σ 2 )
j = 1, . . . , ni ,
equivalent to assuming yij ∼ N (μi , σ 2 ), j = 1, . . . , ni for each treatment i.
Also involves the assumption of homogeneity of variance i.e., same variance
in each population.
Rej. H0
Contrasts (or Comparisons)
i ai μi is said to be a contrast or comparison of means μ1 , μ2 , . . . , μt if
a1 , a2 , . . . , at are constants such that i ai = 0.
Examples:μ1 − μ2 , 2μ1 − μ2 − μ3 , μ1 − 13 μ2 − 13 μ4 − 13 μ5
Estimation
μ̂i = ȳi . = (
i = 1, . . . , t
j yij )/ni ,
(yij − ȳi. )2
, N = i ni
σ̂ 2 = s2 = i j
N −t
αp − αq = ȳp. − ȳq. , p = q
1
1
+
SE(ȳp. − ȳq. ) = sd = s
np nq
An estimate of a linear contrast of the means is given by the linear
contrast of the sample means i ai ȳi. where ai = 0.
Test for Preplanned (or a priori) Comparisons
(Equal Sample Size Case i.e., n1 = n2 = · · · = n)
H0 : i ai μi = 0 vs. Ha : i ai μi = 0 are:
A (1 − α)100% C.I. for αp − αq (or μp − μq .) is
A t-test using the statistic tc =
(ȳp. − ȳq. ) ± tα/2,ν · sd
|
i ai ȳi .|
2
An F-test using the statistic Fc =
tα/2,ν = upper α/2 percentage point of the t-distribution with ν d.f.
ν = N −t
Testing Hypotheses
ai
n
s(
or
where
n(
1
)2
Rej. H0 : if tc > tα/2,N −t
ai ȳi. )2 /(
s2
2
a)
i
Rej. H0 : if Fc > Fα,1,N −t
Pairwise Comparison of Means
Individual Comparisons:
AoV Table
SV
Trt
Error
Total
vs. Ha : αp = αq
H0 : α p = α q
Use the t-statistic
i = 1, 2, . . . , t,
vs. Ha : μp = μq or equivalently
Testing H0 : μp = μq
One Treatment (Factor) in a CRD; may be unequal replications
* By the t-test of H0 : μp = μq
d.f.
t−1
N −t
N −1
SS
MS
MSTrt
MSE(= s2 )
F
Fc = MSTrt /MSE
p-value
P r(F > Fc )
* By the C.I.’s for μp − μq
* Equivalently, using the Least Significance Difference (LSD) when sample sizes are equal.
t-test for H0 : μp − μq = 0 gives Rej: H0 if
|ȳp . − ȳq .| > tα/2,ν · s ·
The F-statistic tests
H0 : μ1 = μ2 = · · · μt vs. Ha : at least one ineq.
or equivalently
H0 : α1 = α2 = · · · = αt vs. Ha : at least one ineq.
Oneway Analysis of Covariance
One factor experiment in a CRD; a single covariate is also measured. Assume
equal replication.
i = 1, . . . , t
∼ iid N (0, σ 2 )
j = 1, . . . , n ij
yij = μ + τi + β(xij − x̄.. ) + ij
⇐⇒ Assuming straight line regressions for each treatment with the same slope β
Treatment 1:
Treatment 2:
y1j = α1 + βx1j + 1j
y2j = α2 + βx2j + 2j
..
.
Treatment t:
ytj = αt + βxtj + tj
,
,
,
j = 1, . . . , n
j = 1, . . . , n
..
.
j = 1, . . . , n
where αi = μ + τi − x̄..
2/n ,
n = sample size, ν = N − t
LSDα
Multiple Comparisons:
* Tukey’s procedure for all possible pairwise comparisons simultaneously
(HSD).
* Bonferroni conservative procedure for several comparisons (pairwise
and/or contrasts of the type ai μi ) simultaneously.
Testing Hypotheses
An analysis of covariance table
SV
df
Trt
t−1
Error(Unadj.) t(n − 1)
Regression
1
Error(Adj.) t(n − 1) − 1
Total
tn − 1
Trt(Adj.)
t−1
Error(Adj.) t(n − 1) − 1
SS
MS
SSTrt
MSTrt
SSEUnadj. MSEUnadj.
SSReg
MSReg
SSE
MSE(= s2 )
SSTot
SSTrt
MSTrt
SSE
MSE(= s2 )
F
MSTrt /MSEUnadj.
MSReg /MSE
MSTrt /MSE
The F -statistic for Trt tests the hypothesis
Estimation
μ̂i = ȳi. (Adj.) = ȳi − b(x̄i. − x̄.. ) ‘Adjusted Treatment Means’
Sxy =
Sxy
b=
Sxx
ȳi. =
Sxx =
i
j (xij
− x̄i. )(yij − ȳi. )
i
j (xij
− x̄i. )2
yij
n
j
σ̂ 2 = s2
x̄i. =
xij
n
j
x̄.. =
i
j
xij
nt
MS Error from the ‘Adjusted AoV’
(ȳp. (Adj.) − ȳq. (Adj.)) ± tα/2,ν · sd
sd = s
2 (x̄p. − x̄q. ) 2
+
n
Exx
and
ν = t(n − 1) − 1
H0 : β = 0 versus Ha : β = 0
The F -statistic for Trt(Adj.) tests the hypothesis
H0 : τ1 = τ2 = · · · = τt versus Ha : at least one inequality
when β is not zero. This test is equivalent to comparing the intercepts of the
regression lines i.e.,
A (1 − α) 100% C.I. for μp − μq is
where
H0 : μ1 = μ2 = · · · = μt versus Ha : at least one inequality
when the covariate is not present in the model. The F -statistic for Regression
tests the hypothesis
1/2
H0 : α1 = α2 = · · · = αt versus Ha : at least one inequality
If this hypothesis is rejected, then at least one pair of treatment effects (equivalently, adjusted treatment means) is different.
A Twoway Factorial in a CRD
Estimation
μ̂ij = ȳij. = (
Two Crossed Factors A, B in a completely randomized design is another
example of a twoway classification.
Model: yijk = μ + αi + βj + γij +ijk
yijk )/n
k
μ̄ˆi. = ȳi.. = (
i = 1, . . . , a (Factor A)
μij
j
j = 1, . . . , b (Factor B)
μ̄ˆ.j = ȳ.j. = (
k = 1, . . . , n (Replication)
yijk )/nb
k
i
yijk )/na
k
σ̂ 2 = s2 = MSE
ijk ∼ iid N (0, σ 2 )
μij = Expected mean in the ij th cell of the two classification.
SE (ȳi.. − ȳi .. ) = s 2/bn
SE (ȳ.j. − ȳ.j . ) = s 2/an
Levels of Factor B
1
2
.
Levels of ..
Factor A i
..
.
a
1
μ11
μ21
..
.
···
···
2
μ12
μ22
j
···
···
b
μ1b
μ2b
..
.
μ̄1.
μ̄2.
..
.
μ̄i.
..
.
μij
..
.
μa1
μ̄.1
..
.
···
···
μa2
μ.2
μ̄.j
···
···
μab
μ̄.b
A (1-α)100% CI for Treatment Mean Differences.
μ̄i. − μ̄i . : (ȳi.. − ȳi .. ) ± tα/2,ν · s ·
μ̄.j − μ̄.j : (ȳ.j. − ȳ.j . ± tα/2,ν · s ·
2/nb
2/na
ν = d.f. for MSE i.e.,ν = ab(n − 1)
μ̄a.
Figure 1: Means model: Cell means and marginal means
SE(ȳij. − ȳij . ) = s 2/n
A (1 − α)100% CI for cell mean diferences
μij − μij : (ȳij. − ȳij . ) ± tα/2,ν · s 2/n
SE(ȳij. − ȳi j. ) = s 2/n
A (1 − α)100% CI for cell mean differences
μij − μi j : (ȳij. − ȳi j. ) ± tα/2,ν · s 2/n
Oneway Random Model
Hypotheses Testing
Here we consider an experiment with one random factor.
Model:
The general model is given by
AoV Table
SV
Treatment
A
B
A*B
Error
Total
d.f.
SS
ab-1
a-1
b-1
(a-1)(b-1)
ab(n-1)
abn-1
MS
F
MSA
MSB
MSAB
MSE
MSA /MSE
MSB /MSE
MSAB /MSE
(1)
(2)
(3)
yij = μ + ai + ij
i = 1, . . . , a
j = 1, . . . , n
where the random effects ai , i = 1, . . . , a are assumed to be distributed
independently as N (0, σa2 ) random variables independently of the random
errors ij . As usual, the ij i = 1, . . . , a; j = 1, . . . , n are assumed to be
distributed independently as N (0, σ 2 ) random variables.
Hypothesis Testing:
F-tests
(1) Tests H0 : μ̄1. = μ̄2. = · · · = μ̄a. vs. Ha : at least one ineq.
(2) Tests H0 : μ̄.1 = μ̄.2 = · · · = μ̄.b vs. Ha : at least one ineq.
(3) Tests H0 : (μij − μ̄i. − μ̄.j + μ̄.. ) = 0 for all (i, j)
⇔ H0 : no interaction
SV
A
Error
Total
d.f.
a−1
a(n − 1)
an − 1
SS
SSA
SSE
AoV Table
MS
F
M SA
M SA /M SE
M SE(= s2 )
E(MS)
σ 2 + n σa2
σ2
The F-statistic from the analysis of variance table is used to test the hypothesis H0 : σa2 = 0 vs. Ha : σa2 > 0
Depending on whether the test for interaction is significant or not, we can
test hypotheses like
H0 : μ̄i. = μ̄i .
vs.
Ha : μ̄i. = μ̄i .
H0 : μ̄j = μ̄.j vs.
Ha : μ̄.j = μ̄.j H0 : μi = μij vs.
Ha : μij = μij H0 : μij = μi j
vs.
Ha : μij = μi j
Estimation:
As usual we estimate the error variance by the MSE
σ̂ 2 = s2
If the hypothesis H0 : σa2 = 0 is rejected in favor of Ha : σa2 > 0 we may also
estimate σa2 .
To do this equate the observed mean squares M SA to its Expected Value
(which is an algebraic expression):
or test any preplanned comparisons among the factor A means and/or factor
B means.
σ 2 + n σa2 = M SA ,
and solve for
σa2
which gives the result
M SA − σ̂ 2
n
where the right hand side consists only of numbers computed and are obtained from the Anova table. This method of estimation is called the method
of moments.
σ̂a2 =
Download