seq_fletcher: Fletcher (1987) cross-over design specification

Description Usage Arguments Details Value Author(s) References Examples

View source: R/seq_fletcher.R

Description

Specifies cross-over designs from Fletcher (1987).

Usage

1
2
seq_fletcher(D = 6, 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_fletcher() supports the specification of designs from Fletcher (1987). Deisgns 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 four, three, 12, and nine designs available respectively (accessible by setting selection equal to one through twelve asappropriate). 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

Fletcher DJ (1987) A new class of change-over designs for factorial experiments. Biometrika 74:649-54.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
# Fletcher (1987) designs for four treatments
fletcher1        <- seq_fletcher(D = 4)
fletcher2        <- seq_fletcher(D = 4, selection = 2)
fletcher3        <- seq_fletcher(D = 4, selection = 3)
fletcher4        <- seq_fletcher(D = 4, selection = 4)
# Using different labels
fletcher1_ABCD   <- seq_fletcher(D = 4, labels = LETTERS[1:4])
fletcher2_ABCD   <- seq_fletcher(D = 4, selection = 2, labels = LETTERS[1:4])
fletcher3_ABCD   <- seq_fletcher(D = 4, selection = 3, labels = LETTERS[1:4])
fletcher4_ABCD   <- seq_fletcher(D = 4, selection = 4, labels = LETTERS[1:4])
# Returning in tibble form
fletcher1_tibble <- seq_fletcher(D = 4, as_matrix = F)
fletcher2_tibble <- seq_fletcher(D = 4, selection = 2, as_matrix = F)
fletcher3_tibble <- seq_fletcher(D = 4, selection = 3, as_matrix = F)
fletcher4_tibble <- seq_fletcher(D = 4, selection = 4, as_matrix = F)

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