seq_lewis: Lewis _et al._ (1988) cross-over design specification

Description Usage Arguments Details Value Author(s) References Examples

View source: R/seq_lewis.R

Description

Specifies cross-over designs from Lewis et al. (1988).

Usage

1
2
seq_lewis(D = 4, selection = 1, labels = 0:(D - 1), as_matrix = T,
  summary = T)

Arguments

D

The number of treatments. Must be either four, six, eight, or nine. Defaults to 4.

selection

A single numeric integer indicating which design to return, for the chosen value of D. See Details for information on supported values.

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_lewis() supports the specification of designs from Lewis et al. (1988). Designs for four, six, eight, and 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, for D equal to four, six, eight and nine, there are six, eight, four, and two sets of sequences available respectively (accessible by setting selection equal to one through eight as appropriate). 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

Lewis SM, Fletcher DJ, Matthews JNS (1988) Factorial cross-over designs in clinical trials. In Optimal Design and Analysis of Experiments, Eds: Dodge Y, Fedorov VV, Wynn HP, pp 133-140. Elsevier Science Publishers BV: North-Holland.

Examples

1
2
3
4
5
6
7
8
9
# Lewis et al. (1988) designs for nine treatments
lewis1         <- seq_lewis(D = 9)
lewis2         <- seq_lewis(D = 9, selection = 2)
# Using different labels
lewis1_LETTERS <- seq_lewis(D = 9, labels = LETTERS[1:9])
lewis2_LETTERS <- seq_lewis(D = 9, selection = 2, labels = LETTERS[1:9])
# Returning in tibble form
lewis1_tibble  <- seq_lewis(D = 9, as_matrix = F)
lewis2_tibble  <- seq_lewis(D = 9, selection = 2, as_matrix = F)

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