Description Usage Arguments Value Examples
Create testdata for clinical studies
1 2 | createTestdata(strataVars, n = if (is.null(n.per.stratum)) 30 else NULL,
n.per.stratum = NULL, format.patient = "P%03d", offset.patient = 0)
|
strataVars |
List of strata variables, each of which is defined in the form of a vector of possible (character) values. |
n |
Number of records to be created |
n.per.stratum |
optional. Vector of integer numbers defining the number
of records for each possible stratum. The length of this vector must be
equal to the number of possible strata (resulting from the product of
lengths of vectors in |
format.patient |
Passed as argument |
offset.patient |
integer number to be added to the generated patient
numbers |
Data frame with a column patient
containing the patient's ID
and one column for each stratum, named according to the element names in
strataVars
1 2 3 4 5 6 7 8 9 10 | strataVars <- list(
sex = c("female", "male"),
medication = c("yes", "no")
)
createTestdata(strataVars, n = 20)
# Define the number of patients in each stratum (there are four possible
# strata: length(strataVars$sex) * length(strataVars$medication))
createTestdata(strataVars, n.per.stratum = c(5, 6, 3, 4))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.