# Is it appropriate to use "time" as a causal variable in a DAG?

This question might be better suited for philosophy.SE, but I will post it here in the first instance, since it involves technical aspects that are best understood by users on this site. The title question asks, is it appropriate to use "time" as a causal variable in a DAG? More specifically, if we have data over different time periods, is it appropriate to use the time index as a variable in the DAG, with causal arrows emanating from that variable to other variables?

To my mind, this raises the philosophical question of whether "time" can be considered to have a causal impact on other variables, or contrarily, whether time is an inbuilt component of the notion of causality to begin with (and so cannot be brought in as a causal variable). Beyond this philosophical question, it also raises practical statistical questions about the appropriate treatment of a time index in a DAG. In most statistical applications involving data measured over different times, there are confounding factors that also vary over time. In such cases, can one use "time" as a stand-in for other specification of confounding factors?

• Interesting question! To me, it raises two concerns that need to be answered: 1) Is there ever a case where time itself could have a causal effect? Usually, time is just a proxy for how many times some other variables (latent or observed) got 'applied'. And following from that, 2) Does time as a concept even have any substance other than indexing operations together? Leslie Lamport's 'Time, Clocks, and the Ordering of Events in a Distributed System' seems to point to 'no', at very least.
– jkm
Dec 29, 2019 at 23:59
• @jsk I think it is super useful to think critically about using time as an explanation, just as you suggest. That said: atomic decay (e.g., half-life) is a canonical example of time being the causal explanation. Thank you for the reference! Dec 30, 2019 at 4:16
• Is time really a causal agent in atomic decay? It seems to me atomic decay is just a rare instance of a true nigh-irreducibly stochastic variable, i.e. its 'sampling rate' is very close in value to the first derivative of time, globally. Intriguingly, it seems to point to time being similar to temperature as a model parameter, in that they both just scale the growth rate of entropy within the model.
– jkm
Dec 30, 2019 at 12:08
• @jsk I think time is a causal agent in the counterfactual sense—if, contrary to observation, $T$ hours had not yet passed, then the mass of the isotope would be greater than $N(T)$. "It seems to me atomic decay is just a rare instance of a true nigh-irreducibly stochastic variable": atomic decay is reducible to a stochastic function of time (and the decay rate for the specific isotope). I am also open to persuasion, and am pointing Reinstate Monica at this comment, since their answer addresses counterfactuals. Dec 31, 2019 at 4:09
• @Alexis: The problem is that it seems to address the counterfactual too well, to the extent that time becomes the cause of everything in the counterfactual sense. That seems to me like a case where the method "proves too much".
– Ben
Dec 31, 2019 at 5:01

As a partial answer to this question, I am going to put forward an argument to the effect that time itself cannot be a proper causal variable, but it is legitimate to use a "time" variable that represents a particular state-of-nature occurring or existing over a specified period of time (which is actually a state variable). These issues are the impetus for the question itself, since my intuition tells me that "time" in a causal model must be a kind of proxy for some kind of state variable.

## Time itself cannot be a causal variable

Time is already a component of the concept of causality: The first hurdle is the fact that the concept of of causality involves actions, and actions occur over time. Thus, "time" is already baked into the concept of causality. One might therefore regard it as a concept where time is a priori inadmissible as an argument variable in the concept. To assert that time is a cause of an effect requires time to be admitted both as the asserted causal variable, and also as a necessary concept for causality itself. (We will see more of the effects of this below.)

If time causes anything, it causes everything: The second hurdle is that causality is generally regarded as requiring a counterfactual condition that reduces to triviality in the case where time is asserted as the causal variable. If we say that "precondition X causes action Y", the relevant counterfactual condition is that (1) the presence/occurrence of precondition X means that action Y will occur; and (2) in the absence of another cause, the absence of precondition X means that action Y will not occur. But since "will occur" means "will occur over time", the use of a "time" as a causal variable adds nothing to the first requirement, and makes the second a tautology. If precondition X is "the movement of time" then (1) reduces to "the movement of time means that action Y will occur", which logically reduces to "action Y will occur"; and (2) reduces to "the absence of movement of time means that action Y will not occur" (which is a tautology, since action can only occur over time). Under this counterfactual interpretation of causality, an assertion of the time-causality of an action is logically equivalent to an assertion that this action will occur. Thus, we must either conclude that this condition is too weak to constitute causality (i.e., time is not a cause of anything) or that time is the cause of everything.

Pure time-causality is metaphysically equivalent to randomness: Another hurdle here occurs when we have a situation where "time" is the only asserted causal variable (i.e., in the case of pure time-causality). The problem is, if any change in a variable occurs over time, in the absence of causality from a non-time variable, this has traditionally been regarded as the very definition of aleatory randomness ---i.e., non-causality. Thus, to assert that time is the sole cause of an effect is to banish the notion of non-causality (randomness) entirely from metaphysics, and substitute it with a base "cause" that is always present if there is no other cause. Alternatively, one might reasonably assert that a claim of time-causality is equivalent to an assertion of randomness ---i.e., it is an assertion that there are no causes to the change, other than the passage of time. If such is the case, then the presence of "time" as a causal variable in a DAG is equivalent to its absence (and thus parsimony counsels that it be excluded). Moreover, the history of the field counsels in favour of keeping the existing terminology of "randomness".

Problems with causal calculus with time as a causal variable: Another final hurdle I will mention (there may be more) is that it is difficult to deal with "time" as a causal variable in the causal calculus. In standard causal calculus, we have a $$\text{do}(\cdot)$$ operator that operates on a causal variable to reflect intervention into the system to change that variable to a chosen value that may be different from what it would be under passive observation. It is not entirely clear that it is possible to impose an "intervention" for a time variable, without running afoul of other philosophical or statistical principles. One could certainly argue that waiting is an intervention that changes time (forward only), but even if this were so interpreted, it cannot be differentiated from passivity, and so arguably it would not be distinct from passive observation. One might instead argue that we could record a large amount of data over different times, and then the "intervention" would be to choose which time values are included in the data for the analysis. That would indeed involve a choice of time periods (over the available data), and so it would seem to constitute an intervention, but that is an epistemic intervention, not a metaphysical one. (It also gives rise to a secondary problem of failing to use all the available data.)

## A state variable accruing over time can be a causal variable

DAGs can include variables representing states-of-nature occurring over a prescribed time: There are a number of legitimate causal variables that represent the occurrence of some state or some event over a prescribed period of time. A simple example (hat tip to Carlos in the answer below) is investment of money over time, which yields interest. In this case, the accrual of interest is caused by the fact that money is invested over a period of time, and the longer the investment period, the higher the interest accrued. In this case, it is legitimate to have a "time" variable, that represents the chosen period of time for the investment, and this variable would have a direct causal impact on the accrued interest. Similarly, the "age" variable for a person is a kind of "time" variable (hat tip to AdamO in the answer below), representing the fact that the person has been alive over a specified period of time. Each of these variables are legitimate causal variables that can be included in a DAG. These variables do not represent the progression of time itself --- they represent the fact that a certain state-of-nature was present over a specified period of time. In many cases, it is a useful shorthand to label a variable like this as "time", but it is important to bear in mind that it represents a specific state over a period of time, rather than the progression of time itself.

In some sense, every variable is of this kind: Since every possible event or state-of-nature occurs either at a particular point in time, or over a period of time, every variable involves some (often implicit) time specification. Nevertheless, there are variables such as "age" or "time invested" that have a more direct connection to time, insofar as the variable represents the amount of accrual of time during which a particular state obtained.

Using "time" in a DAG is a shorthand for a state variable accruing over time: If the above argument is correct, it would appear that any use of a "time" variable in a DAG must be a shorthand for a variable representing the occurrence of a particular event or the existence of a particular state-of-nature over a specified period of time. The progression of time itself is not subject to control or intervention, and cannot be a causal variable for the reasons described above. However, the prevalence of a particular state-of-nature over a period of time certainly can be a legitimate causal variable that can be included in a DAG.

These points give some basic idea of why the use of "time" as a causal variable is problematic, and what it means to add "time" to a DAG. As you can see, my view is that time itself cannot be a causal variable, but that you can have a "time" variable that actually represents an event or state-of-nature occurring or existing over a period of time. I am open to being convinced to the contrary, but this seems to me to be a sensible resolution of the issue.

• I like the depth of this answer. WRT counterfactuals, how would you address the comment I made to @jsk above about time being a cause of atomic decay a la "if, contrary to observation, $T$ hours had not yet passed, then the mass of the isotope would be greater than $N(T)$" While temporal ordering is part of counterfactual formal causal reasoning, temporal quantity is most definitely not. Dec 31, 2019 at 3:49
• Critique 2 1/2: "Pure time-causality is metaphysically equivalent to randomness" this is a feature, not a bug. "Randomness causing something" is precisely why (in the counterfactual formal causal reasoning in epidemiology world) randomized assignment of treatment strengthens the validity of causal inference against unobserved confounding variables in randomized control trials. If (duration of) time itself can be said to be a cause, in that, as in the atomic decay example, it is a parameter of a stochastic process what of it? The process would have alterned had its parameters been otherwise. Dec 31, 2019 at 5:57
• Critique 2 2/2: In fact we sometimes draw randomization in DAGs as the sole cause of treatment (selection bias aside) to illustrate that unobserved variables cannot also be causes of treatment, since only randomization gets that privilege in an RCT. Dec 31, 2019 at 6:00
• In respect of Critique 2, I would say that it is preferable not to refer to a "cause" that is essentially empty. Saying that "caused by time" is a preferable description to "random" (i.e., a feature, not a bug) sounds nice, because you are now making a causal attribution, but I would say that this causal attribution is empty. As argued above, it reduces to nothing more than saying that the consequential action "occurred". My view is that it is preferable to retain the standard view that an action uncaused by anything (other than the progress of time) is considered to have no cause (random).
– Ben
Dec 31, 2019 at 6:07

I see no problem with this. A simple example from physics: suppose you are interested in modelling the DAG of the temperature of a glass of water. It might look something like:

Time does cause the temperature to change. There are mediators in between, but it doesn't matter from this 10,000 foot view. From this DAG, it is logical to include time as a variable in a regression model, as expected.

When I was drawing this, I was thinking "are there any interesting confounders of time and temp I could include?" - but no, because nothing, AFAIK, causes time.

Turning to the question of interpretation, that's trickier and it might come down to whether you follow Hernan's "no causation without manipulation" vs Pearl's "anything goes" attitude. See some of their recent papers on the topic including Does obesity shorten life? and Does Obesity Shorten Life? Or is it the Soda? On Non-manipulable Causes.

• This is a good example. Atomic decay is another one from physics where time is a useful parameter. I personally argue that in other disciplines and domains (e.g., epidemiology, ecology, economics, etc.) including time as an 'explanatory' variable is hand-waving past a causal model of the dependent variable (see comment exchange). Dec 30, 2019 at 4:14
• Time itself does not cause the temperature to change. Temperature is a summary statistic of kinetic energy, which is exchanged by molecules of water and the environment (it's pretty much the OG mean field approximation). Time indexes the number of micro-scale exchanges here. Calculating the causal effect of time - even if we mentally add '(index)' at the end - leads to absurd results if you try to generalize, e.g. you'd expect water in the fridge to cool at the same rate as water in an oven.
– jkm
Dec 30, 2019 at 11:49
• @jkm, good point about about trying to generalize. Dec 30, 2019 at 13:02
• The point about calculation and generalization is a statistical / estimation concern - that should be separated from the DAG / causal concerns. If the problem is with time not causing temperature to change, then feel free to substitute "kinetic energy" in place of "temperature". Dec 30, 2019 at 16:41
• @Cam.Davidson.Pilon Not quite - the rate of collisions is not dependent on time, time is what you integrate over. Time is a variable, but its behavior is qualitatively different than normal nodes'. The whole causal toolkit is not well-defined if you try using it on time itself - time is pretty much what causality is defined in.
– jkm
Dec 30, 2019 at 22:00

Whether "time" is an appropriate variable in a model depends on the phenomenon you are modeling. Thus, as you posed it, your question is about model misspecification, not a fundamental question about causal modeling per se. In some models, "time" (or "year" or "duration in seconds") will be an "appropriate" variable, in others it may not be.

To illustrate my point concretely, and since you believe time cannot be a causal variable, I will give you a simple counter-example in which time (duration) is an appropriate causal variable---a model of earnings in a savings account as a function of the time you leave your money invested.

Let $$Y$$ be your earnings, $$I$$ be the initial investment, and let $$T$$ be "time", or more precisely, how long you leave your money invested in the savings account (say, measured in months). Then, $$Y = f(I, T)$$ is an appropriate structural equation for $$Y$$, and how long you leave your money in the bank does cause how much money you will make. The action $$do(T = 6)$$ also has a clear meaning in this model (ie, leave the money invested for 6 months, regardless of other factors). In sum, with this model we can answer interventional and counterfactual questions regarding the effect of time in earnings (what you want from a causal model), and the model does have a clear (and simple) real world interpretation.

You may argue that $$T$$ in the model above is not "truly" what you mean by "time". But then you need to define what time "really" is, as a variable in the context of a specific causal model. Without defining what "time" stands for, what phenomenon is being modeled, and what the model is going to be used for (predictions of interventions?) we can't judge whether "time" is an appropriate variable, or whether it is being modeled appropriately.

An addendum: on variables as causes

In essence, causality is about the modification of (some) mechanisms, while keeping other mechanisms intact. Thus, if we wanted to be exact, we would need to describe all mechanisms that an action does and doesn't change. This is too demanding for most practical purposes, both describing the action completely, and all of the actions ramifications. Causal models abstract away this complexity by modeling causality in terms of events or variables.

So what does it mean to say that variable $$X$$ "causes" variable $$Y$$? This is a shortcut to, intead of characterizing an action by everything that it changes, characterizing it by its immediate effect. For instance, $$P(Y|do(X =x))$$ is a shortcut for stating that "the perturbation needed to bring about the event $$X=x$$ alters the distribution of $$Y$$ to $$P^*(Y)$$" and we define this new distribution $$P^*(Y):= P(Y|do(X =x))$$. Thus, when we say "time" causes something, this is an abstraction of a more complicated description of the process. In the case of the duration of investment, for instance, $$do(T = t)$$ really stands for "sustaining a specific process for t units of time".

• This is a very helpful answer (+1), and I think the idea of interest on an investment is a good one to illustrate the point. However, the notion that $\text{do}(T=6)$ constitutes a choice of "time" seems very dubious to me. The action you are taking is to choose to invest money, as opposed to not investing it --- you are not actually choosing whether time progresses or not. In this case, it seems to me that $T$ represents the period of time that you are choosing to invest money, not the progression of time itself. Would that be a fair characterisation?
– Ben
Jan 2, 2020 at 23:27
• And following up on that, it appears that you could have a "time" variable that represents a particular state-of-nature occurring for a prescribed time, but you cannot have time itself as a causal variable. What do you think?
– Ben
Jan 2, 2020 at 23:27
• @ReinstateMonica Thanks! Regarding $do(T=6)$, I don't understand your argument. In this case I am considering $T$ as the total time of the investment (the duration) and when you invest, you need to decide for how long you will invest as well. Regarding the "time variable that represents a particular state-of-nature", if I understood correctly, I agree. And this holds generally for any variable, see my edits above. Jan 3, 2020 at 5:59
• Finally, regarding "time itself", I don't know exactly what that would be. We need to define first what "time itself" is. Jan 3, 2020 at 6:02
• +1 This rocks: "sustaining a specific process for t units of time," and speaks to me about the distinctions between temporal ordering in counterfactual formal causal inference, versus temporal quantity in my comments to Ben's answer. Dec 19, 2021 at 5:51

Time almost necessarily is a factor in any causal analysis. In fact, I would say the majority of DAGs include it without the statistician actually explicitly thinking about it. Most often, it's age. Age is time since birth. We all agree this causes mortality. We also unthinking model interactions between age and other factors as a form of adjustment: cumulative pack-years of smoking, telomere length, educational achievement, household income, marital status, left-ventricular hypertrophy, et cetera.

Yes, age is a form of time. You can also have calendar year, especially when there are interruptions to a time series, you can find massive forms of temporal confounding because a certain intervention or policy was made available that massively disrupts a planned analysis, especially when treatment is allocated in a stepped-wedge, cross-over, or other non-parallel fashion.

Even in clinical trials, time-on-study is reflected in a number of important measures. Some drugs are likely to produce toxic effects at their first administration, others cumulatively overcome the liver or kidney's ability to metabolize and eventually lead to organ failure. Hawthorne effect can have a diminishing impact on the measured safety and efficacy outcomes, as a consequence of learning or becoming accustomed to the study setting. This is illustrated also with the issues of modeling per-protocol and intent-to-treat effects, where non-compliers and non-responders are dropped from the analysis set, you might say that conditioning on their outcomes, you can estimate a "pristine" effect of treatment in an ideal setting where patients comply with and suitably respond to treatment.

These are just the age, period, and cohort effects: the three forms of time that the statistician must account for in analyses. As we learn in time series modeling, when a lack of stationarity holds, we cannot presume that measures taken repeatedly over time are the same as many measures taken all at once. The statistician must identify and interpret a causal estimand and account for time in the appropriate, causal fashion.

• Age follows the same state-over-time-monoid model @reinstate-monica (and me) make an exception for, but again - it's the state you're interested in, not time. In other words, if you could magically age someone, you'd have the same causal effects following from it at some different time. Ironically, the time dilation argument in another answer proves a semi-realistic example of something just like that.
– jkm
Jan 3, 2020 at 11:00
• @jkm I don't follow. Possible to cite or explain in comment what you mean by "state-over-time-monoid"? Make no exception for me on bases other than the answer I'm giving here. Time dilation is often a precision variable: these can be represented in a DAG with an arrow straight to the outcome. I published a paper where we measured LV mass and neurovascular outcomes 5 years later. The key is that the estimand necessarily includes the 5 year lag, it is not cross sectional, but we continued to adjust for time (-5 years) because postbaseline assessments were $\pm$ 1 year: it improved inference. Jan 3, 2020 at 15:36
• The 'state variable' part of 'A state variable accruing over time can be a causal variable' in one of the answers above. And by time dilation, I meant the gravitational effect @Ed Rigdon brought up in his answer; someone living for 60 subjective years on an Earthlike planet close to a black hole and brought to Earth might be 16 in 'our' years - but its still his physical age that effects, say, risk of illness.
– jkm
Jan 3, 2020 at 15:50
• @jkm think about the counterfactual: were it one year earlier, the subject would be one year younger, and the potential outcome is modified. We can restrict our attention to planet Earth :) Jan 3, 2020 at 17:18

Gravitational time dilation means that time passes more slowly in the vicinity of a large mass. If time can be thus dependent, then it seems likely that time can also be a cause, as it seems arbitrary to permit time one role but not the other.

• Mass does not cause time here. Time will still happen regardless, possibly with some wiggle room for singularities. You could say gravity causes the rate at which time progresses to change - fair enough, but that's influencing the derivative of time.
– jkm
Jan 3, 2020 at 10:30
• @jkm No expert I. If time stops, then what is time? With enough gravity, you stop time. If strong gravity stops time, then weak gravity causes time. Causal inference is typically nonparametric--does that cover derivatives? Jan 3, 2020 at 18:23
• Doesn't follow. If shooting someone in the head stops them from being alive, not getting shot doesn't cause them to be alive. The effect itself can be easily visualized: take a deflated baloon and make two dots on it 1cm away from each other. Then start inflating the baloon and measure the distance (e.g. with a string). Now imagine the two points are 1s away from each other in time rather than 1cm away in space. A singularity would be an infinitely inflated baloon. Note that the points are still there!
– jkm
Jan 4, 2020 at 16:34
• @jkm derivative of time with respect to what? Special relativity says 'rate of time' (clock) is relative, not absolute. Jan 4, 2020 at 18:40
• An arbitrary frame of reference, e.g. Earth time, idealized zero gravity- or microgravity rate, some standard, you name it.
– jkm
Jan 4, 2020 at 21:11