50 💻 Hierarchical factors in Causal Map

(This section is about implementing hierarchical coding in the Causal Map app. See also the previous section on hierarchical coding in general.)

50.1 Creating labels

Factors can optionally be expressed as part of a hierarchy by using semi-colons.

For readability, it is usual to leave a space after the semi-colon, but this makes no difference to the functionality.

50.2 Relabelling

In Causal Map, the process of renaming the factors into this kind of hierarchical structure can be conveniently carried out in the factor editor panel tab which is a simple text editor where you can edit anything you have created during coding. If you select factors, as in the image below, it will list the currently visible factor labels, sorted alphabetically.

Use Ctrl F or Cmd F (for Macs) to search.

Use Crtl H on PC to search and replace.

Use Crtl Alt Up/Down to edit multiple lines at once.


Here it is easy to “move” an (incorrectly labelled) factor

Health behaviour; understanding of germ theory

to something like

Health knowledge; understanding of germ theory


Real-world knowledge; health; understanding of germ theory

simply by retyping it, without worrying about whether the corresponding higher-level path (“Real-world knowledge; health”) exists already.

This editor has many features such as global search and replace, and multiple cursors, which make it easy to rapidly edit many factor labels.

Using this panel you can also combine several factors into one and split one factor into several.

50.3 Additional calculated fields

The app adds some fields for using hierarchies. One of them is top_level_label which gives just the top level for each factor. Here it is being used to group factors in terms by their top level component.


50.5 Search with nested factors

The same principle applies in the Search and Filter Factors box: you can see factors you have already used but also implied higher-level factors (like “Health behaviour”) and other factor components, beginning with a semi-colon (;).

50.6 How can I view just the factors where I have applied hierarchical coding?

Sometimes you only want to use hierarchical coding for a few of your factors. To view just those, you could create a mini map including just the factors which you have hierarchically coded (and one step up or down from them), by searching for ; in the factor labels, but then zooming the factors out to just see the top level.


… which is equivalent to


50.7 Viewing the top level labels

In the factors table, you can view your top level factors even when not applying filters.