sim_cont: Simulate continuous outcome data from a cross-over trial

Description Usage Arguments Details Value References See Also

View source: R/sim_cont.R

Description

Facilitates the simulation of continuous outcome data from a cross-over trial, for a given cross-over design.

Usage

1
2
3
sim_cont(sequences, n = 1, replicates = 1000, intercept, period,
  treatment, carryover, subject, sigma_b = 1, sigma_e = 1,
  random = T, seed = Sys.time(), summary = T)

Arguments

sequences

An object of class xover_seq, describing the cross-over design for which data will be simulated.

n

Either a single numeric integer describing the number of subjects assigned to all of the sequences, or a numeric vector of integers having length equal to the number of sequences implied by sequences, with the elements describing the number of subject assigned to each of the sequences.

replicates

A single numeric integer describing the number of replicate datasets to generate.

intercept

A single numeric describing the intercept of the GLMM.

period

A numeric vector of length equal to one less than the number of periods implied by sequences, describing the values of each of the period effects.

treatment

A numeric vector of length equal to one less than the number of treatments implied by sequences, describing the values of each of the treatment effects.

carryover

A numeric vector of length equal to one less than the number of treatments implied by sequences, describing the values of each of the carryover effects.

subject

A numeric vector of length equal to one less than the number of subjects implied by n and sequences, describing the values of each of the subject effects.

sigma_b

A single strictly positive numeric describing the value of the between subject standard deviation.

sigma_e

A single strictly positive numeric describing the value of the residual standard deviation.

random

A logical variable indicating whether to treat the subject effects as random or fixed.

seed

A random number seed, to be passed to set.seed.

summary

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

Details

sim_bin() supports the simulation of continuous outcome data from a cross-over trial. Precisely, a cross-over design of class xover_seq is provided (see sequences). Then, the values of treatment, period, and several other input arguments determines the distribution of the simulated data. See the package vignette for further dettails.

Value

A list or class xover_sim containing in particular a list sim_data which holds the simulated data.

References

Jones B, Kenward MG (2014) Design and Analysis of Cross-Over Trials. Chapman and Hall: London, 3rd Edition.

See Also

as_xover_seq for converting designs to class xover_seq.


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