Design of Experiments Latin Sqaures
An industrial engineer is investigating the effect of four assembly methods (A, B, C, D) on the assembly time for a color television component. Four operators are selected for the study. Furthermore, the engineer knows that each assem- bly method produces such fatigue that the time required for the last assembly may be greater than the time required for the first, regardless of the method. That is, a trend develops in the required assembly time. To account for this source of variability, the engineer uses the Latin square design shown below. Analyze the data from this experiment ( \(\alpha = 0.05\) ) and draw appropriate conclusions.
knitr:: kable (tibble:: tribble (
~ V1, ~ V2, ~ V3, ~ V4, ~ V5,
"1" , "C=10" , "D=14" , "A=7" ,"B=8" ,
"2" , "B=7" , "C=18" , "D=11" ,"A=8" ,
"3" , "A=5" , "B=10" , "C=11" ,"D=9" ,
"4" , "D=10" , "A=10" , "B=12" ,"C=14"
), col.names = c ("Order of Assembly" , "Operator 1" ,"Operator 2" , "Operator 3" , "Operator 4" ))
1
C=10
D=14
A=7
B=8
2
B=7
C=18
D=11
A=8
3
A=5
B=10
C=11
D=9
4
D=10
A=10
B=12
C=14
First we will try to solve the problem implementing the formula.
order= rep (1 : 4 ,each= 4 )
operator= rep (1 : 4 ,4 )
method= c ("C" ,"D" ,"A" ,"B" , "B" ,"C" ,"D" ,"A" ,"A" ,"B" ,"C" ,"D" ,
"D" ,"A" ,"B" ,"C" )
time= c (10 ,14 ,7 ,8 ,7 ,18 ,11 ,8 ,5 ,10 ,11 ,9 ,10 ,10 ,12 ,14 )
data= data.frame (order,operator,method,time)
head (data)
order operator method time
1 1 1 C 10
2 1 2 D 14
3 1 3 A 7
4 1 4 B 8
5 2 1 B 7
6 2 2 C 18
'data.frame': 16 obs. of 4 variables:
$ order : int 1 1 1 1 2 2 2 2 3 3 ...
$ operator: int 1 2 3 4 1 2 3 4 1 2 ...
$ method : chr "C" "D" "A" "B" ...
$ time : num 10 14 7 8 7 18 11 8 5 10 ...
data[,c (1 ,2 )]= lapply (data[,c (1 ,2 )],factor)
str (data)
'data.frame': 16 obs. of 4 variables:
$ order : Factor w/ 4 levels "1","2","3","4": 1 1 1 1 2 2 2 2 3 3 ...
$ operator: Factor w/ 4 levels "1","2","3","4": 1 2 3 4 1 2 3 4 1 2 ...
$ method : chr "C" "D" "A" "B" ...
$ time : num 10 14 7 8 7 18 11 8 5 10 ...
mean_order= aggregate (data$ time,list (data$ order),mean)
Attaching package: 'dplyr'
The following objects are masked from 'package:stats':
filter, lag
The following objects are masked from 'package:base':
intersect, setdiff, setequal, union
mean_order= data %>% group_by (order) %>% summarise_at (vars (time), list (mean = mean,SD= sd))
mean_order
# A tibble: 4 × 3
order mean SD
<fct> <dbl> <dbl>
1 1 9.75 3.10
2 2 11 4.97
3 3 8.75 2.63
4 4 11.5 1.91
boxplot (time~ order,data = data,main= "Box Plot of Time aganist Order" , xlab= "Order" ,ylab= "Time" )
mean_operator= data %>% group_by (operator) %>% summarise_at (vars (time), list (mean = mean,SD= sd))
mean_operator
# A tibble: 4 × 3
operator mean SD
<fct> <dbl> <dbl>
1 1 8 2.45
2 2 13 3.83
3 3 10.2 2.22
4 4 9.75 2.87
boxplot (time~ operator,data = data,main= "Box Plot of Time aganist Operator" , xlab= "Operator" ,ylab= "Time" )
mean_method= data %>% group_by (method) %>% summarise_at (vars (time), list (mean = mean,SD= sd))
mean_method
# A tibble: 4 × 3
method mean SD
<chr> <dbl> <dbl>
1 A 7.5 2.08
2 B 9.25 2.22
3 C 13.2 3.59
4 D 11 2.16
boxplot (time~ method,data = data,main= "Box Plot of Time aganist Method" , xlab= "Method" ,ylab= "Time" )
data[,c (1 ,2 ,3 )]= lapply (data[,c (1 ,2 ,3 )],factor)
str (data)
'data.frame': 16 obs. of 4 variables:
$ order : Factor w/ 4 levels "1","2","3","4": 1 1 1 1 2 2 2 2 3 3 ...
$ operator: Factor w/ 4 levels "1","2","3","4": 1 2 3 4 1 2 3 4 1 2 ...
$ method : Factor w/ 4 levels "A","B","C","D": 3 4 1 2 2 3 4 1 1 2 ...
$ time : num 10 14 7 8 7 18 11 8 5 10 ...
p= 4
SS_method <- sum (aggregate (time ~ method, data = data, sum)$ time^ 2 )/ p- sum (data$ time)^ 2 / (p^ 2 )
SS_method
SS_order= sum ((aggregate (time~ order,data,sum)$ time)^ 2 )/ p- (sum (data$ time)^ 2 )/ (p^ 2 )
SS_order
SS_operator= sum ((aggregate (time~ operator,data,sum)$ time)^ 2 )/ p- (sum (data$ time)^ 2 )/ (p^ 2 )
SS_operator
SS_total= sum (data$ time^ 2 )- (sum (data$ time))^ 2 / (p^ 2 )
SS_total
SS_error= SS_total- SS_order- SS_operator- SS_method
SS_error
Now we shall compute various mean sum of squares
MS_order= SS_order/ (p-1 )
MS_order
MS_operator= SS_operator/ (p-1 )
MS_operator
MS_method= SS_method/ (p-1 )
MS_method
MS_error= SS_error/ (p^ 2-3 * (p-1 )- 1 )
MS_error
F_method= MS_method/ MS_error
F_method
F_order= MS_order/ MS_error
F_order
F_operator= MS_operator/ MS_error
F_operator
pvalue_method= 1 - pf (F_method,p-1 ,p^ 2-3 * (p-1 )- 1 )
pvalue_method
pvalue_order= 1 - pf (F_order,p-1 ,p^ 2-3 * (p-1 )- 1 )
pvalue_order
pvalue_operator= 1 - pf (F_operator,p-1 ,p^ 2-3 * (p-1 )- 1 )
pvalue_operator
ANOVA Table for Latin Square
Method
72.5
3
24.1666667
13.8095238
0.004213
Order
18.5
3
6.1666667
3.5238095
0.0885187
Operator
51.5
3
17.1666667
9.8095238
0.0099259
Error
10.5
6
1.75
Total
153
15
Direct Execution of Latin Sqaure in R
[,1] [,2] [,3] [,4]
[1,] 10 7 5 10
[2,] 14 18 10 10
[3,] 7 11 11 12
[4,] 8 8 9 14
[,1] [,2] [,3] [,4]
[1,] "C" "B" "A" "D"
[2,] "D" "C" "B" "A"
[3,] "A" "D" "C" "B"
[4,] "B" "A" "D" "C"
model= lm (time~ order+ operator+ method,data= data)
anova (model)
Analysis of Variance Table
Response: time
Df Sum Sq Mean Sq F value Pr(>F)
order 3 18.5 6.1667 3.5238 0.088519 .
operator 3 51.5 17.1667 9.8095 0.009926 **
method 3 72.5 24.1667 13.8095 0.004213 **
Residuals 6 10.5 1.7500
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1