Learn R Programming

pbbd (version 1.0.0)

balancify: Position balanced and nearly position balanced block design

Description

This function generates a position balanced or nearly position balanced block design from a given equireplicate and proper block design

Usage

balancify(d1)

Arguments

d1

Block design specified in the form of a b x k matrix with elements labelled as 1 to v where b is number of blocks, k is block size and v is number of treatments

Value

design

(Nearly) position balanced block design

P

Treatment by Position incidence matrix

Examples

Run this code
# NOT RUN {
d1 = matrix(c(3,  4,    6,
5,    6,    7,
1,   4,    5,
2,    4,    7,
1,    3,    7,
1,    2,    6,
2,    3,    5), ncol = 3, byrow = TRUE)
balancify(d1)

d1 = matrix(c(7	,	8	,	9	,
              1	,	6	,	8	,
              1	,	3	,	9	,
              4	,	6	,	9	,
              5	,	6	,	7	,
              1	,	4	,	5	,
              3	,	5	,	8	,
              3	,	4	,	7	,
              2	,	5	,	9	,
              2	,	4	,	8	,
              1	,	2	,	7	,
              2	,	3	,	6), ncol = 3, byrow = TRUE)
balancify(d1)
# }

Run the code above in your browser using DataLab