Get multiple trials with identical subject/item combinations
Sometimes we want to repeat a design, that is, have multiple trials with identical values, but it is not always straight forward to implement. For instance, there is no way to easily modify MultiSubjectDesign
to have multiple identical subject/item combinations, without doing awkward repetitions of condition-levels or something.
If you struggle with this problem RepeatDesign
is an easy tool for you:
using UnfoldSim
designOnce = MultiSubjectDesign(;
n_items = 2,
n_subjects = 2,
subjects_between = Dict(:cond => ["levelA", "levelB"]),
items_between = Dict(:cond => ["levelA", "levelB"]),
);
design = RepeatDesign(designOnce, 4);
generate_events(design)
Row | subject | cond | item |
---|---|---|---|
String | String | String | |
1 | S1 | levelA | I1 |
2 | S1 | levelA | I1 |
3 | S1 | levelA | I1 |
4 | S1 | levelA | I1 |
5 | S2 | levelB | I2 |
6 | S2 | levelB | I2 |
7 | S2 | levelB | I2 |
8 | S2 | levelB | I2 |
As you can see, the design was simply repeated.
If you implemented your own AbstractDesign
, you need to define the size function accordingly. E.g.: Base.size(design::RepeatDesign{SingleSubjectDesign}) = size(design.design).*design.repeat
This page was generated using Literate.jl.