# Latin Square Designs

## Dynamite Example

#### Program Listing

```OPTIONS LS=76 NONUMBER NODATE NOCENTER;

DATA dynamite;
DO batch = 1 TO 5;   /* row block factor, 5 batches of raw materials */
DO operator = 1 TO 5;   /* column block factor, 5 operators */
INPUT formula \$ response @@;   /* Latin letters, treatment level and response */
OUTPUT;
END;
END;
DATALINES;
A 24   B 20   C 19   D 24   E 24
B 17   C 24   D 30   E 27   A 36
C 18   D 38   E 26   A 27   B 21
D 26   E 31   A 26   B 23   C 22
E 22   A 30   B 20   C 29   D 31
;

TITLE1 'Latin Square Designs';
TITLE2 'Dynamite Example';
PROC GLM DATA=dynamite;
CLASS formula batch operator;
MODEL response = formula batch operator;
RUN;
TITLE3 'Treatment Means and Block Means';
MEANS formula batch operator;
RUN;
* Upon inspection of the ANOVA table, the treatment factor
formula is judged significant.  Hence, it is desirable
to perform stage 2 analysis. ;
TITLE3 'Protected LSD for Treatment Means';
MEANS formula/LSD;
RUN;
TITLE3 'Least Square Means for Treatments';
LSMEANS formula/TDIFF;
QUIT;
```

#### Output Listing

```Latin Square Designs
Dynamite Example

The GLM Procedure

Class Level Information

Class         Levels    Values
formula            5    A B C D E
batch              5    1 2 3 4 5
operator           5    1 2 3 4 5

Number of Observations Used          25

Dependent Variable: response
Sum of
Source            DF       Squares   Mean Square  F Value  Pr > F
Model             12   548.0000000    45.6666667     4.28  0.0089
Error             12   128.0000000    10.6666667
Corrected Total   24   676.0000000

R-Square     Coeff Var      Root MSE    response Mean
0.810651      12.85821      3.265986         25.40000

Source            DF     Type I SS   Mean Square  F Value  Pr > F
formula            4   330.0000000    82.5000000     7.73  0.0025
batch              4    68.0000000    17.0000000     1.59  0.2391
operator           4   150.0000000    37.5000000     3.52  0.0404

Source            DF   Type III SS   Mean Square  F Value  Pr > F
formula            4   330.0000000    82.5000000     7.73  0.0025
batch              4    68.0000000    17.0000000     1.59  0.2391
operator           4   150.0000000    37.5000000     3.52  0.0404

Latin Square Designs
Dynamite Example
Treatment Means and Block Means

The GLM Procedure

Level of           -----------response----------
formula      N             Mean          Std Dev

A            5       28.6000000       4.66904701
B            5       20.2000000       2.16794834
C            5       22.4000000       4.39317653
D            5       29.8000000       5.40370243
E            5       26.0000000       3.39116499

Level of           -----------response----------
batch        N             Mean          Std Dev

1            5       22.2000000       2.48997992
2            5       26.8000000       7.04982269
3            5       26.0000000       7.64852927
4            5       25.6000000       3.50713558
5            5       26.4000000       5.02991054

Level of           -----------response----------
operator     N             Mean          Std Dev

1            5       21.4000000       3.84707681
2            5       28.6000000       6.91375441
3            5       24.2000000       4.60434577
4            5       26.0000000       2.44948974
5            5       26.8000000       6.45755372

Latin Square Designs
Dynamite Example
Protected LSD for Treatment Means

The GLM Procedure

t Tests (LSD) for response

NOTE: This test controls the Type I comparisonwise error rate, not the
experimentwise error rate.

Alpha                            0.05
Error Degrees of Freedom           12
Error Mean Square            10.66667
Critical Value of t           2.17881
Least Significant Difference   4.5005

Means with the same letter are not significantly different.

t
Groupi
ng            Mean      N    formula
A        29.800      5    D
A
A        28.600      5    A
A
B    A        26.000      5    E
B
B    C        22.400      5    C
C
C        20.200      5    B

Latin Square Designs
Dynamite Example
Least Square Means for Treatments

The GLM Procedure
Least Squares Means

response      LSMEAN
formula          LSMEAN      Number
A            28.6000000           1
B            20.2000000           2
C            22.4000000           3
D            29.8000000           4
E            26.0000000           5

Least Squares Means for Effect formula
t for H0: LSMean(i)=LSMean(j) / Pr > |t|

Dependent Variable: response

i/j              1             2             3             4             5
1                    4.066633      3.001562      -0.58095       1.25872
0.0016        0.0110        0.5720        0.2321
2      -4.06663                    -1.06507      -4.64758      -2.80791
0.0016                      0.3078        0.0006        0.0158
3      -3.00156       1.06507                    -3.58251      -1.74284
0.0110        0.3078                      0.0038        0.1069
4      0.580948       4.64758       3.58251                    1.839667
0.5720        0.0006        0.0038                      0.0907
5      -1.25872      2.807913      1.742843      -1.83967
0.2321        0.0158        0.1069        0.0907

NOTE: To ensure overall protection level, only probabilities associated
with pre-planned comparisons should be used.
```