seq_clatworthy: Clatworthy (1973) cross-over design specification

Description Usage Arguments Details Value Author(s) References Examples

View source: R/seq_clatworthy.R

Description

Specifies cross-over designs from Clatworthy (1973).

Usage

1
2
seq_clatworthy(type = "R", selection = 1, labels, as_matrix = T,
  summary = T)

Arguments

type

A character string indicating which type of sequences to return. Must be one of "R", "S", and "SR". Defaults to "R".

selection

A numeric integer or character string indicating which design to return, for the chosen value of type. See Details for information on how to ascertain supported values. Defaults to 1.

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.

summary

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

Details

seq_clatworthy() supports the specification of designs from Clatworthy (1973). Designs for a large array of values of the number of treatments and periods are available (accessible by setting selection and type carefully), for any chosen treatment labels (see labels). In addition, the designs can be returned in matrix or tibble form (see as_matrix).

Precisely, type must be set as one of "R", "S", and "SR". Then, selection can take one of a particular set of numeric or character values. The best way to ascertain which values are allowed is to use the utility function summary_seq_clatworthy. 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

Clatworthy WH, Cameron JM, Speckman JA (1973) Tables of two-associate-class partially balanced designs. US Government Printing Office.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
# A selection of designs for four treatments from Clatworthy (1973)
clatworthy1        <- seq_clatworthy()
clatworthy2        <- seq_clatworthy(selection = 2)
clatworthy3        <- seq_clatworthy(selection = 3)
clatworthy4        <- seq_clatworthy(selection = 4)
# Using different labels
clatworthy1_ABCD   <- seq_clatworthy(labels = LETTERS[1:4])
clatworthy2_ABCD   <- seq_clatworthy(selection = 2, labels = LETTERS[1:4])
clatworthy3_ABCD   <- seq_clatworthy(selection = 3, labels = LETTERS[1:4])
clatworthy4_ABCD   <- seq_clatworthy(selection = 4, labels = LETTERS[1:4])
# Returning in tibble form
clatworthy1_tibble <- seq_clatworthy(as_matrix = F)
clatworthy2_tibble <- seq_clatworthy(selection = 2, as_matrix = F)
clatworthy3_tibble <- seq_clatworthy(selection = 3, as_matrix = F)
clatworthy4_tibble <- seq_clatworthy(selection = 4, as_matrix = F)

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