CS代考 MATH1302: Updates

Mathematics and Statistics –
Design and Analysis of Experiments
Week 5 – Randomized blocks and Latin Squares.

Copyright By PowCoder代写 加微信 powcoder

MATH1302: Updates
• Assessments tasks:
• Assignment 1 : Due day this week.
• Assignment 2 is open and the questions are up for you to work on.
• Discussion board: Please contribute and discuss with your classmates. I will also contribute occasionally.
• Tutorial / Lab session will run every week
• Illustrating questions solutions on R
• Illustrating questions solutions on SAS
• Practicing with solving exercise
• Answering questions

Latin Squares

Definition
A Latin Square is an arrangement (array) of t different letters in t rows and t columns so that each (Latin) letter appears exactly one time in each row and each column. For example the following array is a Latin Square of order t=5.
ABCDE CDEAB EABCD BCDEA DEABC
Latin squares exist for any positive integer number (For example we have the Latin square that it is constructed by a cyclic permutation of the leters in each row).
Two Latin squares are said to be orthogonal if where the first has the same letter the second has all letters.

A Latin Square

Orthogonal Latin Squares
For example the following Latin squares of order t=4 are pairwise orthogonal.
ABCDABCDABCD BADCCDABDCBA CDABDCBABADC DCBABADCCDAB
All variables in a Latin square have the same number levels.
The design is represented by a square matrix where rows and columns correspond to the levels of the two (blocking) factors and the t x t entries (cells) of the matrix are completed with a capital Latin letter which corresponds to the treatment of the experimental unit (defined by row and column of the matrix).

Latin Square Designs
Selected Latin Squares
A BC B CA C A B
A B C DE B A E CD CD AE B DEBA C ECDBA
A BC D B A DC CD B A D CA B
A BC D B CD A CD A B D A BC
A BC DE BFDCA C D EF B DAF ECB E CA BF D FEBADC
A BC D BD AC C AD B D CB A
A BC D BA DC CD AB D CBA

In any Latin square there are two blocking factors and each treatment appears exactly one time in each row or column.
A Latin square having the Latin letters sorted in the first row and column is called Normal Latin square.
Question: How many «different» Latin squares exist?

• Nine possible Latin squares of order t=3 are:
• It would be tedious and time consuming to write out all possible Latin squares, and for t greater than 3 this is not feasible.
• So if we can’t do this then how do we randomly select a Latin square?

Standard Latin Squares
• A standard Latin square is one which has both the first row and the first column in numeric (or alphabetic) order.
• For example,
• To randomize, start with the standard Latin square and randomly permute the rows and columns.
• This is still difficult when the number of treatments is large.
• Cyclic squares, in which treatments always follow each other in the
same order are often used in large designs.
• Disadvantages: order effect, know which treatment comes next.

In a Latin square You have three factors: • Treatments (t) (letters A, B, C, …)
• Rows (t)
• Columns (t)
The number of treatments = the number of rows = the number of colums = t.
The row-column treatments are represented by cells in a t x t array.
The treatments are assigned to row-column combinations using a Latin-square arrangement

A courier company is interested in deciding between five brands (D,P,F,C and R) of car for its next purchase of fleet cars.
• The brands are all comparable in purchase price.
• The company wants to carry out a study that will enable them to compare the brands with respect to operating costs.
• For this purpose they select five drivers (Rows).
• In addition the study will be carried out over a five week period (Columns = weeks).

• Each week a driver is assigned to a car using randomization and a Latin Square Design.
• The average cost per mile is recorded at the end of each week and is tabulated below:
1 5.83 6.22 7.67 9.43 6.57 DPFCR
2 4.80 7.56 10.34 5.82 9.86 PDCRF
3 7.43 11.29 7.01 10.48 9.27 FCRDP
5 11.24 6.34 11.30 12.58 16.04 CRPFD
6.60 9.54 11.11 10.84 15.05

Analysis of Variance
The (additive) model can be written as
Yijk =+ai +bj +k +ijk ,
μ is the general mean
 k the effect of level k (Latin letters)
ai the effect of group response (rows)
( k = 1,2,…, t ) of factor (treatment k) on the response
i ( i = 1,2,…, t ) of the 1st grouping variable on the
bj the effect of group j ( j =1,2,…,t ) of the second grouping variable on the
response (columns)
ijk is the experimental error [We assume that these are independent random
variables with normal distribution N(0, 2 ) ]
Fixed effects

is the sum of the observations of the ith row
is the sum of the observations of the jth column
is the sum of the observations of the kth treatment (k th letter)
Y… is the total sum of all observations
We have that
1t11t11t1 SSR= Y2− Y2,SSC= Y2− Y2,SSTr= Y2− Y2
ti=1 N tj=1 N tk=1 N
i.. … ttt 1
SST=Y2 − Y2 and SSE=SST−SSR−SSC−SSTr
i=1 j=1 k=1
where N = t 2 is the total number of observations.

ANOVA TABLE
F = MSTr MSE
(t −1)(t − 2)
MSE = SSE (t−1)(t−2)
for k =1,2,…,t

Estimation of the effects of treatments and multiple comparison (Tukey)
ˆk =Y..k −Y… ,k=1,2,..,t,
where Y..k the mean of the observations of the k th treatment, Y… the mean of all
observations
andˆ−ˆ=Y−Y−(Y−Y)=Y−Y fori,j=1,2,..,t,ij.
i j ..i … ..j … ..i ..j
E(Y −Y )= − with V(Y −Y )=22.
..i ..j i j ..i ..j
Confidence intervals with simultaneous confidence level 100(1-α)% for the differences  i −  j can be found using the Tukey method:
 −  (ˆ −ˆ  w 2MSE / t ) with w = q / 2 (from tables) i j i j T T t,(t−1)(t−2),a
a= b= =0
i=1 j=1 k=1

• A Latin Square experiment is assumed to be a three-factor experiment.
• The factors are rows, columns and treatments.
• It is assumed that there is no interaction between
rows, columns and treatments.
• The degrees of freedom for the interactions is used to estimate error.

The Anova Table for a Latin Square Experiment
Sometimes we use this source order as well (same thing)
MSRow /MSE
MSCol /MSE
(t-1)(t-2)

The Anova Table for Example

In this Experiment the we are again interested in how weight gain (Y) in rats is affected by Source of protein (Beef, Cereal, and Pork) and by Level of Protein (High or Low).
There are a total of t = 3 X 2 = 6 treatment combinations of the two factors.
• Beef -High Protein
• Cereal-High Protein
• Pork-High Protein
• Beef -Low Protein
• Cereal-Low Protein and
• Pork-Low Protein

In this example we will consider using a Latin Square design
Six Initial Weight categories are identified for the test animals in addition to Six Appetite categories.
• A test animal is then selected from each of the 6 X 6 = 36 combinations of Initial Weight and Appetite categories.
• A Latin square is then used to assign the 6 diets to the 36 test animals in the study.

In the latin square the letter
• A represents the high protein-cereal diet
• B represents the high protein-pork diet
• C represents the low protein-beef diet
• D represents the low protein-cereal diet
• E represents the low protein-pork diet and
• F represents the high protein-beef diet.

The weight gain after a fixed period is measured for each of the test animals and is tabulated below:
Appetite Category
1 62.1 84.3 61.5 66.3 73.0 104.7 ABCDEF
2 86.2 91.9 69.2 64.5 80.8 83.9 BFDCAE
Weight CDEFBA
3 63.9 71.1 69.6 90.4 100.7 93.2
4 68.9 77.2 97.3 72.1 81.7 114.7 DAFECB
5 73.8 73.3 78.6 101.9 111.5 95.3 ECABFD
101.8 83.8 110.6 87.9 93.5 103.8

The Anova Table for Example

Diet SS portioned into main effects for Source and Level of Protein

An engineer is testing the effect of four methods (Α, Β, C, D) in the needed time for constructing a part of a TV receiver. The engineer believes that a worker, applying any method, gets tired as the time is passing and this might affect the time needed to construct the part. For the production procedure he get four workers to construct four parts using the four methods.
To study this problem the engineer decide to use the following Latin square (the time needed to construct the part is given in the parenthesis).
Product (construction order)
Is there any method that requires less time for constructing that part?

Descriptive Statistics: Time
Main Effects Plot for Time
Method Mean
1 7.50
2 9.25
3 13.25
4 11.00
Descriptive Statistics: Time
Variable Mean
Time 10.250
ˆ1 = 7.5 −10.25 = −2.75 ˆ3 =13.25−10.25=3
ˆ2 = 9.25 −10.25 = −1 ˆ4 =11−10.25=0.75

General Linear Model: Time versus Row; Worker; Method
Type Levels Values
DF Seq SS
3 18.500
3 51.500
3 72.500
6 10.500
15 153.000
FP 3.52 0.089 9.81 0.010 13.81 0.004
S = 1.32288
R-Sq = 93.14%
R-Sq(adj) = 82.84%
4 1; 2; 3; 4
4 1; 2; 3; 4
4 1; 2; 3; 4
Analysis of Variance for time, using Adjusted SS for Tests

Tykey’s 95% simultaneous confidence intervals
−(ˆ−ˆw 2MSE/t)withw=q /2 i j i j T T t,(t−1)(t−2),a
t=4,MSE=1.75,q4,6,0.05 =4.9,wT =3.465,wT 2MSE/t=3.241  −   (ˆ − ˆ  3.241) = (1.75  3.241) = (−1.49,4.99)
 − (ˆ −ˆ 3.241)=(5.753.241)=(2.51,8.99) 3131
4 −3 (ˆ4 −ˆ3 3.241)=(−2.253.241)=(−5.49,0.99)

Tukey 95.0% Simultaneous Confidence Intervals
Response Variable Time
All Pairwise Comparisons among Levels of Method
Method = 1 subtracted from:
Lower Center
-1.491 1.750
2.509 5.750
0.259 3.500
—-+———+———+———+–
(——-*——-)
(——-*——-)
(——-*——-)
—-+———+———+———+–
-4.0 0.0 4.0 8.0
—-+———+———+———+–
(——-*——-)
(——-*——-)
—-+———+———+———+–
-4.0 0.0 4.0 8.0
Method = 2 subtracted from:
Lower Center
0.759 4.000
-1.491 1.750
Method = 3 subtracted from:
Method Lower Center Upper
4 -5.491 -2.250 0.9910 (——-*——-)
—-+———+———+———+–
—-+———+———+———+–
-4.0 0.0 4.0 8.0

Residual Plots for Time

Analysis of Variance
The (additive) model can be written as
Yijk =+ai +bj +k +ijk ,
μ is the general mean
 k the effect of level k (Latin letters)
ai the effect of group response (rows)
( k = 1,2,…, t ) of factor (treatment k) on the response
i ( i = 1,2,…, t ) of the 1st grouping variable on the
bj the effect of group j ( j =1,2,…,t ) of the second grouping variable on the
response (columns)
ijk is the experimental error [We assume that these are independent random
variables with normal distribution N(0, 2 ) ]
Fixed effects

ANOVA TABLE
F = MSTr MSE
(t −1)(t − 2)
MSE = SSE (t−1)(t−2)
for k =1,2,…,t

Latin squares have «limited» degrees of freedom for SSE, especially in the cases where the order t of the Latin square is small.
t=3→dfSSE =2
t=4→dfSSE =6
t=5→dfSSE =12
We may use replications of the Latin square to increase the degrees of freedom for SSE.
There are four different choices:
1) Replication using the same levels of both blocking variables
2a) Replication using t new levels of the 1st blocking variable (rows) and the same levels of the 2nd blocking variable (columns)
2b) Replication using t new levels of the 2nd blocking variable (columns) and the same levels of the 1st blocking variable (rows)
3) Replication using t new levels of the 1st blocking variable (rows) and t new levels for the 2nd blocking variable (columns).
In all cases we include in the model the effects of the replication. The treatments (Latin Letters) stay the same.

Case 1. Analysis of Variance
The (additive) model in the case of r 1 replicates of the tt Latin square can be written to the form:
μ the general mean
 k the effect of level k response (Latin letters)
ai the effect of group i response (rows)
( k = 1,2,…, t ) of the factor (treatment k) on the
( i = 1,2,…, t ) of the 1st grouping variable on the
Yijkl =+ai +bj +k +cl +ijkl ,
bj the effect of group j ( j =1,2,…,t ) of the 2nd grouping variable on the
response (columns)
cl the effect of the l th replication ( l = 1,2,…, r )
ijk random experimental error [we suppose that the error are independent random variables with normal distribution N(0, 2 ) ]

Yi . .. is the sum of the observations of the ith row
Y is the sum of the observations of the jth column . j..
Y.. k . is the sum of the observations of the kth treatment (k th letter) Y…l is the sum of the observations of the lth replication
Y…. is the total sum of all observations We have that
1t11t1 SSR= Y2− Y2, SSC= Y2− Y2,
i… …. rt i=1 N
. j.. …. rt j=1 N
SSTr=1t Y2 −1Y2, ..k . ….
=1t Y2 −1Y2 …l ….
SS SST=Y2 − Y2 and
rtk=1 N tttr 1
ijkl …. N
i=1 j=1 k=1 l=1
SSE = SST − SSR − SSC − SSTr − SSreplicate
where N = rt 2 is the total number of observations.

ANOVA Table
F = MSTr MSE
SS replicate
SS replicate r −1
(t −1)[r(t +1) − 3]
MSE = SSE (t−1)[r(t+1)−3]

We wish to study the effect of a diet in the cows’ milk production. Three different diets are tested using three different cows. Each diet is given for 3 different periods (1 month, 3 months and 6 months) to each cow and the milk production is recorded. A reasonable period with normal diet is given to each cow between the diet changes. Due to time limitations the following Latin square is used for the design of the experiment. Two replicates of the design on the same cows with same periods (on two consequent years) are used. The data collected are given in the parenthesis.
Replicate Ι (2001) Replicate ΙΙ (2002)
Time period
Time period
Α(38) Β(25) Γ(75) Β(39) Γ(86) Α(39) Γ(90) Α(42) Β(27)
Α(86) Β(66) Γ(86) Β(45) Γ(95) Α(74) Γ(101) Α(63) Β(56)

Replicate Ι (2001)
Replicate ΙΙ (2002)
Time period
Time period
Α(38) Β(25) Γ(75) Β(39) Γ(86) Α(39) Γ(90) Α(42) Β(27)
Α(86) Β(66) Γ(86) Β(45) Γ(95) Α(74) Γ(101) Α(63) Β(56)
Y =38+25+75+86+66+86=376 1…
Y2… =39+86+39+45+95+74=378 Y3… =90+42+27+101+63+56=379
Y =38+39+42+86+74+63=342 .. A.
Y =25+39+27+66+45+56=258 ..B.
Y =75+86+90+86+95+101=533 ...
Y…1 =38+25+75+39+86+39+90+42+27=461
Y…2 =86+66+86+45+95+74+101+63+56=672
Y…. =1133
Y =38+39+90+86+45+101=399 .1..
Y.2.. =25+86+42+66+95+63=377 Y.3.. =75+39+27+86+74+56=357

SSR=1(427901)−111332 =0.778, 6 18
SSC = 1 (428779) − 1 11332 = 147.111, 6 18
SSTr = 1 (467617) − 1 11332 = 6620.111 , 6 18
= 1 (664105) − 1 11332 = 2473.389 32 18
SST = Y 2 − ijkl
11332 = 81705 − 71316.056 = 10388.944 SSE = SST − SSR − SSC − SSTr − SSreplicate = 1147.555
i=1 j=1 k=1 l=1 and

ANOVA Table
Time period
Replicate 2473.389 1 2473.389
ΜΙΝΙΤΑΒ οutput
Analysis of Variance for y, using Adjusted SS for Tests
Source DF
cow 2
time 2
diet 2 6620.1 6620.1 3310.1 28.84 0.000
rep 1 2473.4 2473.4 2473.4 21.55 0.001
Error 10 1147.6 1147.6 114.8
Total 17 10388.9
0.00 0.997
0.64 0.547

Case 2a. Analysis of Variance
The (additive) model in the case of r 1 replicates of the tt Latin square but in t different levels of «rows» can be written in the form
i =1,2,…,t Y =+a +b++c+ j=1,2,…,t,
ijkl i(l) j k l ijkl k =1,2,…,t l =1,2,…,r
• The effects of «rows» are now nested in each of the l = 1,2,…, r Latin
squares and
• Foreachl=1,2,…,rwehavethatt ai(l)=0. i=1

Yi . .l is the sum of the observations of the ith row in the lth Latin square
Y is the sum of the observations of the jth column . j..
Y.. k . is the sum of the observations of the kth treatment (k th letter) Y…l is the sum of the observations of the lth replication
Y…. is the total sum of all observations
We have that
1rtrY21t1 SSR= Y2 −…l , SSC= Y2 − Y2,
rt ..j. N …. j=1
l=1 i=1 SSTr=1t Y2 −1Y2,
l=1 ..k . ….
=1t Y2 −1Y2 …l ….
SS SST=Y2 − Y2 and
rtk=1 N tttr 1
ijkl …. N
i=1 j=1 k=1 l=1
SSE = SST − SSR − SSC − SSTr − SSreplicate
where N = rt 2 is the total number of observations.

ANOVA Table
SSR r(t−1)
F = MSTr MSE
SS replicate
SS replicate r −1
(t −1)(rt − 2)
MSE = SSE (t−1)(rt−2)

We wish to study (again) the effect of a diet in the cows’ milk production. Three different diets are tested using three different cows. Each diet is given for 3 different periods (1 month, 3 months and 6 months) to each cow and the milk production is recorded. A reasonable period with normal diet is given to each cow between the diet changes. Due to time limitations the following Latin square is used for the design of the experiment. Two replicates of the design, on different cows and the same time periods, have been used. The data collected are given in the parenthesis.
Replicate Ι Replicate ΙΙ
Time period
Time period
Α(38) Β(25) Γ(75) Β(39) Γ(86) Α(39) Γ(90) Α(42) Β(27)
Α(86) Β(66) Γ(86) Β(45) Γ(95) Α(74) Γ(101) Α(63) Β(56)

Replicate Ι
Replicate ΙΙ
Time period
Time period

程序代写 CS代考 加微信: powcoder QQ: 1823890830 Email: powcoder@163.com