Skip to content

Rules for arcs

The layer order already excludes all arcs that point to an earlier layer. Rules can exclude additional arcs or require specific arcs. Rules cannot allow an arc that conflicts with the layer order. Requiring such an arc results in an error.

constraints:
  within_layers: true            # default for layers without their own arcs_within
  forbid:
    - {from: SEX, to: EXPOSURE_B}                  # a single arc
    - {from_layer: Exposures, to_layer: Outcome}   # all arcs between two layers
  require:
    - {from: AGE, to: EXPOSURE_A}
  no_parents: [AGE, SEX]         # no variable in the study can influence these
  no_children: [OUTCOME]         # these cannot influence any variable

Variables and layers can be referred to by column name or by label, for example Exposure A (score). A layer refers to all variables in it. from/to can be combined with from_layer/to_layer.

Rule Use
forbid Exclude an arc that is allowed by the order but known to be impossible.
require Include an arc that is assumed to exist. Use with caution: a required arc is an assumption, not a result, and must be justified in the methods section.
no_parents Variables that no other variable in the study can influence, in addition to the restrictions of the order.
no_children Variables that cannot influence any other variable in the study.
within_layers Allow or forbid arcs within layers by default. The arcs_within setting of a layer takes precedence.

Conflicting rules

If an arc is both required and forbidden, or if a rule conflicts with no_parents or with a layer that does not allow arcs within it, the check reports an error that names the variables concerned.