blocks(treatments, replicates, blocklevels = HCF(replicates),
searches = max(1, 100 - sum(treatments) - prod(blocklevels)),
seed = sample(10000, 1), jumps = 1)
treatments
list.treatments
and replicates
parameters partition the treatments design into sets of equally replicated treatments where
treatments
contains the set sizes and replicates
contains the set replication numbers.
The sum of the set sizes is the total number of treatments and the sum of the cross-products of the set sizes and the replication numbers
is the total number of plots. Treatments are numbered consecutively according to the treatments in the consecutive treatment sets.The blocklevels
parameter contains the numbers of nested blocks in the individual strata taken in order from the highest to the lowest stratum.
The first block number is the number of main blocks, the second, if any, is the number of sub-blocks nested in each main block, the third, if any,
is the number of sub-sub-blocks nested in each sub-block,and so on for all the reqired strata. If left blank, the default block design is a
maximal set of orthogonal main blocks, where the maximal number of of orthogonal main blocks is the highest common factor of the replication numbers.
Whatever the block and treatment design, the block sizes in each stratum are always as equal as possible and never differ by more than a single unit in any particular stratum. If the number of nested blocks in any particular stratum exactly divdes the number of units, the block sizes in that stratum will be exactly equal; otherwise the blocks will differ by a single unit only.
Special square and rectangular lattice designs are constructed algebraically and include all designs that can be constructed from any single latin square, from any complete sets of prime or prime-power orthogonal latin squares or from a pair of orthogonal 10 x 10 Latin squares. All other non-orthogonal block designs are constructed by a D-optimality swapping algorithm that makes improving swaps between blocks until a local optima is atttained. The swapping algorithm works from the top stratum downwards and is always constrained to make improving swaps within the levels of any existing blocks. The whole process will be repeated according to the number of searches defined by the search parameter and the design returned will be the design with the best overall stratum efficiencies in top-down order.
Lattice designs where v is a prime-power require the MOLS
package.
The principle design outputs comprise:
Very occasionally, the algorithm may fail to converge due to a near-singular design with a large number of single plot blocks. In that case, it may be best to build a simpler design with larger blocks and then to add the extra block constraints by hand using ad hoc or heuristic methods.
# 3 treatments x 2 replicates, 2 treatments x 4 replicates and 4 treatments x 3 replicates
# the hcf of the replication numbers is 1 therefore the default design is completely randomized
blocks(treatments=c(3,2,4),replicates=c(2,4,3))
# 4 treatments x 4 replicates with 2 main blocks each containing two complete replicates
blocks(treatments=4,replicates=4,blocklevel=2)
# 50 treatments x 4 replicates with 4 main blocks and 5 nested sub-blocks in each main block
blocks(treatments=50,replicates=4,blocklevels=c(4,5))
# as above but with 20 additional single replicate treatments
# giving exactly one single replicate treatment per sub-block
blocks(treatments=c(50,20),replicates=c(4,1),blocklevels=c(4,5))
# 64 treatments x 2 replicates with 2 main blocks and five succesively nested 2-level factors
blocks(treatments=64,replicates=2,blocklevels=c(2,2,2,2,2,2))
# concurrence matrix of balanced incomplete block design
crossprod(blocks(13,4,13,searches=100)$Incidences[[1]])
# concurrence matrix for 13 treatments x 4 replicates and 13 treatments with one rep in 13 blocks
crossprod(blocks(c(13,13),c(4,1),13)$Incidences[[1]])
# 2**10 treatments x 2 replicates in 2**10 blocks giving a fully saturated blocks design
# (requires a considerable time to run!)
d=blocks(1024,2,rep(2,10))
Run the code above in your browser using DataLab