Nested Group Logic is an advanced form of Group Logic that introduces randomization to a set of questions within a larger set of randomized questions — streamlining complex concept testing and reducing the risk of bias in respondent data. This is sometimes called "group within group" logic.
Learn more in the Lighthouse Academy course, Group Logic & Smart Loops!
Syntax
Nested Group Logic syntax includes:
- the command Group
- question references
- parentheses — to indicate nesting, group questions to be randomized at a single level, or apply a max limit
- the operator THEN — to indicate order within a nested group
- the operator and — to separate both larger nodes and the questions or question groups nested within them
- subcommands max, balance, randfill, and leastfill, as desired
[group (Q13-14 and Q15-16) and (Q17-18 and Q19-20) and (Q21-22 and Q23-24)]
Three nodes are randomized (shown by the three sets of parentheses). Within each node, two groups of questions are also randomized. In the first node, the respondent could see Q13–14 first or Q15–16 first.
[group (q2-3 then q4 and q5) and (q6-q7 then q8 and q9)]
Two nodes are randomized — some respondents see Q2–5 first, others see Q6–9 first. Within each node, the groups following the THEN operator are shown in random order.
[group ((Q13-14 and Q15-16) and (Q17-18 and Q19-20)) and ((Q21-22 and Q23-24) and (Q25-26 and Q27-28))]
Three levels of group logic: two large nodes (Q13–20 and Q21–28) at the highest level. Within each, two additional nodes, each containing two randomized sets of questions.
[group (Q26-27 then (Q28 and Q29 and Q30 max 1)) and (Q31-32 then Q33 and Q34) and (Q35-36 then Q37 and Q38)]
Three uneven parent nodes. In the first, respondents see Q26–27 then one of Q28, Q29, or Q30. In the second, respondents always see Q31–32 first, then Q33 and Q34 in random order. In the third, respondents always see Q35–36, then Q37 and Q38 in random order.
Placement
Type your group logic string into any question that all respondents will see, placed before the first question the logic applies to. If placed on a conditional question, it will only apply to respondents who saw that question.
Using Nested Group Logic in Smart Loops
- With all Smart Loop questions programmed, set the number of runs to All Runs and the order to Static Order.
- Type the Nested Group Logic into any question before the Smart Loop that every respondent will see, including parentheses and/or the then operator and further question references.
- Use the Preview tool in Respondent or Researcher mode to verify that pathing is functioning as expected.
Virtual Question Presets
When the system detects Group Logic, it populates comparable questions in the Optional Presets menu of Virtual Question.
- If your nested groups are parallel (identical paths/groupings), each set of parallel questions will appear together in the presets.
- If your groups are uneven, they will not populate in the Optional Presets menu.