Skip to contents

DAGs

Create, manipulate and inspect DAGs

empty_dag()
Initialize an empty DAG object
node() node_td()
Create a node object to grow a DAG step-by-step
add_node() `+`(<DAG>)
Add a DAG.node object to a DAG object
plot(<DAG>)
Plot a DAG object
as.igraph(<DAG>)
Transform a DAG object into an igraph object
do()
Pearls do-operator for DAG objects
dag2matrix()
Obtain a Adjacency Matrix from a DAG object
matrix2dag()
Obtain a DAG object from a Adjacency Matrix and a List of Node Types
dag_from_data()
Fills a partially specified DAG object with parameters estimated from reference data

Simulation

Simulate data from a DAG and manipulate or visualize the output

sim_from_dag()
Simulate Data from a DAG
sim_discrete_time()
Simulate Data from a DAG with Time-Dependent Variables
sim_n_datasets()
Simulate multiple datasets from a single DAG object
sim2data() as.data.table(<simDT>) as.data.frame(<simDT>)
Transform sim_discrete_time output into the start-stop, long- or wide-format
plot(<simDT>)
Plot a Flowchart for a Discrete-Time Simulation

Root nodes

Functions that can be used as root nodes

rbernoulli()
Generate Random Draws from a Bernoulli Distribution
rcategorical()
Generate Random Draws from a Discrete Set of Labels with Associated Probabilities
rconstant()
Use a single constant value for a root node

Child nodes

Functions that can be used as child nodes

node_gaussian()
Generate Data from a (Mixed) Linear Regression Model
node_binomial()
Generate Data from a (Mixed) Logistic Regression Model
node_conditional_prob()
Generate Data Using Conditional Probabilities
node_conditional_distr()
Generate Data by Sampling from Different Distributions based on Strata
node_multinomial()
Generate Data from a Multinomial Regression Model
node_poisson()
Generate Data from a (Mixed) Poisson Regression Model
node_negative_binomial()
Generate Data from a Negative Binomial Regression Model
node_zeroinfl()
Simulate a Node Using a Zero-Inflated Count Model
node_identity()
Generate Data based on an expression
node_mixture()
Generate Data from a Mixture of Node Definitions
node_cox()
Generate Data from a Cox-Regression Model
node_aftreg() node_ahreg() node_ehreg() node_poreg() node_ypreg()
Generate Data from Parametric Survival Models

Time-dependent nodes

Functions that can only be used as time-dependent nodes

node_time_to_event()
Generate Data from repeated Bernoulli Trials in Discrete-Time Simulation
node_competing_events()
Generate Data with Multiple Mutually Exclusive Events in Discrete-Time Simulation

Misc

long2start_stop()
Transform a data.table in the long-format to a data.table in the start-stop format
simDAG-package
Simulate Data from a DAG and Associated Node Information