12
TAMS38 - Lecture 6 Factorial design, Latin Square Design Lecturer: Jolanta Pielaszkiewicz Matematisk statistik - Matematiska institutionen Linköpings universitet ”Models should be as simple as possible, but not more so.” - Attributed to A. Einstein 18 November, 2016 Singull, Pielaszkiewicz, MAI - LiU TAMS38 - Lecture 6 Contents Factorial design Model Variance analysis F-test Example Block design - Latin square Model Variance analysis F-test Example 4 (Lecture 1) Singull, Pielaszkiewicz, MAI - LiU TAMS38 - Lecture 6 3 An experiment is affected by factors A,B,C with levels A 1 ,...,A a and B 1 ,...,B b and C 1 ,...,C c , respectively. For each level combination A i B j C k one obtains n measurements and obtain values y ijkl . Model: A complete three factor model is written as Y ijkl = μ + τ i + β j + γ k +(τβ ) ij +(τγ ) ik +(βγ ) jk +(τβγ ) ijk + ε ijkl = μ ijk + ε ijkl where ε are independent and N (0), Singull, Pielaszkiewicz, MAI - LiU TAMS38 - Lecture 6 4 a X 1 τ i =0, b X 1 β j =0, c X 1 γ k =0, a X i=1 (τβ ) ij =0, j, b X j =1 (τβ ) ij =0 i, a X i=1 (τγ ) ik =0 k, c X k=1 (τγ ) ik =0 i, b X j =1 (βγ ) jk =0 k, c X k=1 (βγ ) jk =0 j, a X i=1 (τβγ ) ijk =0j, k, b X j =1 (τβγ ) ijk =0i, k, c X k=1 (τβγ ) ijk =0i, j. Singull, Pielaszkiewicz, MAI - LiU TAMS38 - Lecture 6

Factorial design, Latin Square Design Factorialdesign ...courses.mai.liu.se/GU/TAMS38/Dokument/FO/2016/fo6_2016_4_eng.pdf · TAMS38 - Lecture 6 Factorial design, Latin Square Design

  • Upload
    others

  • View
    20

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Factorial design, Latin Square Design Factorialdesign ...courses.mai.liu.se/GU/TAMS38/Dokument/FO/2016/fo6_2016_4_eng.pdf · TAMS38 - Lecture 6 Factorial design, Latin Square Design

TAMS38 - Lecture 6Factorial design, Latin Square Design

Lecturer: Jolanta Pielaszkiewicz

Matematisk statistik - Matematiska institutionen

Linköpings universitet

”Models should be as simple as possible, but not more so.”- Attributed to A. Einstein

18 November, 2016

Singull, Pielaszkiewicz, MAI - LiU TAMS38 - Lecture 6

Contents

Factorial designModelVariance analysisF-testExample

Block design - Latin squareModelVariance analysisF-testExample 4 (Lecture 1)

Singull, Pielaszkiewicz, MAI - LiU TAMS38 - Lecture 6

3

An experiment is affected by factors A,B,C with levelsA1, . . . , Aa and B1, . . . , Bb and C1, . . . , Cc, respectively.

For each level combination AiBjCk one obtains n measurementsand obtain values yijkl.

Model:A complete three factor model is written as

Yijkl = µ+ τi + βj + γk + (τβ)ij

+ (τγ)ik + (βγ)jk + (τβγ)ijk + εijkl = µijk + εijkl

where ε are independent and N(0, σ),

Singull, Pielaszkiewicz, MAI - LiU TAMS38 - Lecture 6

4

a∑1

τi = 0,b∑1

βj = 0,c∑1

γk = 0,

a∑i=1

(τβ)ij = 0, ∀j,b∑

j=1

(τβ)ij = 0 ∀i,

a∑i=1

(τγ)ik = 0 ∀k,c∑

k=1

(τγ)ik = 0 ∀i,

b∑j=1

(βγ)jk = 0 ∀k,c∑

k=1

(βγ)jk = 0 ∀j,

a∑i=1

(τβγ)ijk = 0∀j, k,b∑

j=1

(τβγ)ijk = 0∀i, k,c∑

k=1

(τβγ)ijk = 0∀i, j.

Singull, Pielaszkiewicz, MAI - LiU TAMS38 - Lecture 6

Page 2: Factorial design, Latin Square Design Factorialdesign ...courses.mai.liu.se/GU/TAMS38/Dokument/FO/2016/fo6_2016_4_eng.pdf · TAMS38 - Lecture 6 Factorial design, Latin Square Design

5

In total we have

1 + (a− 1) + (b− 1) + (c− 1) + (a− 1)(b− 1) + (a− 1)(c− 1)

+ (b− 1)(c− 1) + (a− 1)(b− 1)(c− 1) = abc

free parameters.

A complete three factor model can be also written as

Yijkl = µijk + εijkl,

where µijk can vary freely. This means that observations yijklrepresents abc samples of size n and with different expectedvalues.

Singull, Pielaszkiewicz, MAI - LiU TAMS38 - Lecture 6

Point estimators 6

µ = y····,

τi = yi··· − y····, βj = y·j·· − y····, γk = y··k· − y····,

(τβ)ij = yij·· − τi − βj − µ = yij·· − yi··· − y·j·· + y····,

(τγ)ik = yi·k· − yi··· − y··k· + y····,

(βγ)jk = y·jk· − y·j·· − y··k· + y····,

(τβγ)ijk = yijk· − (τβ)ij − (τγ)ik − (βγ)jk − τi − βj − γk − µ= yijk·︸︷︷︸

=µijk

− yij·· − yi·k· − y·jk· + yi··· + y·j·· + y··k· − y····

Singull, Pielaszkiewicz, MAI - LiU TAMS38 - Lecture 6

Excercise 7

Prove that the estimators given on previous slide are unbiased.One can do the following calculations:

E(µ) = E(Y ····

)= E

[ 1

abcn

a∑i=1

b∑j=1

c∑k=1

n∑l=1

(µ+ τi + βj + γk

+ (τβ)ij + (τγ)ik + (βγ)jk + (τβγ)ijk + εijkl)]

=1

abcn

(abcnµ+

∑j,k,l

∑i

τi︸ ︷︷ ︸=0

+∑i

∑k

∑l

∑j

βj︸ ︷︷ ︸=0

+∑i,j,l

∑k

γk︸ ︷︷ ︸=0

+∑j,k,l

∑i

(τβ)ij︸ ︷︷ ︸=0

+∑j,k,l

∑i

(τγ)ik︸ ︷︷ ︸=0

+∑i,k,l

∑j

(βγ)jk︸ ︷︷ ︸=0

+∑i,k,l

∑j

(τβγ)ijk︸ ︷︷ ︸=0

+∑i,j,k

∑l

E(εijkl)︸ ︷︷ ︸=0

)= µ.

Singull, Pielaszkiewicz, MAI - LiU TAMS38 - Lecture 6

Sum of squares 8

For the complete model we have

SSA = nbc∑a

i=1τ2i , df = a− 1

SSB = nac∑b

j=1β2j , df = b− 1

SSC = nab∑c

k=1γ2k , df = c− 1

SSAB = nc∑a

i=1

∑b

j=1(τβ)

2

ij , df = (a− 1)(b− 1)

...

SSABC = n∑

i

∑j

∑k

(τβγ)2

ijk, df = (a− 1)(b− 1)(c− 1)

SSE =a∑i=1

b∑j=1

c∑k=1

n∑l=1

(yijkl − yijk·)2︸ ︷︷ ︸(n−1)·sample variance for cell ijk

, df = abc(n− 1)

Singull, Pielaszkiewicz, MAI - LiU TAMS38 - Lecture 6

Page 3: Factorial design, Latin Square Design Factorialdesign ...courses.mai.liu.se/GU/TAMS38/Dokument/FO/2016/fo6_2016_4_eng.pdf · TAMS38 - Lecture 6 Factorial design, Latin Square Design

9

Just as before, it is possible to show that the various sums ofsquares under certain conditions and after division by σ2 areχ2-distributed with the specified degrees of freedom.

Observe that degrees of freedom for SSE are abc(n− 1) only incase of complete three-factor model. If one uses additive modelor some other specified model, one obtain some other degrees offreedom and new SS′E , see Ex. on page 14 & 17.

For the complete model we have σ2-estimator given by

s2 =SSE

abc(n− 1)

Singull, Pielaszkiewicz, MAI - LiU TAMS38 - Lecture 6

F -test 10

For the complete model it holds that(i) H0A : τ1 = . . . = τa = 0 mot H1A : ej alla τi noll is tested

with help of

vA =SSA/(a− 1)

SSE/[abc(n− 1)].

H0A is rejected for the large values of vA. The r.v.VA ∼ F (a− 1, abc(n− 1)) if H0A is true.

(ii) H0AB : (τβ)ij = 0 ∀i, j (i.e. no interaction between A andB) against H1AB : not all (τβ)ij = 0 (there is interactionbetween A and B) is tested with

vAB =SSAB/[(a− 1)(b− 1)]

SSE/[abc(n− 1)].

H0AB is rejected for the large values of vAB. The r.v. VAB ∼F ((a− 1)(b− 1), abc(n− 1)) if H0AB is true.

Singull, Pielaszkiewicz, MAI - LiU TAMS38 - Lecture 6

11

Other main effects and interaction effects are testedcorrespondingly.

Furthermore, it holds that Y ijk. are independent of r.v. SSE .This is important when one construct confidence interval.

Generally. The F -test for the different effects associated withfactorial design is always one-sided. One reject the nullhypothesis for large values of the test statistics.

Singull, Pielaszkiewicz, MAI - LiU TAMS38 - Lecture 6

Example 12

One wants to examine three factors that influence theproduction of a certain kind of units.

A: skill levels of staff.Levels: A1, A2, A3 (decreasing)

B: the complexity of the method.Levels: B1 (high), B2 (low)

C: tiredness.Levels C1 (am), C2 (pm)

A full factorial design with two observations per cell wasconducted and a measurement y of quality and quantity weredetermined.

Singull, Pielaszkiewicz, MAI - LiU TAMS38 - Lecture 6

Page 4: Factorial design, Latin Square Design Factorialdesign ...courses.mai.liu.se/GU/TAMS38/Dokument/FO/2016/fo6_2016_4_eng.pdf · TAMS38 - Lecture 6 Factorial design, Latin Square Design

13

MTB > print Y

Data Display

Y92 88 88 84 78 82 78 77 70 74 69 7169 66 63 67 62 59 60 58 64 60 62 59

MTB > set c2DATA> (1 2 3)8DATA> endMTB > set c3DATA> 3(1 1 1 1 2 2 2 2)DATA> endMTB > set c4DATA> 6(1 1 2 2)DATA> end

Singull, Pielaszkiewicz, MAI - LiU TAMS38 - Lecture 6

14

MTB > anova Y=A|B|C.

ANOVA: Y versus A, B, C

Factor Type Levels ValuesA fixed 3 1, 2, 3B fixed 2 1, 2C fixed 2 1, 2

Analysis of Variance for Y

Source DF SS MS F PA 2 2151.58 1075.79 195.60 0.000B 1 104.17 104.17 18.94 0.001C 1 32.67 32.67 5.94 0.031A*B 2 116.58 58.29 10.60 0.002A*C 2 3.08 1.54 0.28 0.760B*C 1 0.17 0.17 0.03 0.865A*B*C 2 1.08 0.54 0.10 0.907Error 12 66.00 5.50Total 23 2475.33

S = 2.34521 R-Sq = 97.33% R-Sq(adj) = 94.89%

Singull, Pielaszkiewicz, MAI - LiU TAMS38 - Lecture 6

15

Singull, Pielaszkiewicz, MAI - LiU TAMS38 - Lecture 6

16

Singull, Pielaszkiewicz, MAI - LiU TAMS38 - Lecture 6

Page 5: Factorial design, Latin Square Design Factorialdesign ...courses.mai.liu.se/GU/TAMS38/Dokument/FO/2016/fo6_2016_4_eng.pdf · TAMS38 - Lecture 6 Factorial design, Latin Square Design

17

MTB > ANOVA ’Y’ = A| B ’C’;SUBC> Means A|B C.

ANOVA: Y versus A, B, C

Factor Type Levels ValuesA fixed 3 1, 2, 3B fixed 2 1, 2C fixed 2 1, 2

Analysis of Variance for Y

Source DF SS MS F PA 2 2151.58 1075.79 260.03 0.000B 1 104.17 104.17 25.18 0.000A*B 2 116.58 58.29 14.09 0.000C 1 32.67 32.67 7.90 0.012Error 17 70.33 4.14Total 23 2475.33

S = 2.03402 R-Sq = 97.16% R-Sq(adj) = 96.16%

Singull, Pielaszkiewicz, MAI - LiU TAMS38 - Lecture 6

18

Analysis of Variance for Y=A|B|C

Source DF SS MS F PA 2 2151.58 1075.79 195.60 0.000B 1 104.17 104.17 18.94 0.001C 1 32.67 32.67 5.94 0.031A*B 2 116.58 58.29 10.60 0.002A*C 2 3.08 1.54 0.28 0.760B*C 1 0.17 0.17 0.03 0.865A*B*C 2 1.08 0.54 0.10 0.907Error 12 66.00 5.50Total 23 2475.33

Analysis of Variance for Y=A|B C

Source DF SS MS F PA 2 2151.58 1075.79 260.03 0.000B 1 104.17 104.17 25.18 0.000A*B 2 116.58 58.29 14.09 0.000C 1 32.67 32.67 7.90 0.012Error 17 70.33 4.14Total 23 2475.33

Singull, Pielaszkiewicz, MAI - LiU TAMS38 - Lecture 6

19

Means

A N Y C N Y1 8 83.375 1 12 72.0002 8 68.625 2 12 69.6673 8 60.500

B N Y1 12 72.9172 12 68.750

A B N Y1 1 4 88.0001 2 4 78.7502 1 4 71.0002 2 4 66.2503 1 4 59.7503 2 4 61.250

Singull, Pielaszkiewicz, MAI - LiU TAMS38 - Lecture 6

20

Singull, Pielaszkiewicz, MAI - LiU TAMS38 - Lecture 6

Page 6: Factorial design, Latin Square Design Factorialdesign ...courses.mai.liu.se/GU/TAMS38/Dokument/FO/2016/fo6_2016_4_eng.pdf · TAMS38 - Lecture 6 Factorial design, Latin Square Design

21

Singull, Pielaszkiewicz, MAI - LiU TAMS38 - Lecture 6

22

The interaction plot shows that skilled workers (A1) seem toperform worse when they change from B1 to B2.

A3-persons obtain approximately the same results for B1 andB2.

Values for factor C suggest that there are better results in themorning than in the afternoon.

We investigate this using confidence intervals.

Singull, Pielaszkiewicz, MAI - LiU TAMS38 - Lecture 6

23

γ1 − γ2 is estimated with γ1 − γ2 = (y··1· − y····)− (y··2· − y····)= y··1· − y··2·.

We have the r.v. Y ··1· − Y ··2· ∼ N(γ1 − γ2,

√σ2

12 + σ2

12

)where

σ2 is estimated with s2 =SS′

E17 = 4.137; s = 2.034; df = 17.

Help variableY ··1· − Y ··2· − (γ1 − γ2)

S/√

6∼ t(17) and that gives

Iγ1−γ2 =

(2.333∓ 2.11 · s√

6

)≈ (0.58, 4.09) (95%)

Only positive values. One has better production results in themorning.

Singull, Pielaszkiewicz, MAI - LiU TAMS38 - Lecture 6

24

To verify the trends seen on interaction plot, we constructintervals Imi1−mi2 for i = 1, 2, 3. This means that we only makethe interesting comparisons.

We have mi1 − mi2 = yi1·· − yi2··

The r.v. Y i1·· − Y i2·· ∼ N(mi1 −mi2,

√σ2

4 + σ2

4

)gives

help variableY i1·· − Y i2·· − (mi1 −mi2)

S/√

2∼ t(17) and that gives

Imi1−mi2 =

(yi1·· − yi2·· ∓ 2.11 · s√

2

)= (yi1·· − yi2·· ∓ 3.035).

Singull, Pielaszkiewicz, MAI - LiU TAMS38 - Lecture 6

Page 7: Factorial design, Latin Square Design Factorialdesign ...courses.mai.liu.se/GU/TAMS38/Dokument/FO/2016/fo6_2016_4_eng.pdf · TAMS38 - Lecture 6 Factorial design, Latin Square Design

25

We obtain

Im11−m12 ≈ (6.2, 12.3); Im21−m22 ≈ (1.7, 7.9)

and for A1 and A2 the complicated methods are better than themethods of low complexity.

Im31−m32 ≈ (−4.5, 1.5),

i.e. no significant difference between B1 and B2 for A3.

Simultaneous confidence level ≥ 1− 4 · 0.05 for those 4 intervalsthat we have constructed.

Note: In this example, the conclusions was obtained using thefact that we could simplify the model by disregarding certainparameters. Such simplifications are therefore of greatadvantage, but they should be done with caution for eventuallose of information.

Singull, Pielaszkiewicz, MAI - LiU TAMS38 - Lecture 6

Block design, Latin square... 26

Think carefully about which factors influence the results.Are these factors measurable?How can we take them into account when planning andanalyzing the data?How can eliminate or at least reduce the influence ofpossible disturbing factors?

Randomization: Disturbing factors at least not systematicallyinfluence.

Block: Gives some control over the disturbing negative impact.

Singull, Pielaszkiewicz, MAI - LiU TAMS38 - Lecture 6

Example 27

One wants to compare the performance of four different varietiesof wheat V1, V2, V3, V4 and have at his disposal a field dividedinto boxes:

Forest (sv. skog)

Meadow (sv. äng)1 2 3 4

5 6 7 8

9 10 11 12

13 14 15 16

Arable (sv. åker)

Lake (sv. sjö)

Singull, Pielaszkiewicz, MAI - LiU TAMS38 - Lecture 6

Complete randomized design 28

Choose randomly four boxes for V1, four for V2 etc.

V1 : 04, 08, 15, 02 V2 : 07, 01, 14, 05V3 : 13, 16, 11, 06 V4 : 03, 09, 10, 12

Model 1 (One-Way ANOVA)Wheat type No. i gives return yil where

Yil = µi + εil

and εil are assumed to be independent and normallydistributed.

Here the boxes are considered to be equivalent. Any eventualdifferences between the boxes ”are added to’ ε-variable.Parameters µi are a characteristic value of the wheatvariety No. i.

Singull, Pielaszkiewicz, MAI - LiU TAMS38 - Lecture 6

Page 8: Factorial design, Latin Square Design Factorialdesign ...courses.mai.liu.se/GU/TAMS38/Dokument/FO/2016/fo6_2016_4_eng.pdf · TAMS38 - Lecture 6 Factorial design, Latin Square Design

Block design 29

If the rows on the field suspected to be different, but the boxesin a row are equivalent, one put wheat so that every wheatvariety occurs the same number of times in row. The boxeswithin the row are selected randomly for each wheat varieties.(Randomization in blocks = rows.)

V2 V1 V3 V4V3 V1 V2 V4V3 V4 V1 V2V4 V2 V1 V3

Singull, Pielaszkiewicz, MAI - LiU TAMS38 - Lecture 6

30

Model 2 (block design)Wheat type No. i and row j is field give returns yij where

Yij = µ+ τi + βj + εij

and∑

i τi = 0,∑

j βj = 0 and ε are assumed to be independentand normally distributed.

Parameters τi describe effects of wheat variety and βj effect ofblock, i.e., rows. We use to assume that block effect is additive.We compare different sorts of wheat by comparison of τi.

Singull, Pielaszkiewicz, MAI - LiU TAMS38 - Lecture 6

Latis square 31

If there are differences both between rows and columns on thefield we make a design according to a Latin square: every wheatvariety occurs exactly once in each row and exactly once in eachcolumn.

V2 V4 V3 V1V4 V3 V1 V2V3 V1 V2 V4V1 V2 V4 V3

Singull, Pielaszkiewicz, MAI - LiU TAMS38 - Lecture 6

32

Model 3 (experiment according to Latin square design)Wheat type No. i, row j and column k give returns yij(k) where

Yij(k) = µ+ τi + βj + γk + εij(k),∑i τi = 0,

∑j βj = 0,

∑k γk = 0 och εij(k) is assumed to be

independent and N(0, σ).

The previous model has been extended with the parameter γkthat takes care of the column properties (see next page).

Singull, Pielaszkiewicz, MAI - LiU TAMS38 - Lecture 6

Page 9: Factorial design, Latin Square Design Factorialdesign ...courses.mai.liu.se/GU/TAMS38/Dokument/FO/2016/fo6_2016_4_eng.pdf · TAMS38 - Lecture 6 Factorial design, Latin Square Design

33

Singull, Pielaszkiewicz, MAI - LiU TAMS38 - Lecture 6

Point estimators 34

We now have the following point estimates

µ = y···,

τi = yi·· − y···,

βj = y·j· − y···,

γk = y··k − y···.

Singull, Pielaszkiewicz, MAI - LiU TAMS38 - Lecture 6

Sums of squares 35

For a p× p-square we have

SSA = p∑p

i=1(yi·· − y···)2, df = p− 1,

SSB = p∑p

j=1(y·j· − y···)2, df = p− 1,

SSC = p∑p

k=1(y··k − y···)2, df = p− 1

and

SSE =∑i,j,(k)

(yij(k) − µ− τi − βj − γk)2

=∑i,j,(k)

(yij(k) − yi·· − y·j· − y··k + 2y···)2, df = (p− 2)(p− 1).

Singull, Pielaszkiewicz, MAI - LiU TAMS38 - Lecture 6

36

F -testAt experiment done according to a Latin square we estimate σ2

by s2 = SSE(p−2)(p−1)

H0A : τ1 = . . . = τp = 0 (A-levels are equivalent) against H1A :not all τi = 0 is tested using test statistics

vA =SSA/(p− 1)

SSE/[(p− 2)(p− 1)]

Singull, Pielaszkiewicz, MAI - LiU TAMS38 - Lecture 6

Page 10: Factorial design, Latin Square Design Factorialdesign ...courses.mai.liu.se/GU/TAMS38/Dokument/FO/2016/fo6_2016_4_eng.pdf · TAMS38 - Lecture 6 Factorial design, Latin Square Design

37

Pairwise comparisonsOne do pairwise comparisons (of for example different kinds ofwheat) through confidence intervals for τi − τq. Note that

τi − τq = yi·· − yq··

after simplification and the r.v.

Y i·· ∼ N

(µ+ τi,

√σ2

p

)

as it is average of p random variables each with variance σ2.

Graeco-Latin Square

Singull, Pielaszkiewicz, MAI - LiU TAMS38 - Lecture 6

Block design in relation to general factorial design 38

Ideally, each level combination occur as many times within eachof the blocks. One randomizes within each block to preventthe systematic influence of example time.

Block effect is assumed to be additive. Reduced design wherefor example only some specified combinations of levels occurrwithin blocks must be planned carefully, see the section onRoman squares, and FÖ7. There are several such methods otherthan those included in the course.

Remember: A design as to be combined with the ”correct”model if we are to benefit from it.

Singull, Pielaszkiewicz, MAI - LiU TAMS38 - Lecture 6

Example 4 (Lecture 1) 39

The purpose of a study was to see if music during work effectedthe production in a factory. Four different music programs A, B,C and D were compared with no music at all, E. Each programwas played for a day and one wanted five replicates for eachprogram, i.e., the study lasted for five weeks.

Since there can also be variations between the days and betweenthe weeks the design for the study was chosen to be a latinsquare.

Singull, Pielaszkiewicz, MAI - LiU TAMS38 - Lecture 6

Example, cont. 40

Results:Vecka Måndag Tisdag Onsdag Torsdag Fredag1 A 133 B 139 C 140 D 140 E 1452 B 136 C 141 D 143 E 146 A 1393 C 140 A 138 E 142 B 139 D 1394 D 129 E 132 A 137 C 136 B 1405 E 132 D 144 B 143 A 142 C 142

Note that each music program is present one time in each rowand in each column.

Data are analyzed using Minitab, see below.

Singull, Pielaszkiewicz, MAI - LiU TAMS38 - Lecture 6

Page 11: Factorial design, Latin Square Design Factorialdesign ...courses.mai.liu.se/GU/TAMS38/Dokument/FO/2016/fo6_2016_4_eng.pdf · TAMS38 - Lecture 6 Factorial design, Latin Square Design

Example, cont. 41

a) According to which model were data analyzed? Does themusic seem to have no effect on production? Perform theappropriate test level 5%.

b) Is production worse on Mondays than on other days?Motivate your answer with use of confidence interval on thesimultaneous confidence level at least 80%. You can assumethat even before you saw the result you suspected thatproduction would be the worst on Mondays.

c) Does the normal distribution assumption seem to bereasonable? Explain your answer briefly.

Singull, Pielaszkiewicz, MAI - LiU TAMS38 - Lecture 6

42

MTB > GLM ’Y’ = vecka dag musik;SUBC> Means vecka dag musik.

General Linear Model: Y versus vecka, dag, musik

Analysis of Variance for Y, using Adjusted SS for Tests

Source DF Seq SS Adj SS Adj MS F Pvecka 4 123.44 123.44 30.86 3.07 0.059dag 4 177.84 177.84 44.46 4.42 0.020musik 4 11.84 11.84 2.96 0.29 0.876Error 12 120.72 120.72 10.06Total 24 433.84

S = 3.17175 R-Sq = 72.17% R-Sq(adj) = 44.35%

Singull, Pielaszkiewicz, MAI - LiU TAMS38 - Lecture 6

43

Least Squares Means for Y

vecka Mean SE Mean1 139.4 1.4182 141.0 1.4183 139.6 1.4184 134.8 1.4185 140.6 1.418dag1 134.0 1.4182 138.8 1.4183 141.0 1.4184 140.6 1.4185 141.0 1.418musik1 137.8 1.4182 139.4 1.4183 139.8 1.4184 139.0 1.4185 139.4 1.418

Singull, Pielaszkiewicz, MAI - LiU TAMS38 - Lecture 6

44

a) Week No. i, day No. j, music No. k give observations yij(k)where

Yij(k) = µ+ τi + βj + γk + εij(k)

and εij(k) ∼ N(0, σ).

We test H0M : γ1 = . . . = γk = 0 mot H1M : not all γi equal 0,with F -test.

Test statistics: vM =SSM/4

SSE/12=

2.960

10.060= 0.29

Singull, Pielaszkiewicz, MAI - LiU TAMS38 - Lecture 6

Page 12: Factorial design, Latin Square Design Factorialdesign ...courses.mai.liu.se/GU/TAMS38/Dokument/FO/2016/fo6_2016_4_eng.pdf · TAMS38 - Lecture 6 Factorial design, Latin Square Design

45

The r.v. VM ∼ F (4, 12) if H0M is true and vM is large if H0M isfalse. Table gives the limit of critical region c = 3.26 and0.29� 3.26. The effect of music seems to be negligible.

b) We construct intervals Iβj−β1 , downward limited and each ofthe confidence level 0.95=1-0.20/4. We have

βj − β1 = (y·j(·) − y··(·))− (y·1(·) − y··(·)) = y·j(·) − y·1(·)

with corresponding r.v.

Y ·j(·) − Y ·1(·) ∼ N

(βj − β1, σ

√2

5

)

Singull, Pielaszkiewicz, MAI - LiU TAMS38 - Lecture 6

46

σ2 is estimated with s2 = SSE12 = 10.060; s = 3.172; df = 12 and

help variable become

Y ·j(·) − Y ·1(·) − (βj − β1)S ·√

2/5∼ t(12)

which gives

Iβ2−β1 = (y·2(·) − y·1(·) − t · s ·√

2/5, ∞)

= (138.80− 134.00− 3.57, ∞) = (1.23, ∞), etc.

Production seems to be lower on Mondays.

Singull, Pielaszkiewicz, MAI - LiU TAMS38 - Lecture 6

47

Singull, Pielaszkiewicz, MAI - LiU TAMS38 - Lecture 6

48

c) Neither the normal probability plot or histogram is reallygood, but the normal distribution can probably be good enoughapproximation.

Singull, Pielaszkiewicz, MAI - LiU TAMS38 - Lecture 6