Skip to content

Commit bf52e16

Browse files
committed
update design vignette for clarity on how blocking works
1 parent cc88f49 commit bf52e16

1 file changed

Lines changed: 14 additions & 8 deletions

File tree

vignettes/design.Rmd

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,8 @@ The `cbc_design()` function supports several design generation methods, each wit
113113
| `"minoverlap"` | Fast | Medium ||||||
114114
| `"balanced"` | Fast | Medium ||||||
115115
| `"stochastic"` | Slow | High ||||||
116-
| `"modfed"` | Slow | High ||||||
117-
| `"cea"` | Slow | High ||||||
116+
| `"modfed"` | Medium | High ||||||
117+
| `"cea"` | Medium | High ||||||
118118

119119
All design methods ensure:
120120

@@ -183,13 +183,17 @@ design_balanced <- cbc_design(
183183

184184
## D-Optimal Methods
185185

186-
These methods minimize D-error to create statistically efficient designs. They require more computation but produce higher-quality designs, especially with good priors. Each method has a different approach:
186+
These methods minimize D-error to create statistically efficient designs. They require more computation but produce higher-quality designs, especially with good priors.
187+
188+
Unlike the previous methods, these methods identify a single d-optimal design and then repeat that design across each respondent. In contrast, the other methods create a unique design for each respondent.
189+
190+
Each method has a different approach:
187191

188192
- The `"stochastic"` method uses random profile swapping to minimize the d-error, accepting the first improvement found. This is a faster algorithm as a compromise between speed and exhaustiveness.
189193
- The `"modfed"` (Modified Fedorov) method exhaustively tests all possible profile swaps for each position. It is slower than other methods though more thorough.
190194
- The `"cea"` (Coordinate Exchange Algorithm) method optimizes attribute-by-attribute, testing all possible levels for each attribute. It is faster than `"modfed"`, though requires all possible profiles and cannot accept restricted profile sets.
191195

192-
Unlike the previous methods, these methods identify a single d-optimal design and then repeat that design across each respondent. In contrast, the other methods create a unique design for each respondent.
196+
For the `"modfed"` and `"cea"` methods, designs are by default created using the much faster algorithms in the [{idefix}](https://github.com/traets/idefix) package. You can use the (slower) {cbcTools} versions of these methods by setting `use_idefix = FALSE`.
193197

194198
For the examples below, we have `n_start = 1`, meaning it will only run one design search (which is faster), but you may want to run a longer search by increasing `n_start`. The best design across all starts is chosen.
195199

@@ -293,23 +297,25 @@ head(design_labeled)
293297

294298
## Blocking
295299

296-
For D-optimal methods, create multiple design blocks to reduce respondent burden:
300+
For D-optimal methods, create multiple design blocks to reduce respondent burden using the `n_blocks` argument. In the example below, two blocks are created with each block containing `n_q = 6` questions:
297301

298302
```{r}
299303
design_blocked <- cbc_design(
300304
profiles = profiles,
305+
method = "stochastic",
306+
priors = priors,
301307
n_alts = 2,
302308
n_q = 6,
303309
n_resp = 100,
304-
n_blocks = 2, # Create 2 different design blocks
305-
priors = priors,
306-
method = "stochastic"
310+
n_blocks = 2 # Create 2 different design blocks
307311
)
308312
309313
# Check block allocation
310314
table(design_blocked$blockID)
311315
```
312316

317+
The way blocking works is that a single design is created with `n_q*n_blocks` questions, then those questions are allocated into blocks with `n_q` questions per block. For the `"modfed"` and `"cea"` methods, the blocking is handled using the internal logic of the [{idefix}](https://github.com/traets/idefix) package, which allocates questions to the blocks in a balanced way. You can use the (slower) {cbcTools} versions of these methods by setting `use_idefix = FALSE`. For the `"stochastic"` method, questions are randomly allocated to blocks.
318+
313319
## Dominance Removal
314320

315321
Remove choice sets where one alternative dominates others based on parameter preferences. There are two forms of dominance removal:

0 commit comments

Comments
 (0)