Missing values¶
layerbn provides three options for empty cells. You can set the option for all variables or for each variable separately.
| Option | Effect | Use when |
|---|---|---|
error (default) |
The check stops and lists the number of missing values per variable. | You want to choose an option for each variable explicitly. |
category |
Empty cells become a separate state, Missing, which is modelled like any other value. No participants are excluded. |
Missingness may be informative, for example a test that was not performed because the participant was too ill, a questionnaire that was not returned, or a measurement that was skipped for a clinical reason. |
drop_rows |
Participants without a value for this variable are excluded. | Few values are missing, for reasons unrelated to the study, such as a lost form or a device failure. |
Alternatively, you can impute the missing values in your own software before the analysis.
Setting the option¶
In variables.xlsx, on the variables sheet, use the missing column (a dropdown list).
If a cell is empty, the setting in settings.yml is used.
| variable | layer | missing |
|---|---|---|
| AGE | Background | |
| SMOKING | Lifestyle | drop_rows |
| SCORE_A | Clinical | category |
| SCORE_B | Clinical | category |
| EVENT | Outcome |
In this example, participants without a smoking status are excluded. Missing values of
score A and score B are modelled as Missing. A missing value for age or the outcome
stops the check with a message.
Display¶
A variable with missing values modelled as a category has one additional state. It is shown
last, with a grey bar and an italic label. For a continuous variable, the groups are based on
the observed values, and Missing is added after them.

Missing is treated as a regular state in all results:
- In the report, the bins table lists
Missingafter the groups, and the run reports the number of missing values per variable. - In a profile or sweep,
Missingcan be used as a value. For example,SCORE_A: Missinggives the probability of the outcome for participants without a measurement of score A. - In the explorer,
Missingcan be selected as evidence.
Interpretation¶
Arcs that involve a Missing state
An arc to or from a variable with a Missing state can reflect the missingness, the
measured values, or both. Check the distributions in the figure or the explorer. If the
outcome differs mainly between measured and missing, the association concerns
which participants were measured, not the measured value. Report it as such.
categorymakes no assumption about why values are missing. The network shows whether missingness is associated with other variables.- A
Missingstate with few participants (for example, fewer than 20) is estimated with low precision, as is any small group. Considerdrop_rowsfor that variable. - With
drop_rows, the remaining participants can differ from the excluded participants. The run reports the number of excluded participants. Include this number in the publication.