Description Usage Arguments Value Author(s) Examples
View source: R/response.R View source: R/RcppExports.R
Generates random efficacy responses of subjects randomized in a clinical trial
1  response(distr, distr_param, treatment)

distr 
distribution of responses. The following values are supported:

distr_param 
parameter(s) of the response distribution (a named list with numeric vector(s)
of length K each, where K is a total number of treatments studied in a clinical
trial. It must have the following structure depending on a value of the

treatment 
vector of treatment assignments (contains integers from 1 to K, where K is a total number of treatments studied in a clinical trial). 
a numeric vector of rsponses' values
Yevgen Ryeznik ([email protected]), Oleksandr Sverdlov
1 2 3 4 5 6 7 8 9 10 11 12 13 14  library(artool)
# generate random treatment assignments (4 treatments, equal probabilities)
treatment < sample(1:4, 100, replace = TRUE, prob = rep(0.25,4))
# generate normal responses with the same means = 0 and all sds = 1
response("normal", list(mean = rep(0,4), sd = rep(1, 4)), treatment)
# generate normal responses with means c(0, 0.2, 0.4, 0.6), and sd's = c(0.1, 0.5, 0.7, 1)
response("normal", list(mean = c(0, 0.2, 0.4, 0.6), sd = c(0.1, 0.5, 0.7, 1)), treatment)
# generate Weibul responses with shapes = c(0.5, 1, 1.5, 2) and scale = 1
response("weibull", list(shape = c(0.5, 1, 1.5, 2), scale = rep(1, 4)), treatment)

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.