designs_r | R Documentation |
Create experimental design using random number generator. The design configuration assumes that all alternatives' attributes are defined by random generators: 'declared using 'r' class simulation functions. Other attribute types will be ignored.
designs_r(experimental_design, n = NULL)
experimental_design |
Input experimnetal design object |
n |
The number of choice sets to be generated. |
data.frame A dataset of choice sets (Z) respecting randomized Design.
# Create alternatives alt1 <- alternative$new() alt1$add_attributes(Quality = runif(min = 0, max = 1), Price = rnorm(mean = 5)) alt2 <- alternative$new() alt2$add_attributes(Size = runif(min = 0, max = 1), Price = rnorm(mean = 6)) # Regroup alternatives into design edesign <- experimental_design$new(alternatives = list(alt1, alt2)) Z <- designs_r(edesign, n = 1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.