seq_patterson_lucas: Patterson and Lucas (1962) cross-over design specification

Description Usage Arguments Details Value Author(s) References Examples

View source: R/seq_patterson_lucas.R

Description

Specifies cross-over designs from Patterson and Lucas (1962).

Usage

1
2
seq_patterson_lucas(selection = 1, labels, as_matrix = T,
  summary = T)

Arguments

selection

A single numeric integer indicating which design to return. See Details for information on supported values.

labels

A vector of labels for the treatments. If specified, should have length corresponding to the number of treatments in the chosen design, containing unique elements. If missing, will internally default to 0:(D - 1), where D is the number of treatments.

as_matrix

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

Details

seq_patterson_lucas() supports the specification of designs from Patterson and Lucas (1962). Designs for three through nine 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).

Precisely, designs are indexed using the argument selection, which can take the following values for the following numbers of treatments:

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 data from the Crossover package by Kornelius Rohmeyer.

References

Patterson HD, Lucas HL (1962) Change-over designs. North Carolina Agricultural Experiment Station. Tech Bull 147.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
# Patterson and Lucas (1962) designs for three treatments
patterson_lucas1         <- seq_patterson_lucas()
patterson_lucas30        <- seq_patterson_lucas(selection = 30)
patterson_lucas31        <- seq_patterson_lucas(selection = 31)
# Using different labels
patterson_lucas1_ABC     <- seq_patterson_lucas(labels = LETTERS[1:3])
patterson_lucas30_ABC    <- seq_patterson_lucas(selection = 30,
                                                labels = LETTERS[1:3])
patterson_lucas31_ABC    <- seq_patterson_lucas(selection = 31,
                                                 labels = LETTERS[1:3])
# Returning in tibble form
patterson_lucas1_tibble  <- seq_patterson_lucas(as_matrix = F)
patterson_lucas30_tibble <- seq_patterson_lucas(selection = 30,
as_matrix = F)
patterson_lucas31_tibble <- seq_patterson_lucas(selection = 31,
                                                as_matrix = F)

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