UCL WIKI

UCL Logo
Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Info
titleExamples

More complex condition examples:

Anchor
simple
simple
Example 1 ALSPAC My Son/Daughter’s Health and Behaviour

...

Questionnaire layout:

Archivist view (alspac_94_msdhb):

...

In Example 2, the true branch cannot be used because the questions must appear in the correct order. Question A13di must come next but this is not true to the condition ‘Go to A13e below', and so it is added to the false branch. The directional statement ‘Go to A13e below’ is incorporated into the condition text and the true branch is left empty.

Example 2 Questionnaire: ALSPAC My Son/Daughter’s Health and Behaviour

...

Questionnaire layout:

Archivist view (alspac_94_msdhb):

...

There are occasions when there are two options for the condition from one question. In this case, the true branch is used if possible, and the alternative option is added as a statement. In Example 3 below, 'If yes' is the true branch and is entered as the condition. ‘If no, go to A4 on page 4’ is entered as a statement, positioned before the condition. If a directional statement is on its own (with or without a directional arrow) or directs you to the next question, it does not have any meaning and as such it is left out. In Example 4 below, 'Go to Section D' is ignored.

Example 3 Questionnaire: ALSPAC My Son/Daughter’s Health and Behaviour

...

Questionnaire layout:

Archivist view (alspac_94_msdhb):

Example 4 Questionnaire: ALSPAC My Son/Daughter’s Health and Behaviour

...

Questionnaire layout:

Archivist view (alspac_94_msdhb):

...

In rare cases, a question can include an answer option in the code list that indicates that the question may not be applicable to some respondents. And therefore it would be skipped. A condition, although implied, is not given in the questionnaire. A separate question is constructed using the answer option which indicates the next questions will not be answered. In Example 7 below, a condition is constructed using text from this answer option 'if we are never apart'. The true branch of the condition is left empty and the main (original) question is placed in the false branch.

Example 7 Questionnaire: ALSPAC My Son/Daughter’s Health and Behaviour

...

Questionnaire layout:

Archivist view (alspac_94_msdhb):

...

A more complicated condition in terms of grid logic is shown in Example 12 below. In this case, only some of the answer responses in the grid are applicable (marked with an *) for the condition to be true. Therefore, the condition logic only references these specific grid cells. See Table 2. Grid Coordinates for more details.

Example 12 Questionnaire: ALSPAC My Son/Daughter’s Health and Behaviour

...

Questionnaire layout:

Archivist view (alspac_94_msdhb):

...

Conditions range in complexity within questionnaires and sometimes need to reference specific cells within a grid. When referencing several cells in a grid at once, each of the grid cells in the logic is effectively compared with an OR e.g. if the logicqc_A3 != 1 was used for the example below, to cover all grid cells, it would effectively be qc_A3$1;1 != 1 || qc_A3$1;2 != 1 || qc_A3$1;3 != 1. This would mean that any of the options could not equal 1, but we need all of the options not to equal 1. Therefore, each cell has to be referenced individually qc_A3$1;1 != 1 && qc_A3$1;2 != 1 && qc_A3$1;3 != 1 with AND in between.

Example 16 Questionnaire: ALSPAC Parent Adult Learning

...

Questionnaire layout:

Archivist view (alspac_04_pal):

...