# Creating a sample dataset for Pooled Latin Square Design (LSD)
df <- data.frame(
Location = factor(c(rep("Agra", 16), rep("Bihar", 16))), # Locations
Treatment = factor(c(4, 2, 3, 1, 3, 1, 4, 2, 1, 4, 2, 3, 2, 3, 1, 4,
4, 2, 3, 1, 3, 1, 4, 2, 1, 4, 2, 3, 2, 3, 1, 4)), # Treatments
Row = factor(rep(1:4, each = 4, times = 2)), # Row factor
Column = factor(rep(1:4, times = 8)), # Column factor
Yield = c(29.1, 18.9, 29.4, 5.7, 16.4, 10.2, 21.2, 19.1, 5.4, 38.8, 24, 37,
24.9, 41.7, 9.5, 28.9, 13, 27, 7, 24, 10, 13, 41, 39, 42, 26, 19, 20,
20, 35, 8, 38) # Yield values
)
# Running PooledLSD function on the dataset
out <- PooledLSD(df, "Yield", "Location", "Treatment", "Row", "Column", 0.05, 1)
# Print results
print(out)
Run the code above in your browser using DataLab