View source: R/compose_identical.R
compose_identical | R Documentation |
This is an internal function which creates identical choice sets configurations for give experimental design. The function simplifies the size adjustment of Z depending on the population size of X.
compose_identical(experimental_design, n = NULL, size)
experimental_design |
An 'experimental_design' object. |
n |
Number of different choice situations per individual. Is NULL by default, ensuring that the function will retreive the n value from the 'experimental_design'. |
size |
Population size for Z to be adjusted to. |
data.frame Z dataset
# 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), n = 4) # Compose Z <- compose_identical(edesign, size = 2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.