# Variable Relationships in DAGs

This is based on lecture notes prepared together with
Mark Gilthorpe
for his module "Advanced Modelling Strategies".

## Basic DAG Terminology

Causal path diagrams (DAGs) consist of *nodes* that represent variables
(e.g. X, Y) and *arrows* that depict direct causal
effects. A very simple DAG is the following:

dag{
X [pos="0,1"]
Y [pos="1,1.1"]
X -> Y
}

To describe relationships between variables in a diagram, we often read
them like an ancestry tree and use kinship terminology. Consider this example:

dag{
X [pos="0,1"]
M [pos="1,1.1"]
Y [pos="2,1.2"]
X -> M -> Y
}

In this diagram, M is a *child* of X and X is a *parent* of M.
M and Y are *descendants* of X, and X and M are *ancestors*
of Y. A causal diagram is called a directed acyclic graph (DAG) if no variable
is an ancestor of itself. Causal diagrams are usually depicted with the nodes arranged in temporal
or causal order, with the earliest measured variables on the left of the diagram and the latest
measured on the right (though this is not mandatory).

## Test your knowledge!

Below you can play a little game to test your knowledge of DAG terminology.
Do you manage to give correct
answers in a row?

dag G {}

Do you feel comfortable with describing ancestral relations in DAGs? Then
continue with a more advanced (and interesting) topic:
Describing covariate roles!