Tutorials › Marginal Structural Models › Time-Indexed Nodes and Temporal Ordering

Causal Diagrams for Longitudinal Data · Tutorial 65 of 501

Time-Indexed Nodes and Temporal Ordering

Learn how indexing repeated variables by time clarifies which arrows are temporally possible and gives a direct check for cycles.

Intermediate 11 min read

What You'll Learn

  • Distinguish a variable measured repeatedly from its separate time-indexed DAG nodes.
  • Use an explicit measurement convention to order baseline covariates, treatments, later covariates, and outcomes.
  • Prove why arrows that always move forward in a strict temporal order cannot form a directed cycle.
  • Identify how tied or ambiguous measurement times can undermine an ordering check.
  • Diagnose cycles caused by collapsing repeated measurements into generic variable names.
  • Compare a time-indexed DAG with a time-collapsed summary and understand the limitations of temporal ordering.

Why Time Indexing Matters

In longitudinal studies, the same kind of variable is measured more than once. A treatment at one visit and a treatment at a later visit are not the same node in a causal diagram: they occur at different times and can have different causes and consequences. The same is true of repeated covariate measurements. Writing a distinct node for each measurement makes the order of events visible and prevents a diagram from implying that a later value caused an earlier one.

This is a foundational bookkeeping rule, not a method for deciding which causal effects exist. Temporal order rules out some arrows, but it does not establish that any remaining arrow is present. The actual arrows require substantive assumptions about the study and its variables.

Definition: A time-indexed node is a graph node representing a particular variable at a particular measurement time, such as \(A_0\), treatment at time 0, or \(L_2\), a covariate measured at time 2. A directed acyclic graph (DAG) is a directed graph with no directed cycle: there is no directed path that starts and ends at the same node by following arrows in their direction.

For notation, let \(W\) denote baseline covariates measured before follow-up. Consider \(K\) treatment decisions \(A_0,\ldots,A_{K-1}\). We use the following timing convention: after \(A_t\), covariates \(L_{t+1}\) are measured before the next treatment decision; the final outcome \(Y\) is measured after the final treatment. The ordered node sequence is therefore

$$ W,\ A_0,\ L_1,\ A_1,\ L_2,\ \ldots,\ L_{K-1},\ A_{K-1},\ L_K,\ Y. $$

This convention is one useful way to make timing explicit; a real study may use a different measurement schedule. If a covariate is measured before \(A_0\), it belongs with baseline information rather than after \(A_0\). If two measurements are genuinely simultaneous, their relative order cannot be settled just by assigning them the same time label. The substantive timing and causal assumptions must be clarified before arrows between them are drawn.

Temporal Order as a Constraint on Arrows

Assign each node a position in the displayed sequence, numbered \(0,1,\ldots,m-1\). Write \(r(v)\) for the position of node \(v\). An arrow \(u\to v\) respects this strict order if \(r(u)<r(v)\). Thus \(W\to A_0\), \(A_0\to L_1\), and \(L_1\to A_1\) are temporally permitted under the stated convention. An arrow \(A_1\to L_1\) is not: it points from a later position to an earlier one.

The order constrains the graph without requiring every temporally permitted arrow. For example, although \(W\to Y\) is compatible with the order, the study's causal assumptions might not include that direct arrow. A diagram can also omit a temporally possible arrow because it is assumed absent or because the diagram is intentionally incomplete. Temporal compatibility and causal justification are separate questions.

Theorem: If a finite directed graph has a strict rank \(r(v)\) for every node and every arrow \(u\to v\) satisfies \(r(u)<r(v)\), then the graph is acyclic.

Proof. Suppose, to the contrary, that the graph contains a directed cycle \(v_0\to v_1\to\cdots\to v_q=v_0\), where \(q\geq 1\). The rank condition gives

$$ r(v_0)<r(v_1)<\cdots<r(v_q)=r(v_0). $$

By transitivity, this implies \(r(v_0)<r(v_0)\), which is impossible. Therefore the graph contains no directed cycle. \(\square\)

This argument gives a quick audit: along every arrow, the rank must increase. It also identifies the source of a temporal-ordering problem. Any directed cycle must contain at least one arrow that does not strictly increase the assigned rank; the diagram either has a backward arrow or uses an ordering that is not strict enough to settle a tied measurement time.

Result: In a graph whose arrows all move forward in the ordered node sequence, every directed path visits nodes in strictly increasing positions. Consequently, no path can revisit a node, and a path can contain at most \(m-1\) arrows if there are \(m\) nodes.

Proof. Let a directed path be \(v_0\to v_1\to\cdots\to v_q\). Each arrow gives \(r(v_{j-1})<r(v_j)\), so the ranks along the path are strictly increasing. A strictly increasing sequence cannot contain the same rank twice, so no node can be revisited. There are only \(m\) distinct positions, and a path using \(q+1\) distinct nodes must have \(q+1\leq m\). Hence \(q\leq m-1\). \(\square\)

Worked Examples

Worked Example: Ordering Two Treatment Decisions

Suppose a study measures baseline severity \(W\), treatment \(A_0\), a post-treatment symptom score \(L_1\), a second treatment decision \(A_1\), and outcome \(Y\). Use the order \(W,A_0,L_1,A_1,Y\). A proposed set of arrows is \(W\to A_0\), \(W\to L_1\), \(A_0\to L_1\), \(L_1\to A_1\), \(A_0\to A_1\), and \(A_1\to Y\).

Assign positions. Set \(r(W)=0\), \(r(A_0)=1\), \(r(L_1)=2\), \(r(A_1)=3\), and \(r(Y)=4\).

Check each arrow. The rank comparisons are \(0<1\), \(0<2\), \(1<2\), \(2<3\), \(1<3\), and \(3<4\), respectively. Every arrow moves forward, so the theorem guarantees that this graph has no directed cycle.

For a numerical illustration of why the node labels matter, suppose the observed values for one participant are \(W=2\), \(A_0=1\), \(L_1=5\), \(A_1=0\), and \(Y=8\). These values do not determine the arrows, but they illustrate that \(A_0\) and \(A_1\) are separate measurements even though both are treatments. Replacing them with one generic node \(A\) would erase the order needed to interpret the proposed arrows.

Worked Example: Finding a Backward Arrow

A researcher uses the ordered nodes \(W,A_0,L_1,A_1,Y\), but proposes \(W\to A_0\), \(A_0\to L_1\), \(L_1\to A_1\), \(A_1\to L_1\), and \(A_1\to Y\). The pair of arrows between \(L_1\) and \(A_1\) forms a directed cycle.

Check by rank. With positions \(0,1,2,3,4\), the arrow \(L_1\to A_1\) satisfies \(2<3\), but \(A_1\to L_1\) requires \(3<2\), which is false. Thus the proposed graph fails the strict-order check.

Interpret the failure. Under the stated measurement convention, \(L_1\) is recorded before \(A_1\). The later treatment decision cannot cause that already-recorded value. If the intended meaning was that treatment affects a later symptom measurement, the node should be indexed \(L_2\), not \(L_1\). The correction is to represent the actual measurement time, not to keep the backward arrow and hope that the cycle is harmless.

Worked Example: Resolving a Tied Measurement Time

Suppose a clinic records \(A_0\), a treatment decision, and \(L_1\), a symptom score, at the same visit, but the record does not say which came first. A proposed diagram includes both \(A_0\to L_1\) and \(L_1\to A_0\). The two arrows form a cycle, and neither is justified by the shared visit label alone.

If the study protocol establishes that the symptom score is collected before the treatment decision, refine the timing to \(L_1\to A_0\) and remove \(A_0\to L_1\). If the treatment is administered first and the score is measured afterward, the order can instead be \(A_0\to L_1\). If the two are truly simultaneous and neither is a cause of the other, represent the timing without asserting either direct arrow. The key step is to determine what the measurements mean and when they occur; assigning an arbitrary order just to make the graph acyclic is not a valid resolution.

A Practical Ordering Audit

A useful audit separates node definition from arrow review. First write down what each node measures and when it is measured. Next, order the nodes according to that measurement schedule. Only then check the arrows. This helps distinguish an incorrectly indexed variable from a genuinely questionable causal claim.

1
Name each measurement.
Use distinct labels for baseline covariates, each treatment decision, each later covariate measurement, and the outcome.
2
Record the timing convention.
State which measurements precede and follow each treatment decision. Resolve any same-time ambiguity from the study protocol or substantive knowledge.
3
Assign ordered positions.
Give every node a unique position consistent with the stated timing.
4
Check every arrow.
For each \(u\to v\), verify \(r(u)<r(v)\). A failed comparison signals a backward arrow, a mistaken node label, or unresolved timing.

For example, with three treatment decisions, a consistent sequence under the convention above is \(W,A_0,L_1,A_1,L_2,A_2,L_3,Y\). Arrows such as \(A_0\to A_2\), \(L_1\to A_2\), or \(A_1\to Y\) are permitted by time order, but their presence still requires substantive justification. An arrow such as \(L_3\to A_1\) violates the order and should prompt a check of what the subscripts mean.

Common Pitfalls, Alternatives, and Limits

  • Collapsing repeated measurements. Writing a single \(A\) for treatment at every visit can make an influence of earlier treatment on later treatment look like a cycle \(A\to A\). Separate nodes \(A_0,A_1,\ldots\) preserve the temporal distinction.
  • Treating the visit number as sufficient. Measurements at one visit may occur in a meaningful within-visit order. If that order matters to a causal claim, a shared time label does not settle the arrow direction.
  • Assuming every forward arrow is real. A forward arrow is temporally possible, not automatically causal. Time indexing cannot replace scientific knowledge or the assumptions needed for causal interpretation.
  • Using order to hide a contradiction. Changing node labels to force every arrow forward does not repair a diagram if the labels no longer match the observed measurement times.

A time-collapsed diagram can be a compact descriptive summary, but it is a poor substitute when the question depends on the order of repeated treatment and covariate measurements. Conversely, a fully time-indexed diagram can become large, and its arrows still depend on assumptions that the temporal order alone cannot verify. This tutorial establishes the node and ordering discipline; it does not determine which paths are confounding paths, which variables should be conditioned on, or how a causal effect is identified.

The practical consequence is simple: when a proposed arrow appears to run backward, first verify the node definitions and the measurement schedule. If the timing is correct and the arrow still points backward, the causal story represented by that arrow is incompatible with the specified temporal order.

Check Your Understanding

Use the convention and results in this tutorial to answer each question. Full solutions follow each prompt.

  1. For the sequence \(W,A_0,L_1,A_1,Y\), assign positions and decide whether \(L_1\to Y\) is temporally permitted.
    Solution: Assign positions \(0,1,2,3,4\), respectively. Since \(r(L_1)=2<4=r(Y)\), the arrow is permitted by temporal order. This does not by itself establish that the causal arrow exists.
  2. Explain why a finite graph with every arrow moving to a strictly later position cannot contain a cycle.
    Solution: A cycle would require a sequence of strict rank increases that ends at its starting node. It would imply \(r(v)<r(v)\) for the starting node \(v\), a contradiction. Therefore the graph is acyclic.
  3. A diagram contains \(A_0\to L_1\) and \(L_1\to A_0\). Give two possible explanations to investigate before interpreting the graph.
    Solution: Check whether one node has been assigned the wrong time index, such as whether the post-treatment measurement should be \(L_2\). Also check whether the within-visit measurement order is unknown or incorrectly represented. Under a strict order, both arrows cannot be retained.
  4. Why is the arrow \(A_0\to A_1\) not a self-loop when treatment is measured at two visits?
    Solution: \(A_0\) and \(A_1\) are distinct nodes representing different measurements. The arrow runs from the earlier node to the later one. A generic label \(A\) would hide that distinction and could make the relation appear to be a self-loop.
Clinical Biostats