Chapter 3 Analysis of Variance (ANOVA; ”””†††óóó555ŠŠŠ...Relation between...
Transcript of Chapter 3 Analysis of Variance (ANOVA; ”””†††óóó555ŠŠŠ...Relation between...
Chapter 3 Analysis of Variance
(ANOVA;變變變異異異數數數分分分析析析)
許湘伶
Applied Linear Regression Models(Kutner, Nachtsheim, Neter, Li)
Chapter 16Design and Analysis of Experiments
(Douglas C. Montgomery)
hsuhl (NUK) DAE Chap. 3 1 / 84
Part I
Supplement
hsuhl (NUK) DAE Chap. 3 2 / 84
Relation between Regression and Analysis of Variance
Regression model:
yi = β0 + β1X1i + · · ·+ βkXki + εi, i = 1, . . . , n
ANOVA Model or One-way model:
yij = µi + εij = µ+ τi + εij,
{i = 1, . . . , aj = 1, . . . , n
hsuhl (NUK) DAE Chap. 3 3 / 84
Relation between Regression and Analysis of Variance (cont.)
Analysis of variance models differ from ordinary regression models intwo key respects:
1 The explanatory or predictor variables in ANOVA models may bequalitative.
2 If the predictor variables are quantitative, no assumption is madein ANOVA models about the nature of the statistical relationbetween Xs and Y .
hsuhl (NUK) DAE Chap. 3 4 / 84
Relation between Regression and Analysis of Variance (cont.)
hsuhl (NUK) DAE Chap. 3 5 / 84
Relation between Regression and Analysis of Variance (cont.)
When indicator variables are so used with regression models, theregression results will be identical to those obtained with ANOVAmodels.
ANOVA models and regression models with indicator variableswill lead to identical results.
hsuhl (NUK) DAE Chap. 3 6 / 84
Relation between Regression and Analysis of Variance (cont.)
Figure : Regression model
Figure : Figure 16.4 Illustration of Partitioning of Total Deviations Yij − Y··hsuhl (NUK) DAE Chap. 3 7 / 84
Part II
Chapter 3 The Analysis of Variance
hsuhl (NUK) DAE Chap. 3 8 / 84
Outline
1 Example2 The analysis of variance3 Analysis of the fixed effects model4 Model adequacy checking5 Practical interpretation of results6 Sample computer output7 Determining sample size8 Other example of single-factor experiments9 The random effect model10 The regression approach to the ANOVA11 Nonparametric methods in the ANOVA
hsuhl (NUK) DAE Chap. 3 9 / 84
Example
methods for the design and analysis of single-factor experimentswith a levels of the factor (or a treatments)
Assume: completely randomized
wafer(晶片)Relationship: RF powersetting vs. the etch rate(蝕刻速率)
I RF power: 4 levels:160, 180, 200, 220 W
I 蝕刻速率: 測量物質從晶圓表面被移除的的速率有多快
n = 5 replicates- 20 runs inrandom order
hsuhl (NUK) DAE Chap. 3 10 / 84
Example (cont.)
hsuhl (NUK) DAE Chap. 3 11 / 84
Example (cont.)
no strong evidence to suggest that the variability in the etch ratearound the average depends on the power setting
Test: differences between the mean etch rates at a = 4 levels ofRF power
1 t-test for all six possible pairs of means: inflates the type I error2 the analysis of variance
hsuhl (NUK) DAE Chap. 3 12 / 84
ANOVA
a treatments of a single factor
yij: the jth observation taken under treatment i
means model:
yij = µi + εij
{i = 1, 2, . . . , aj = 1, 2, . . . , n
hsuhl (NUK) DAE Chap. 3 13 / 84
ANOVA (cont.)
Model:
yij = µi + εij
{i = 1, 2, . . . , aj = 1, 2, . . . , n
mean model
= µ+ τi + εij effect model
yij: the ij observationµi: the mean of the ith factor levelµ: overall meanτi: the ith treatment effectεij: the random error component; sources of variability
I measurementI variability from uncontrolled factorsI differences between the experimental unitI noise in the process
hsuhl (NUK) DAE Chap. 3 14 / 84
ANOVA (cont.)
yij = µi + εij
{i = 1, 2, . . . , aj = 1, 2, . . . , n
mean model
= µ+ τi + εij effect model
linear statistical models
one-way or single-factor analysis of variance model (單因子變異數分析)
the effect model is more widely encountered in the experimentaldesign literatureobject:
I test hypotheses about the treatment meansI estimate model parameters: (µ, τi, σ
2)
εij ∼ NID(0, σ2)⇒ yij ∼ N(µ+ τi, σ2)
hsuhl (NUK) DAE Chap. 3 15 / 84
ANOVA (cont.)
fixed effects model (固定效應模型): chosen by experimenter
random effects model (隨機效應模型; components of variancemodel變異數成分模型): (Chap. 3.9; Chap. 13)a treatment could be a random sample from a larger population oftreatments
hsuhl (NUK) DAE Chap. 3 16 / 84
Notation
yi·: the average of the observations under the ith treatment
y··: the grand total of all the observations
y··: the grand average of all the observations
yi· =n∑
j=1
yij yi· = yi·/n i = 1, 2, . . . , a
y·· =a∑
i=1
n∑j=1
yij y·· = y··/N, N = an
hsuhl (NUK) DAE Chap. 3 17 / 84
Testing
Testing the equality of the a treatment means E(yij) = µ+ τi = µi:
Hypothesis: {H0: µ1 = µ2 = · · · = µa
Ha: µi 6= µj for at least one pair (i, j)
⇔{
H0: τ1 = τ2 = · · · = τa= 0Ha: τi 6= 0 for at least one i
∵
∑ai=1 µi
a= µ ⇔
a∑i=1
τi = 0
The appropriate procedure for testing the equality of a treatmentmeans is the analysis of variance.
hsuhl (NUK) DAE Chap. 3 18 / 84
Testing (cont.)
hsuhl (NUK) DAE Chap. 3 19 / 84
Decomposition of the Total Sum of Squares
ANOVA: derived from a partitioning of total variability into itscomponent parts
1 SST : the total corrected sum of squares2 SSTreatment: the sum of squares due to treatments (between
treatment)3 SSE: the sum of squares due to error (within treatments)
SST(N−1)
=a∑
i=1
n∑j=1
(yij − y··)2
= na∑
i=1
(yi· − y··)2 +a∑
i=1
n∑j=1
(yij − yi·)2
= SSTreatment(a−1)
+ SSE(N−a)
hsuhl (NUK) DAE Chap. 3 20 / 84
Decomposition of the Total Sum of Squares (cont.)
SST(N−1)
=a∑
i=1
n∑j=1
(yij − y··)2 = na∑
i=1
(yi· − y··)2 +a∑
i=1
n∑j=1
(yij − yi·)2
= SSTreatment(a−1)
+ SSE(N−a)
hsuhl (NUK) DAE Chap. 3 21 / 84
Decomposition of the Total Sum of Squares (cont.)
Total variability: can be partitioned into1 the total corrected sum of squares
SST =
a∑i=1
n∑j=1
(yij − y··)2 =
a∑i=1
n∑j=1
y2ij −
y2··
N
2 a sum of squares of the differences between the treatment averageand the grand average
SSTreatment = na∑
i=1
(yi· − y··)2 =1n
a∑i=1
y2i· −
y2··
N
3 a sum of squares of the differences of observation withintreatments from the treatment average
SSE =
a∑i=1
n∑j=1
(yij − yi·)2 = SST − SSTreatment
hsuhl (NUK) DAE Chap. 3 22 / 84
Decomposition of the Total Sum of Squares (cont.)
1 a pooled estimate of the common variance within each of the atreatments
SSE
N − a
2 an estimate of σ2 if µis are all equal
SSTreatment
a− 1
3 ANOVA identity: provide two estimated of σ2
hsuhl (NUK) DAE Chap. 3 23 / 84
Decomposition of the Total Sum of Squares (cont.)
Error mean square (MSE;誤差均方):
1 MSE =SSE
N − a2 E(MSE) = σ2
Treatment mean square (處理均方):
1 MSTreatment =SSTreatment
a− 1
2 E(MSTreatment) = σ2 +n∑a
i=1 τ2i
a− 13 if there are no differences in treatment means (i.e. τi = 0),
MSTreatment also estimate σ2
A test of hypothesis of no difference in treatment means can beperformed by comparing METreatment and MSE
hsuhl (NUK) DAE Chap. 3 24 / 84
Statistical Analysis
Assumptions
εij ∼ NID(0, σ2)⇒ yij ∼ NID(µ+ τi, σ2)
Cochran’s Theorem
SST : a sum of squares in normally distributed r.v.1 SST/σ
2 ∼ χ2N−1
2 SSTreatment/σ2 ∼ χ2
a−1 if H0 : τi = 0 is true3 SSE/σ
2 ∼ χ2N−a
4 SSTreatment/σ2 and SSE/σ
2 are independent χ2 r.v.
⇒ test statistic: F0 =SSTreatment/(a− 1)
SSE/(N − a)=
MSTreatment
MSE
H0∼ Fa−1,N−a
hsuhl (NUK) DAE Chap. 3 25 / 84
Statistical Analysis (cont.)
Cochran’s Theorem
Let Zi ∼ NID(0, 1), i = 1, . . . , ν, and
ν∑i=1
Z2i =
s∑i=1
Qi,
where s ≤ ν and Qi has νi d.f. (i = 1, . . . , s). Then Qi, ı =
1, . . . , s are independent χ2νi
r.v., if and only if
ν =s∑
i=1
νi
hsuhl (NUK) DAE Chap. 3 26 / 84
Statistical Analysis (cont.)
If H0 is false, MSTreatment > MSE
⇒ reject H0 if F0 is too large, i.e., F0 > Fα,a−1,N−a
ANOVA table:
hsuhl (NUK) DAE Chap. 3 27 / 84
Statistical Analysis (cont.)
The Plasma Etching Experiment
H0 : µ1 = µ2 = µ3 = µ4 vs. H1 : some means are different
hsuhl (NUK) DAE Chap. 3 28 / 84
Statistical Analysis (cont.)
## ANOVA tableetch$FRF <- as.factor(etch$RF)etch.aov <- aov(rate˜FRF,data=etch)summary(etch.aov)
Df Sum Sq Mean Sq F value Pr(>F)FRF 3 66870.55 22290.18 66.80 0.0000Residuals 16 5339.20 333.70
F0 > F(0.99, 3, 16) = 5.29
hsuhl (NUK) DAE Chap. 3 29 / 84
Estimation of the Model Parameters
Model:
yij = µ+ τi + εij
{i = 1, . . . , aj = 1, . . . , n
Parameter: µ, τi, σ2
Estimates: (Least Squares Estimation)I overall mean: µ = y··I treatment effect: τi = yi· − y··, i = 1, . . . , aI µi: µi = µ+ τi = yi·I σ2: σ2 = MSE
hsuhl (NUK) DAE Chap. 3 30 / 84
Estimation of the Model Parameters (cont.)
εij ∼ NID(0, σ2)⇒ yi· ∼ N(µi, σ2/n)
100(1− α)% Confidence interval:
yi· − tα/2,N−a
√MSE
n≤µi ≤ yi· + tα/2,N−a
√MSE
n
yi· − yj· − tα/2,N−a
√2MSE
n≤ µi−µj ≤ yi· − yj· + tα/2,N−a
√2MSE
n
hsuhl (NUK) DAE Chap. 3 31 / 84
Estimation of the Model Parameters (cont.)
Ex 3.3
overall mean: µ = 617.75
treatment effect:
i 1 2 3 4RF power 160 180 200 220
τi -66.55 -30.35 7.65 89.25
95% confidence interval for µ4: (one-at-a-time)
689.6815 ≤ µ4 ≤ 724.3185
Bonferroni method: correct level α/2r
hsuhl (NUK) DAE Chap. 3 32 / 84
Unbalanced data
ni observations under treatment i (i = 1, . . . , a)
N =∑a
i=1 ni: total sample size
SST =a∑
i=1
ni∑j=1
y2ij −
y2··
N
SSTreatment =a∑
i=1
y2i·
ni− y2
··N
hsuhl (NUK) DAE Chap. 3 33 / 84
Model Adequacy Checking
yij: estimate of yij
yij = µ+ τi = yi·
residual eij: investigating violations of the basic assumptions andmodel adequacy
eij = yij − yij
I The checking should be automaticI Model is adequate⇒ eijs should be structurelessI graphical analysisI how to deal with commonly occurring abnormalities
standardized residual: dij =eij√MSE
hsuhl (NUK) DAE Chap. 3 34 / 84
Model Adequacy Checking (cont.)
Residual plot## Residual plotopar <- par(mfrow=c(2,2),cex=.8)plot(etch.aov)par(opar)
hsuhl (NUK) DAE Chap. 3 35 / 84
Model Adequacy Checking (cont.)
hsuhl (NUK) DAE Chap. 3 36 / 84
Model Adequacy Checking (cont.)
eij vs. time: independence assumption
eij vs. yij: nonconstant variance-variance-stabilizingtransformation
hsuhl (NUK) DAE Chap. 3 37 / 84
Statistical Tests for Equality of Variance
Bartlett’s test:
H0 :σ21 = σ2
2 = · · · = σ2a
Ha : above not true for at least on σ2i
a modification of the corresponding likelihood ratio test designedto make the approximation to the χ2 distribution better (Bartlett,1937)
very sensitive to the normality assumption
log10(e) = 2.3026
hsuhl (NUK) DAE Chap. 3 38 / 84
Statistical Tests for Equality of Variance (cont.)
Test statistic:
χ20= 2.3026
qc
H0∼ χ2a−1
q = (N − a) log10 S2p −
a∑i=1
(ni − 1) log10 S2i
c = 1 +1
3(a− 1)
(a∑
i=1
(ni − 1)−a − (N − a)−1
)
S2p =
∑ai=1(ni − 1)S2
i
N − a
Reject H0: χ20 > χ2
α,a−1
hsuhl (NUK) DAE Chap. 3 39 / 84
Statistical Tests for Equality of Variance (cont.)
> bartlett.test(rate˜RF,data=etch)
Bartlett test of homogeneity of variances
data: rate by RFBartlett’s K-squared = 0.4335, df = 3, p-value = 0.9332
> qchisq(0.95,3)[1] 7.814728
hsuhl (NUK) DAE Chap. 3 40 / 84
Statistical Tests for Equality of Variance (cont.)
Modified Levene test:
robust to departures from normality
considering the absolute deviation of yij from the treatmentmedian yi·:
dij = |yij − yi·|{
i = 1, 2, . . . , aj = 1, 2, . . . , n
The test statistic for Levene’s test is simply the usual ANOVA Fstatistic for testing equality of means applied to the absolutedeviations
hsuhl (NUK) DAE Chap. 3 41 / 84
Statistical Tests for Equality of Variance (cont.)
Peak Discharge Data
hsuhl (NUK) DAE Chap. 3 42 / 84
Statistical Tests for Equality of Variance (cont.)
hsuhl (NUK) DAE Chap. 3 43 / 84
Statistical Tests for Equality of Variance (cont.)
> library(lawstat)> peak.aov<-aov(Observ˜as.factor(Method),data=peak)> summary(peak.aov)
Df Sum Sq Mean Sq F value Pr(>F)as.factor(Method) 3 708.3 236.1 76.07 4.11e-11 ***Residuals 20 62.1 3.1---Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1> leveneTest(peak$Observ,as.factor(peak$Method))Levene’s Test for Homogeneity of Variance (center = median)
Df F value Pr(>F)group 3 4.5684 0.01357 *
20---Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
hsuhl (NUK) DAE Chap. 3 44 / 84
Statistical Tests for Equality of Variance (cont.)
Transformation: y∗ij =√yij
hsuhl (NUK) DAE Chap. 3 45 / 84
Statistical Tests for Equality of Variance (cont.)
Formal method: Box-Cox Method## Box-Cox Methodlibrary(MASS)boxcox(Observ ˜ Method, data = peak,lambda = seq(-1, 1, length = 10))
hsuhl (NUK) DAE Chap. 3 46 / 84
Comparing Among Treatment Means
ANOVA:
reject H0 ⇒ differences between the treatment means
which means differ is not specifiedmultiple comparison methods
yi· ∼ N(µi, σ2/n), σ2 = MSE
⇒µ1 6= µ2 6= µ3 6= µ4
hsuhl (NUK) DAE Chap. 3 47 / 84
Contrasts(對對對比比比)
200W and 220W produce the same etch rate:
H0 : µ3 = µ4
H1 : µ3 6= µ4⇔ H0 : µ3 − µ4 = 0
H1 : µ3 − µ4 6= 0
the average of the lowest levels of power did not differ from theaverage of the highest levels of power:
H0 : µ1 + µ2 = µ3 + µ4
H1 : µ1 + µ2 6= µ3 + µ4⇔ H0 : µ1 + µ2 − µ3 − µ4 = 0
H1 : µ1 + µ2 − µ3 − µ4 6= 0
hsuhl (NUK) DAE Chap. 3 48 / 84
Contrasts(對對對比比比) (cont.)
contrast: a linear combination of parameters
Γ =a∑
i=1
ciµi
c1, . . . , ca: contrast constants sum to zero⇒∑a
i=1 ci = 0
H0 :∑a
i=1 ciµi = 0H1 :
∑ai=1 ciµi 6= 0
1 c1 = 0 = c2, c3 = 1, c4 = −12 c1 = 1 = c2, c3 = −1 = c4
hsuhl (NUK) DAE Chap. 3 49 / 84
Contrasts(對對對比比比) (cont.)
Testing Hypotheses involving contrast: t-test and F test
Sample sizes are different:
a∑i=1
nici = 0
treatment average:
C =a∑
i=1
ciyi·
V(C) = σ2a∑
i=1
c2i
ni
hsuhl (NUK) DAE Chap. 3 50 / 84
Contrasts(對對對比比比) (cont.)
Under H0:
t statistic: t0 =
∑ai=1 ciyi·√
MSE∑a
i=1c2
ini
∼ tN−a
⇒Reject H0 if |t0| ≥ tα/2,N−a
F statistic: F0 = t20 =
(∑a
i=1 ciyi·)2
MSE∑a
i=1c2
ini
=MSC
MSE∼ F1,N−a
⇒Reject H0 if |F0| ≥ Fα,1,N−a
contrast sum of squares:
SSC =(∑a
i=1 ciyi·)2∑a
i=1c2
ini
(d.f.=1)
hsuhl (NUK) DAE Chap. 3 51 / 84
Contrasts(對對對比比比) (cont.)
C.I. for a contrast:
a∑i=1
ciyi· − tα/2,N−a
√√√√MSE
a∑i=1
c2i
ni≤
a∑i=1
ciµi ≤a∑
i=1
ciyi· + tα/2,N−a
√√√√MSE
a∑i=1
c2i
ni
Orthogonal Contrasts:
Two contrasts with coefficients: {ci}, {di},
orthogonal ifa∑
i=1
nicidi = 0
Coefficients forTreatment Orthogonal Contrasts1(control) -2 02(level 1) 1 -13(level 2) 1 1
hsuhl (NUK) DAE Chap. 3 52 / 84
Contrasts(對對對比比比) (cont.)
For a treatments, the set of a− 1 orthogonal contrasts partitionthe sum of squares due to treatments into a− 1 independentsingle-degree-of-freedom components.
Tests performed on orthogonal contrasts are independent.
many ways to choose the orthogonal contrast coefficients
hsuhl (NUK) DAE Chap. 3 53 / 84
Contrasts(對對對比比比) (cont.)
Example 3.6: plasma etching experiment
> cont.matrix<-matrix(c(1,-1,0,0,1,1,-1,-1,0,0,1,-1),byrow=T,ncol =4)> effect<-aggregate(etch$rate, list(etch$FRF), mean)> Ci<-effect$x%*%t(cont.matrix)> Sci2<-apply(cont.matrixˆ2,1,sum)> Ciˆ2/(Sci2/5)
[,1] [,2] [,3][1,] 3276.1 46948.05 16646.4
hsuhl (NUK) DAE Chap. 3 54 / 84
Sheffe Method for Comparing all Contrasts
a method for comparing any and all possible contrasts betweentreatment means
Type I error is at most α
a set of m contrasts:
Γu = c1uµ1 + c2uµ2 + · · ·+ cauµa, u = 1, 2, . . . ,m
⇒Cu = c1uy1· + c2uy2· + · · ·+ cauya·
Standard error:
SCu =
√√√√MSE
a∑i=1
(c2iu/ni)
hsuhl (NUK) DAE Chap. 3 55 / 84
Sheffe Method for Comparing all Contrasts (cont.)
Critical value against which Cu:
Sα,u = SCu
√(a− 1)Fα,a−1,N−a
Reject Γu = 0 if |Cu| > Sα,u
Simultaneous C.I. for all contrasts among treatment means:
Cu − Sα,u ≤ Γu ≤ Cu + Sα,u
hsuhl (NUK) DAE Chap. 3 56 / 84
Sheffe Method for Comparing all Contrasts (cont.)
plasma etching experiment
Γ1 = µ1 + µ2 − µ3 − µ4; Γ2 = µ1 − µ4
i 1 2Ci -193.80 -155.80SCi 16.34 11.55S0.01,i 65.10 46.03
⇒ conclude Γi 6= 0
MSE<-summary(etch.aov)[[1]][2,3]cont.matrix2<-matrix(c(1,1,-1,-1,1,0,0,-1),byrow=T,ncol =4)Ci2<-effect$x%*%t(cont.matrix2)SCi2<-sqrt(MSE*apply(cont.matrixˆ2/5,1,sum))CVSi<-SCi2*sqrt((4-1)*qf(1-0.01,3,16))xtable(rbind(Ci2,SCi2,CVSi))
hsuhl (NUK) DAE Chap. 3 57 / 84
Comparing Pairs of Treatment Means
Γ = µi − µj, i ≤ j
Scheffe method is not the most sensitive procedure
Tukey’s Test:
H0 : µi = µj vs. H1 : µi 6= µj
the distribution of the studentized range statistic
q =ymax − ymin√
MSE/n
qα(p, f ): appendix VII;
f the number of d.f. with MSE; p: a group of p sample means
hsuhl (NUK) DAE Chap. 3 58 / 84
Comparing Pairs of Treatment Means (cont.)
Tukey’s Test: a procedure for testing hypotheses for which the overallsignificance level is exactly α when nis are equal; at most α when nisare unequal.
two means significantly different if
|yi· − yj·| > Tα = qα(a, f )
√MSE
n
C.I.: i 6= j
yi· − yj· −qα(a, f )√
2
√MSE
(1ni
+1nj
)≤ µi − µj
≤ yi· − yj· +qα(a, f )√
2
√MSE
(1ni
+1nj
)hsuhl (NUK) DAE Chap. 3 59 / 84
Comparing Pairs of Treatment Means (cont.)
The Tukey procedure indicates that All pairs of means differ.
> TukeyHSD(etch.aov)Tukey multiple comparisons of means
95% family-wise confidence level
Fit: aov(formula = rate ˜ FRF, data = etch)
$FRFdiff lwr upr p adj
180-160 36.2 3.145624 69.25438 0.0294279200-160 74.2 41.145624 107.25438 0.0000455220-160 155.8 122.745624 188.85438 0.0000000200-180 38.0 4.945624 71.05438 0.0215995220-180 119.6 86.545624 152.65438 0.0000001220-200 81.6 48.545624 114.65438 0.0000146> plot(TukeyHSD(etch.aov),las=1)
hsuhl (NUK) DAE Chap. 3 60 / 84
Comparing Pairs of Treatment Means (cont.)
hsuhl (NUK) DAE Chap. 3 61 / 84
The Fisher Least Significant Difference (LSD) Method
LSD:費雪爾最小顯著差異法
H0 : µi = µj
t statistic: t0 =yi· − yj·√
MSE
(1ni
+ 1nj
)significant differ if
|yi· − yj·| > LSD = tα/2,N−a
√MSE
(1ni
+1nj
)
LSD= tα/2,N−a
√MSE
(1ni
+ 1nj
): least significant difference
the overall α risk may be considerably inflatedhsuhl (NUK) DAE Chap. 3 62 / 84
The Fisher Least Significant Difference (LSD) Method (cont.)
> library(agricolae)> lsd2<-LSD.test(etch.aov,"FRF",group=F) # without grouping> lsd2$statistics
Mean CV MSerror617.75 2.957095 333.7
$parametersDf ntr t.value16 4 2.119905
$meansrate std r LCL UCL Min Max
160 551.2 20.01749 5 533.8815 568.5185 530 575180 587.4 16.74216 5 570.0815 604.7185 565 610200 625.4 20.52559 5 608.0815 642.7185 600 651220 707.0 15.24795 5 689.6815 724.3185 685 725
$comparison
hsuhl (NUK) DAE Chap. 3 63 / 84
The Fisher Least Significant Difference (LSD) Method (cont.)
Difference pvalue sig. LCL UCL160 - 180 -36.2 6.416224e-03 ** -60.69202 -11.70798160 - 200 -74.2 8.438627e-06 *** -98.69202 -49.70798160 - 220 -155.8 3.728560e-10 *** -180.29202 -131.30798180 - 200 -38.0 4.624381e-03 ** -62.49202 -13.50798180 - 220 -119.6 1.693894e-08 *** -144.09202 -95.10798200 - 220 -81.6 2.683834e-06 *** -106.09202 -57.10798
$groupsNULL
hsuhl (NUK) DAE Chap. 3 64 / 84
Which pairwise comparison method do I use?
No clear cut(明確的) answer to this question
Carmer & Swanson (1973): Monte Carlo simulation studiesI LSD is a very effective test for detecting true differences in means
if it applied only after the F test in the ANOVA is significant at 5percent
I But LSD does not contain the experimentwise error rate(實驗誤差率)
I Tukey method does control the overall error rate
Other multiple comparison procedures are recommended inliteratures.
hsuhl (NUK) DAE Chap. 3 65 / 84
Comparing Treatment Means with a Control
Comparing each of the other a− 1 treatment means with thecontrol
H0 : µi = µa H1 : µi 6= µa
Dunnett’s procedure(鄧奈特): a modification of the t-test
reject H0 if |yi· − ya·| > dα(a− 1, f )
√MSE
(1ni
+1na
)dα(a− 1, f ) in Appendix Table VIII
α: the joint significance level
hsuhl (NUK) DAE Chap. 3 66 / 84
Comparing Treatment Means with a Control (cont.)
##Dunnett’s Procedure> K <- rbind( "160 - 220" = c( 1, 0, 0, -1),+ "180 - 220" = c( 0, 1, 0, -1),+ "200 - 220" = c( 0, 0, 1, -1))>> dunnett2 <- glht(etch.aov,linfct=mcp(FRF=K))> summary(dunnett2)
Simultaneous Tests for General Linear Hypotheses
Multiple Comparisons of Means: User-defined Contrasts
Fit: aov(formula = rate ˜ FRF, data = etch)
Linear Hypotheses:Estimate Std. Error t value Pr(>|t|)
160 - 220 == 0 -155.80 11.55 -13.485 < 1e-06 ***180 - 220 == 0 -119.60 11.55 -10.352 < 1e-06 ***
hsuhl (NUK) DAE Chap. 3 67 / 84
Comparing Treatment Means with a Control (cont.)
200 - 220 == 0 -81.60 11.55 -7.063 1.93e-06 ***---Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1(Adjusted p values reported -- single-step method)
more observations for the control treatment than other treatment
Choose na/n =√
a
hsuhl (NUK) DAE Chap. 3 68 / 84
Determing Sample Size
Operating Characteristic Curves (OC curve;操作特徵曲線): a plotof the type II error probability
Appendix, Table V: β vs. Φ (Φ2 =n∑a
i=1 τ2i
aσ2 )
hsuhl (NUK) DAE Chap. 3 69 / 84
Determing Sample Size (cont.)
Used to guide the experimenter in selecting the number ofreplicates so that the design will be sensitive to importantpotential differences in the treatments.
Type II error of the fixed effects model:
β = 1−P{Reject H0|H0 is false} = 1−P{F0 > Fα,a−1,N−a|H0 is false}
the test statistic F0 if H0 is false:
F0 =MSTreatment
MSE
H0 is false∼ noncentral F with a− 1,N − a, δ
Φ2 is related to δ
hsuhl (NUK) DAE Chap. 3 70 / 84
Determing Sample Size (cont.)
A very common way to use these charts is to define a differencein two means D of interest, then the minimum value of Φ2 is
Φ2 =nD2
2aσ2
Typically work in term of the ratio of D/σ and try values of nuntil the desired power is achieved
Plasma etching experiment
Reject H0 with probability at least 0.9 (α = 0.01)
any two treatment means differed by as much as 75A/mm
σ = 75 psi⇒ Φ2 = n(75)2
2(4)(252)= 1.125n
n = 4 (d.f . : 3, 12)⇒ Φ = 2.12⇒ Power = 1− β ≈ 0.65
hsuhl (NUK) DAE Chap. 3 71 / 84
Determing Sample Size (cont.)
hsuhl (NUK) DAE Chap. 3 72 / 84
Determing Sample Size (cont.)
Confidence Interval Estimation Method
95% C.I.:
±tα/2,N−a
√2MSE
n
n = 5; σ2 = 252 ⇒ ±tα/2,N−a
√2MSE
n = ±33.52
n = 7; σ2 = 252 ⇒ ±tα/2,N−a
√2MSE
n = ±27.58
±30A/min
hsuhl (NUK) DAE Chap. 3 73 / 84
The Random Effects Model
A Single Random Factor
linear statistical model:
yij = µ+ τi + εij
{i = 1, 2, . . . , aj = 1, 2, . . . , n
1 εij ∼ NID(0, σ2)2 τi ∼ NID(0, σ2
τ )3 τi⊥εij
V(yij) = σ2τ + σ2
Cov(yij, yij′) = σ2τ j 6= j′; Cov(yij, yi′j′) = σ2
τ i 6= i′
hsuhl (NUK) DAE Chap. 3 74 / 84
The Random Effects Model (cont.)
y =
y11
y12
y21
y22
y31
y32
⇒Cov(y) =
σ2τ + σ2 σ2
τ 0 0 0 0σ2τ σ2
τ + σ2 0 0 00 0 σ2
τ + σ2 σ2τ 0 0
0 0 σ2τ σ2
τ + σ2 0 00 0 0 0 σ2
τ + σ2 σ2τ
0 0 0 0 σ2τ σ2
τ + σ2
hsuhl (NUK) DAE Chap. 3 75 / 84
ANOVA for the Random Model
SS:SST = SSTreatment + SSE
Testing Hypotheses:
H0 : σ2τ = 0 vs. H1 : σ2
τ > 0
(If σ2τ = 0⇒ all treatments are identical, but variability exists
between treatments)
SSE/σ2 ∼ χ2
N−a; SSTreatments/σ2 H0∼ χ2
a−1; Both are indipendent
⇒F0 =SSTreatments
a−1SSE
N−1
=MSTreatments
MSE
H0∼ Fa−1,N−a
hsuhl (NUK) DAE Chap. 3 76 / 84
ANOVA for the Random Model (cont.)
The expected mean squares: Under H0, these two components areunbiased estimators of σ2
E(MSTreatments) = σ2 + nσ2τ
E(MSE) = σ2
Decision:Reject H0 if F0 > Fα,a−1,N−a
The computational procedure and ANOVA for the random effectsmodel are identical to those for the fixed effects case.
hsuhl (NUK) DAE Chap. 3 77 / 84
ANOVA for the Random Model (cont.)
Estimating the Model Parameters{E(MSTreatments) = σ2 + nσ2
τ
E(MSE) = σ2 ⇒{σ2 = MSE
σ2τ = MSTreatments−MSE
n
method of moments procedure: not require the normalityassumption
σ2, σ2τ : best quadratic unbiased (minimum variance)
hsuhl (NUK) DAE Chap. 3 78 / 84
ANOVA for the Random Model (cont.)
εiji.i.d.∼ N(0, σ2)⇒ (N−a)MSE
σ2 ∼ χ2N−a
100(1− α)% C.I. for σ2:
(N − a)MSE
χ2α/2,N−a
≤ σ2 ≤ (N − a)MSE
χ21−α/2,N−a
σ2τ = MSTreatments−MSE
n(a−1)MSTreatments
σ2+nσ2τ
∼ χ2a−1;
(N−a)MSEσ2 ∼ χ2
N−a
σ2 ⇒ linear combination of χ2a−1 and χ2
N−a, i.e.,
⇒ u1χ2a−1 − u2χ
2N−a, u1 =
σ2 + nσ2τ
n(a− 1), u2 =
σ2
n(N − a)
hsuhl (NUK) DAE Chap. 3 79 / 84
ANOVA for the Random Model (cont.)
Intraclass correlation coefficient: σ2τ
σ2τ+σ
2 (MSTreatments ⊥ MSE)
⇒MSTreatments/(nσ2
τ + σ2)
MSE/σ2∼ Fa−1,N−a
⇒P(
F1−α/2,a−1,N−a ≤MSTreatments
MSE
σ2
nσ2τ + σ2
≤ Fα/2,a−1,N−a
)= 1− α
⇒P
1n
(MSTreatmens
MSE
1Fα/2,a−1,N−a
− 1
)(L)
≤σ2τ
σ2≤
1n
(MSTreatmens
MSE
1F1−α/2,a−1,N−a
− 1
)(U)
= 1− α
100(1− α)% C.I. for σ2τ
σ2τ+σ
2 :
L1 + L
≤ σ2τ
σ2τ + σ2 ≤
U1 + U
hsuhl (NUK) DAE Chap. 3 80 / 84
ANOVA for the Random Model (cont.)
Estimation of the Overall Mean µ:
µ = y··
V(y··) = nσ2τ+σ
2
an ⇒ V(y··) = MSTreatmentsan
100(1− α)% C.I. on µ:
y·· − tα/2,a(n−1)
√MSTreatmens
an≤ µ ≤ y·· + tα/2,a(n−1)
√MSTreatmens
an
hsuhl (NUK) DAE Chap. 3 81 / 84
Nonparametric Methods in the Analysis of Variance
Kruskal-Wallis Test (1952)
The normality assumption is unjustified(未被證明為正當的).1 rank yij in ascending(上升的) order2 replace yij by its rank Rij; (ties: average rank to each of the tied
observations)3 Ri·: the sum of the ranks in the ith treatment4 It ni are reasonably large⇒ H
H0∼ χ2a−1:
Reject H0: Test statistic H > χ2a−1
hsuhl (NUK) DAE Chap. 3 82 / 84
Nonparametric Methods in the Analysis of Variance (cont.)
5 Test statistic:
H =1S2
[a∑
i=1
R2i·
ni− N(N + 1)2
4
]
S2 =1
N − 1
a∑i=1
ni∑j=1
R2ij −
N(N + 1)2
4
(Variance of the ranks)
no ties=
N(N + 1)
12
Using ANOVA ranks F0 = H/(a−1)(N−aH)/(N−a) is equivalent to H
hsuhl (NUK) DAE Chap. 3 83 / 84
Nonparametric Methods in the Analysis of Variance (cont.)
> kruskal.test(rate ˜ FRF, data = etch)
Kruskal-Wallis rank sum test
data: rate by FRFKruskal-Wallis chi-squared = 16.907, df = 3, p-value = 0.0007386
hsuhl (NUK) DAE Chap. 3 84 / 84