Package: simDAG 0.2.2.9000

Robin Denz

simDAG: Simulate Data from a DAG and Associated Node Information

Simulate complex data from a given directed acyclic graph and information about each individual node. Root nodes are simply sampled from the specified distribution. Child Nodes are simulated according to one of many implemented regressions, such as logistic regression, linear regression, poisson regression and more. Also includes a comprehensive framework for discrete-time simulation, which can generate even more complex longitudinal data.

Authors:Robin Denz [aut, cre], Katharina Meiszl [aut]

simDAG_0.2.2.9000.tar.gz
simDAG_0.2.2.9000.zip(r-4.5)simDAG_0.2.2.9000.zip(r-4.4)simDAG_0.2.2.9000.zip(r-4.3)
simDAG_0.2.2.9000.tgz(r-4.5-any)simDAG_0.2.2.9000.tgz(r-4.4-any)simDAG_0.2.2.9000.tgz(r-4.3-any)
simDAG_0.2.2.9000.tar.gz(r-4.5-noble)simDAG_0.2.2.9000.tar.gz(r-4.4-noble)
simDAG_0.2.2.9000.tgz(r-4.4-emscripten)simDAG_0.2.2.9000.tgz(r-4.3-emscripten)
simDAG.pdf |simDAG.html
simDAG/json (API)
NEWS

# Install 'simDAG' in R:
install.packages('simDAG', repos = c('https://robindenz1.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/robindenz1/simdag/issues

Pkgdown site:https://robindenz1.github.io

On CRAN:

Conda:

causal-inferencedirected-acyclic-graphsimulation

7.69 score 11 stars 77 scripts 428 downloads 33 exports 17 dependencies

Last updated 19 hours agofrom:8390de3d2c. Checks:9 OK. Indexed: yes.

TargetResultLatest binary
Doc / VignettesOKMar 25 2025
R-4.5-winOKMar 25 2025
R-4.5-macOKMar 25 2025
R-4.5-linuxOKMar 25 2025
R-4.4-winOKMar 25 2025
R-4.4-macOKMar 25 2025
R-4.4-linuxOKMar 25 2025
R-4.3-winOKMar 25 2025
R-4.3-macOKMar 25 2025

Exports:add_nodedag_from_datadag2matrixdoempty_daglong2start_stopmatrix2dagnodenode_aftregnode_ahregnode_binomialnode_competing_eventsnode_conditional_distrnode_conditional_probnode_coxnode_ehregnode_gaussiannode_identitynode_multinomialnode_negative_binomialnode_poissonnode_poregnode_tdnode_time_to_eventnode_ypregnode_zeroinflrbernoullircategoricalrconstantsim_discrete_timesim_from_dagsim_n_datasetssim2data

Dependencies:clicpp11data.tableglueigraphlatticelifecyclemagrittrMatrixpkgconfigRcppRcppArmadilloRcppParallelRfastrlangvctrszigg

simDAG Cookbook

Rendered fromv_cookbook.Rmdusingknitr::rmarkdownon Mar 25 2025.

Last update: 2025-03-22
Started: 2025-03-18

Simulating Covid-19 Vaccine Data using a Discrete-Time Simulation

Rendered fromv_covid_example.Rmdusingknitr::rmarkdownon Mar 25 2025.

Last update: 2024-03-07
Started: 2022-09-19

Simulating Data from a known DAG

Rendered fromv_sim_from_dag.Rmdusingknitr::rmarkdownon Mar 25 2025.

Last update: 2024-12-19
Started: 2022-09-19

Simulating Data using a Discrete-Time Approach

Rendered fromv_sim_discrete_time.Rmdusingknitr::rmarkdownon Mar 25 2025.

Last update: 2024-06-05
Started: 2023-01-26

Specifying Formulas in a DAG

Rendered fromv_using_formulas.Rmdusingknitr::rmarkdownon Mar 25 2025.

Last update: 2025-03-22
Started: 2024-07-16

Readme and manuals

Help Manual

Help pageTopics
Simulate Data from a DAG and Associated Node InformationsimDAG-package
Add a 'DAG.node' object to a 'DAG' object+.DAG add_node
Transform a DAG object into an 'igraph' objectas.igraph.DAG
Fills a partially specified 'DAG' object with parameters estimated from reference datadag_from_data
Obtain a Adjacency Matrix from a 'DAG' objectdag2matrix
Pearls do-operator for 'DAG' objectsdo
Initialize an empty 'DAG' objectempty_dag
Transform a 'data.table' in the long-format to a 'data.table' in the start-stop formatlong2start_stop
Obtain a 'DAG' object from a Adjacency Matrix and a List of Node Typesmatrix2dag
Create a node object to grow a DAG step-by-stepnode node_td
Simulate a Node Using (Mixed) Logistic Regressionnode_binomial
Simulate a Time-to-Event Node with Multiple Mutually Exclusive Events in Discrete-Time Simulationnode_competing_events
Simulate a Node by Sampling from Different Distributions based on Stratanode_conditional_distr
Simulate a Node Using Conditional Probabilitiesnode_conditional_prob
Simulate a Node Using Cox-Regressionnode_cox
Create Your Own Function to Simulate a Root Node, Child Node or Time-Dependent Nodenode_custom
Simulate a Node Using (Mixed) Linear Regressionnode_gaussian
Simulate a Node based on an expressionnode_identity
Simulate a Node Using Multinomial Regressionnode_multinomial
Simulate a Node Using Negative Binomial Regressionnode_negative_binomial
Simulate a Node Using (Mixed) Poisson Regressionnode_poisson
Simulate a Node Using Parametric Survival Modelsnode_aftreg node_ahreg node_ehreg node_poreg node_rsurv node_ypreg
Simulate a Time-to-Event Node in Discrete-Time Simulationnode_time_to_event
Simulate a Node Using a Zero-Inflated Count Modelnode_zeroinfl
Plot a 'DAG' objectplot.DAG
Create a Simple Flowchart for a Discrete-Time Simulationplot.simDT
Generate Random Draws from a Bernoulli Distributionrbernoulli
Generate Random Draws from a Discrete Set of Labels with Associated Probabilitiesrcategorical
Use a single constant value for a root noderconstant
Using Discrete-Time Simulation to Generate Complex Data from a Given DAG and Node Informationsim_discrete_time
Simulate Data from a Given DAG and Node Informationsim_from_dag
Generate multiple datasets from a single 'DAG' objectsim_n_datasets
Transform 'sim_discrete_time' output into the start-stop, long- or wide-formatas.data.frame.simDT as.data.table.simDT sim2data