Description Usage Arguments Details Value Author(s) References Examples
Specifies cross-over designs based on all possible compatible treatment combinations.
1 2 |
D |
The number of treatments. Must be a single
|
J |
The number of periods. Must be a single
|
max_occurrences |
The maximal number of times a treatment can be
allocated in any sequence. Must be a single |
labels |
A |
as_matrix |
A |
summary |
A |
max_repetititions |
The maximal number of times a treatment can be
repeatedly allocated in any sequence. Must be a single
|
seq_combs()
supports the specification of designs based on all
possible compatible treatment combinations for a given number of treatments
and periods. Designs for any number of treatments (see D
) and
periods (see J
) 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, all possible combinations of
D treatments across
J periods are determined, subject to the
specified restrictions on the maximal number of times a treatment can appear
in a sequence (see max_occurrences
), and the maximal number of
sequential periods a treatment can be repeatedly allocated in (see
max_repetitions
). 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.
NULL
if no compatible sequence exists.
Otherwise, 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
.
Based on code from the crossdes
package by
Oliver Sailer.
Jones B, Kenward MG (2014) Design and Analysis of Cross-Over Trials. Chapman and Hall: London, 3rd Edition.
1 2 3 4 5 6 7 8 9 10 | # Two-treatment two-period and three-treatment three-period designs, with
# maximal one allocation to a treatment
two_by_two <- seq_combs(D = 2)
three_by_three <- seq_combs(D = 3)
# Using different labels
two_by_two_AB <- seq_combs(D = 2, labels = c("A", "B"))
three_by_three_ABC <- seq_combs(D = 3, labels = c("A", "B", "C"))
# Returning in tibble form
two_by_two_tibble <- seq_combs(D = 2, as_matrix = F)
three_by_three_tibble <- seq_combs(D = 3, as_matrix = F)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.