Bayesian Networks with time-dependent variables
Bayesian Networks are graphical networks in which the joint and conditional probability distributions given by the assumed DAG are estimated, and can be used for inference. We call this the The DAG shows the assumed network structure between the nodes Activity (For the implementation, the bnlearn package is used. In the first step, we implement an interface to convert the DAGitty graph to a Bayesian Network and defined the appropriate scale of each variable. Then, the Bayesian Network is fitted to the data with the bnlearn::bn.fit function with default settings. We estimate the parameters by the empirical mean of their posterior distribution using the method = "bayes" argument. For estimating the average treatment effect difference, we use the bnlearn::cpdist function of the fitted network [In the analysis, we apply two Bayesian Networks. The first model is fitted to the DAG without any time dependencies. The second model additionally includes the lags to model time-dependencies as described above.