Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

LATIN SQUARE DESIGN

PRACTICAL 6
Liya Elizabeth 2140881

2023-09-26

INTRODUCTION
A Latin square design is a type of experimental design used in statistics and experimental
research. It is characterized by its structured arrangement of treatments or conditions in a
two-dimensional grid, ensuring that each treatment appears exactly once in each row and
column, thereby reducing the impact of extraneous variables and enhancing experimental
control.

AIM
An experiment was carried out to determine the effect of claying the ground on the field of
barley grains, perform the ANOVA and calculate the critical difference for the treatment
mean yields.

PROCEDURE
Ho: There is no significant difference between the effects of claying the ground on the
field of barley grains.
H1: There is significant difference between the effects of claying the ground on the field
of barley grains.

library(stats)
library(lsmeans)

## Warning: package 'lsmeans' was built under R version 4.1.3

## Loading required packae: emmeans

## The 'lsmeans' package is now basically a front end for 'emmeans'.


## Users are encouraged to switch the rest of the way.
## See help('transition') for more information, including how to
## convert old 'lsmeans' objects and scripts to work with 'emmeans'.
clay <- c("D" , "C" , "A" , "B" , "B" , "A" , "D" , "C" ,"C" , "D" ,
"B" ,"A" ,"A" , "B" , "C", "D" )
row <- c(rep("R1",1),rep("R2",1),rep("R3",1),rep("R4",1))
column <- c(rep("C1",4),rep("C2",4),rep("C3",4),rep("C4",4))
values <-
c(29.1,16.4,5.4,24.9,18.9,10.2,38.8,41.7,29.4,21.2,24.0,9.5,5.7,19.1,37.0,28.
9)
matrix(clay,4,4)

## [,1] [,2] [,3] [,4]


## [1,] "D" "B" "C" "A"
## [2,] "C" "A" "D" "B"
## [3,] "A" "D" "B" "C"
## [4,] "B" "C" "A" "D"

data <- data.frame(row,column,clay,values)


data

## row column clay values


## 1 R1 C1 D 29.1
## 2 R2 C1 C 16.4
## 3 R3 C1 A 5.4
## 4 R4 C1 B 24.9
## 5 R1 C2 B 18.9
## 6 R2 C2 A 10.2
## 7 R3 C2 D 38.8
## 8 R4 C2 C 41.7
## 9 R1 C3 C 29.4
## 10 R2 C3 D 21.2
## 11 R3 C3 B 24.0
## 12 R4 C3 A 9.5
## 13 R1 C4 A 5.7
## 14 R2 C4 B 19.1
## 15 R3 C4 C 37.0
## 16 R4 C4 D 28.9

matrix(values,4,4)

## [,1] [,2] [,3] [,4]


## [1,] 29.1 18.9 29.4 5.7
## [2,] 16.4 10.2 21.2 19.1
## [3,] 5.4 38.8 24.0 37.0
## [4,] 24.9 41.7 9.5 28.9

myfit <- lm(values~row+column+clay,data)


anova(myfit)

## Analysis of Variance Table


##
## Response: values
## Df Sum Sq Mean Sq F value Pr(>F)
## row 3 259.31 86.44 3.3167 0.09854 .
## column 3 155.27 51.76 1.9860 0.21760
## clay 3 1372.12 457.37 17.5497 0.00225 **
## Residuals 6 156.37 26.06
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

CRITICAL DIFFERENCE FOR TREATMENT MEAN YIELDS


x=lsmeans(myfit,"clay")
pairs(x)

## contrast estimate SE df t.ratio p.value


## A - B -14.03 3.61 6 -3.885 0.0310
## A - C -23.43 3.61 6 -6.489 0.0026
## A - D -21.80 3.61 6 -6.039 0.0038
## B - C -9.40 3.61 6 -2.604 0.1386
## B - D -7.78 3.61 6 -2.154 0.2379
## C - D 1.62 3.61 6 0.450 0.9672
##
## Results are averaged over the levels of: row, column
## P value adjustment: tukey method for comparing a family of 4 estimates

RESULT AND CONCLUSION


From the anova analysis we can see that the p value for clay is 0.00225 which is less than
0.05, therefore we reject the null hypothesis which means there is significant difference on
the effect of claying.
From the critical difference analysis, A and B, A and C, A and D are different from each
other as the p value is less than 0.05, hence they are significantly different.

You might also like