jeudi 18 mars 2021

Randomized complete block design

I am trying to do a "randomized complete block design" with 3 re-arrangements in R. I am doing a pot experiment with 9 treatments (3 fertilizer and 3 pesticide treatments are combined) and 6 replicates each, therefore I have chosen 6 blocks. Within the block a treatment is allowed to occur once per arrangement and each individual pot is only allowed to occur once within a block over all arrangements. For example: C_p+Min_1 can be in block 1 the first time, but afterwards can not return in block 1 again. At the same time no other replicate of this treatment (C_p+Min_2 - C_p+Min_6) can be in the same block as C_p+Min_1. My block design is a 6 x 9 raster, where a block is 3x3 raster in a square:

picture of 3x3 x 2 x 3 experimental design

What I did:

library(agricolae)
pesticide <- factor(rep(c("C_p", "Bio", "Syn"), each = 3))
fertilizer <- factor(rep(c("C_f", "Org", "Min"), times = 3))

treatments <- data.frame(fertilizer, pesticide)
treatments_combined <- paste(treatments$fertilizer, "+", treatments$pesticide)

design.rcbd(trt=treatments_combined, r=6, randomization = TRUE, first=TRUE)$sketch

This results in:

      [,1]        [,2]        [,3]        [,4]        [,5]        [,6]        [,7]        [,8]        [,9]       
[1,] "Org + C_p" "Org + Syn" "C_f + Syn" "Min + Syn" "C_f + Bio" "Min + C_p" "Org + Bio" "Min + Bio" "C_f + C_p"
[2,] "Min + Bio" "Min + Syn" "Min + C_p" "C_f + Bio" "Org + Syn" "C_f + C_p" "Org + C_p" "C_f + Syn" "Org + Bio"
[3,] "Org + Syn" "C_f + Bio" "C_f + Syn" "Org + Bio" "Org + C_p" "Min + C_p" "C_f + C_p" "Min + Syn" "Min + Bio"
[4,] "C_f + Bio" "Min + Bio" "Org + C_p" "C_f + C_p" "C_f + Syn" "Min + Syn" "Min + C_p" "Org + Bio" "Org + Syn"
[5,] "Org + C_p" "Org + Bio" "C_f + C_p" "C_f + Syn" "C_f + Bio" "Min + Bio" "Min + C_p" "Min + Syn" "Org + Syn"
[6,] "C_f + Syn" "C_f + C_p" "Min + Bio" "Org + Syn" "Org + Bio" "Min + C_p" "Org + C_p" "C_f + Bio" "Min + Syn"

So I get what I wanted once. Now I want to rearrange them 3 times. How can I do that, so that my specifications from above are met?




Aucun commentaire:

Enregistrer un commentaire