Skip to content

variables.xlsx

An Excel workbook with the sheets variables, layers and timepoints, in any order. A sheet named instructions is ignored. Alternatively, the same tables can be stored as CSV files named variables.csv, layers.csv and timepoints.csv in one folder, separated by commas, semicolons or tabs. Column headers are not case-sensitive, and spaces are read as underscores. Columns with a header that starts with note or comment are ignored. Any other unknown header results in an error with a suggested correction.

Sheet layers

Optional if no layer is repeated. Without this sheet, the layers are the layer names on the variables sheet, in order of first appearance. If the sheet is present, the order of its rows defines the order of the layers.

Column Values Meaning
layer text, required Name of the layer. Must be unique.
label text Name shown in figures. Default: layer.
repeated yes / no Only for variables measured more than once: the layer is expanded into one layer per time point. Default: no.
arcs_within yes / no Whether arcs between variables of this layer are allowed. Default: the setting constraints: within_layers (yes).
colour colour name or hex code Colour of the layer in figures. Default: the RdBu scale, from blue (first layer) to red (last layer).

Each layer must contain at least one variable. Layers marked repeated must be adjacent, and at least one time point must be defined.

Sheet variables

Column Values Meaning
variable text, required Column name in the data. For a repeated layer, the name without the time point. Must be unique.
label text Name shown in figures and tables. For a repeated layer the time point label is appended: Score, Second visit. Default: variable.
layer text, required A layer from the layers sheet.
type categorical / continuous / empty Empty: numeric columns with more than categorical_max_levels distinct values are binned, everything else is used as categories. categorical: never binned. continuous: always binned, even with few distinct values.
bins whole number, at least 2 Number of bins for this variable. Default: discretisation: bins.
cutpoints numbers separated by ; Thresholds that define the bins. 24; 27 gives three bins: below 24, 24 up to below 27, and 27 or higher. A comma is read as a decimal mark. A value equal to a cut-off is assigned to the higher bin. Cannot be combined with bins or with type: categorical. See Clinical cut-off values.
times time keys separated by ; Repeated layers only: the time points at which the variable was measured. Default: all.
target yes / no A variable of main interest. See targets.
missing category / drop_rows / error / empty Handling of missing values for this variable. Empty: the setting data: missing. See Missing values.

Sheet timepoints

Only required if a layer is repeated. Otherwise, leave the sheet empty or remove it.

Column Values Meaning
time text, required The text that appears in the data column names (T0). Unique.
label text Label shown in figures and tables (First visit). Default: time. Unique.

The rows must be in chronological order.

How repeated layers are expanded

For each time point t, in order, each repeated layer L is replaced by a layer named L (label of t). The data column of a variable V is built from the column pattern (data: column_pattern:, default {variable}_{time}), so V at time T1 is V_T1. The expanded layers are placed at the position of the first repeated layer, ordered by time point first: with layers A, C (repeated), D (repeated), E and time points T0, T1, the order is A, C (T0), D (T0), C (T1), D (T1), E. If a layer has no variables at a time point (because of times), it is omitted for that time point.

Names in settings.yml

In settings.yml, a variable can be referred to by its column name (EXPOSURE_A) or its label (Exposure A (score)). A layer is referred to by its name on the layers sheet. For a repeated layer, the name of an expanded layer (Scores (Second visit)) refers to that time point only, and the name from the layers sheet (Scores) refers to it at every time point.

Targets

Targets are the variables of main interest. They are used by default in importance, profiles and sweep, and have a solid title strip in the figures. If no variable is marked as a target, the variables in the last layer of the network are used.