cbc_design | R Documentation |
This function creates experimental designs for choice-based conjoint experiments using multiple design approaches including optimization and frequency-based methods.
cbc_design(
profiles,
method = "random",
priors = NULL,
n_alts,
n_q,
n_resp = 100,
n_blocks = 1,
n_cores = NULL,
no_choice = FALSE,
label = NULL,
randomize_questions = TRUE,
randomize_alts = TRUE,
remove_dominant = FALSE,
dominance_types = c("total", "partial"),
dominance_threshold = 0.8,
max_dominance_attempts = 50,
max_iter = 50,
n_start = 5,
include_probs = FALSE,
use_idefix = TRUE
)
profiles |
A data frame of class |
method |
Choose the design method: "random", "shortcut", "minoverlap", "balanced", "stochastic", "modfed", or "cea". Defaults to "random" |
priors |
A |
n_alts |
Number of alternatives per choice question |
n_q |
Number of questions per respondent (or per block) |
n_resp |
Number of respondents (for random/shortcut designs) or 1 (for optimized designs that get repeated) |
n_blocks |
Number of blocks in the design. Defaults to 1 |
n_cores |
Number of cores to use for parallel processing in the design search. Defaults to NULL, in which case it is set to the number of available cores minus 1. |
no_choice |
Include a "no choice" option? Defaults to FALSE |
label |
The name of the variable to use in a "labeled" design. Defaults to NULL |
randomize_questions |
Randomize question order for each respondent? Defaults to TRUE (optimized methods only) |
randomize_alts |
Randomize alternative order within questions? Defaults to TRUE (optimized methods only) |
remove_dominant |
Remove choice sets with dominant alternatives? Defaults to FALSE |
dominance_types |
Types of dominance to check: "total" and/or "partial" |
dominance_threshold |
Threshold for total dominance detection. Defaults to 0.8 |
max_dominance_attempts |
Maximum attempts to replace dominant choice sets. Defaults to 50. |
max_iter |
Maximum iterations for optimized designs. Defaults to 50 |
n_start |
Number of random starts for optimized designs. Defaults to 5 |
include_probs |
Include predicted probabilities in resulting design? Requires |
use_idefix |
If |
The method
argument determines the design approach used:
"random"
: Creates designs by randomly sampling profiles for each respondent independently
"shortcut"
: Frequency-based greedy algorithm that balances attribute level usage
"minoverlap"
: Greedy algorithm that minimizes attribute overlap within choice sets
"balanced"
: Greedy algorithm that maximizes overall attribute balance across the design
"stochastic"
: Stochastic profile swapping with D-error optimization (first improvement found)
"modfed"
: Modified Fedorov algorithm with exhaustive profile swapping for D-error optimization
"cea"
: Coordinate Exchange Algorithm with attribute-by-attribute D-error optimization
The table below summarizes method compatibility with design features:
Method | No choice? | Labeled designs? | Restricted profiles? | Blocking? | Interactions? | Dominance removal? |
"random" | Yes | Yes | Yes | No | Yes | Yes |
"shortcut" | Yes | Yes | Yes | No | No | Yes |
"minoverlap" | Yes | Yes | Yes | No | No | Yes |
"balanced" | Yes | Yes | Yes | No | No | Yes |
"stochastic" | Yes | Yes | Yes | Yes | Yes | Yes |
"modfed" | Yes | Yes | Yes | Yes | Yes | Yes |
"cea" | Yes | Yes | No | Yes | Yes | Yes |
All methods ensure the following criteria are met:
No duplicate profiles within any choice set
No duplicate choice sets within any respondent
If remove_dominant = TRUE
, choice sets with dominant alternatives are eliminated (optimization methods only)
Creates designs where each respondent sees completely independent, randomly generated choice sets.
These methods use frequency-based algorithms that make locally optimal choices:
Shortcut: Balances attribute level usage within questions and across the overall design
Minoverlap: Minimizes attribute overlap within choice sets while allowing some overlap for balance
Balanced: Maximizes overall attribute balance, prioritizing level distribution over overlap reduction
These methods provide good level balance without requiring priors or D-error calculations and offer fast execution suitable for large designs.
These methods minimize D-error to create statistically efficient designs:
Stochastic: Random profile sampling with first improvement acceptance
Modfed: Exhaustive profile testing for best improvement (slower but thorough)
CEA: Coordinate exchange testing attribute levels individually (requires full factorial profiles)
When use_idefix = TRUE
(the default), the function leverages the highly optimized
algorithms from the idefix package for 'cea' and 'modfed' design generation methods.
This can provide significant speed improvements, especially for larger
problems.
Key benefits of idefix integration:
Faster optimization algorithms with C++ implementation
Better handling of large candidate sets
Optimized parallel processing
Advanced blocking capabilities for multi-block designs
A cbc_design
object containing the experimental design
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.