seq_mols: Mutually Orthogonal Latin Square cross-over design...

Description Usage Arguments Details Value Author(s) References Examples

View source: R/seq_mols.R

Description

Specifies either a complete set of Mutually Orthogonal Latin Squares (MOLS), or a single cross-over design based on a complete set of MOLS.

Usage

1
2
seq_mols(D = 4, type = "set", J = D, labels = 0:(D - 1),
  as_matrix = T, summary = T)

Arguments

D

The number of treatments. Must be a single numeric prime power between three and 100. Defaults to 3.

type

Must be either "set" or "single", indicating whether a complete set of MOLS, or a single cross-over design based on such a complete set, should be returned. Defaults to "set".

J

When type = "single", this will determine the number of periods in the resulting design. Must be a single numeric integer between two and D inclusive. Defaults to D.

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.

summary

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

Details

seq_mols() supports the specification of either a complete set of MOLS, or a single cross-over design based on such a set (see type). Designs for any prime power number of treatments (see D) are supported, for any chosen treatment labels (see labels). In addition, the designs can be returned in matrix or tibble form (see as_matrix). When a single cross-over design is to be returned, the number of periods can be any integer between two and D. Ultimately, the (k,j)th element of the cross-over design matrix/matrices corresponds to the treatment a subject on the kth sequence would receive in the jth period.

The complete set of MOLS is constructed using Galois fields. In the case that type = "set", D - 1 Latin Squares of order D will be constructed. They will be mutually orthogonal, i.e., if any two of them are super-imposed, the resulting array will contain each ordered pair (d1,d2 ) exactly once. The Latin Squares will be in standard order, i.e., the first sequence is always equal to the specified treatment labels. Otherwise, when type = "single", the resulting design will have D(D - 1) sequences, and each treatment will appear in each sequence at most once. The design will be a generalized Youden design that is also balanced for carryover effects.

Value

If type = "single": 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). Otherwise, if type = "set", a list consisting of either matrices or tibbles, again dependent on the value of as_matrix. In either case, the returned object(s) will have class xover_seq.

Author(s)

Based on functions from the crossdes package by Oliver Sailer.

References

Wakeling IN, MacFie HJH (1995) Designing consumer trials balanced for first and higher orders of carry-over effect when only a subset of k samples from t may be tested. Food Qual Prefer 6:299-308.

Williams EJ (1949) Experimental designs balanced for the estimation of residual effects of treatments. Aust J Sci Res Ser A 2:149-168.

Examples

1
2
3
4
# A complete set of MOLS for three treatments
mols_set    <- seq_mols()
# A corresponding cross-over design, based on a complete set of MOLS
mols_single <- seq_mols(type = "single")

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