seq_bib: Balanced Incomplete Block cross-over design generation

Description Usage Arguments Details Value Author(s) References Examples

View source: R/seq_bib.R

Description

Searches for a Balanced Incomplete Block (BIB) cross-over design.

Usage

1
2
seq_bib(D = 3, J = 2, K = 12, labels = 0:(D - 1), as_matrix = T,
  max_iter = 100, summary = T)

Arguments

D

The number of treatments. Must be a single numeric integer greater than or equal to three. Defaults to 3.

J

The number of periods. Must be a single numeric integer greater than or equal to two. Defaults to 2.

K

The number of sequences. Must be a single numeric integer greater than or equal to two. Defaults to 12.

labels

A vector of labels for the treatments. Should be of length D, containing unique elements. Defaults to 0:(D - 1).

as_matrix

A logical variable indicating whether the design should be returned as a matrix, or a tibble. Defaults to T.

max_iter

The maximum allowed number of iterations in the search procedure. Must be a single numeric integer greater than or equal to one. Passed to optBlock. Defaults to 100.

summary

A logical variable indicating whether a summary of the function's progress should be printed to the console. Defaults to T.

Details

seq_bib() uses the function optBlock from the AlgDesign package to search for a BIB design. Subject to the conditions described below, any number of sequences (see K), for any number of treatments (see D) and periods (see J) are supported, for any chosen treatment labels (see labels). In addition, the designs can be returned in matrix or tibble form (see as_matrix).

Precisely, the function optBlock tries to find a D-optimal block design for the specified parameters. The resulting design need not be a BIB design. The necessary conditions for the existence are that JK/D and JK(J - 1)/(D(D - 1)): these are therefore enforced by the function. However, even if they are fulfilled, there need not be a BIB design. If no BIB design is found, the call to optBlock is iterated. If no BIB design is found after max_iter iterations, the search is terminated. The resulting design should be checked by the user by applying the function classify_seq. Ultimately, the (k,j)th element of the cross-over design matrix corresponds to the treatment a subject on the kth sequence would receive in the jth period.

Value

Either a matrix if as_matrix = T (with rows corresponding to sequences and columns to periods), or a tibble if as_matrix = F (with rows corresponding to a particular period on a particular sequence). In either case, the returned object will have class xover_seq.

Author(s)

Based on code from the crossdes package by Oliver Sailer.

References

Wheeler RE (2014) AlgDesign: Algorithmic Experimental Design. Version 1.1-7.3. URL: https://CRAN.R-project.org/package=AlgDesign.

Examples

1
2
3
4
5
6
7
8
# A three-treatment two-period twelve-sequence design
bib        <- seq_bib()
# Using different labels
bib_ABC   <- seq_bib(labels = LETTERS[1:3])
# Returning in tibble form
bib_tibble <- seq_bib(as_matrix = F)
# Check that the design is a BIB design
check      <- classify_seq(bib)

mjg211/xover documentation built on Oct. 16, 2019, 10:46 a.m.