simDAG 0.4.1
CRAN release: 2025-10-15
New Features
- Added the
linkargument tonode_gaussian(),node_binomial(),node_poisson(),node_negative_binomial()andnode_zeroinfl()to allow different link functions when generating data from these nodes. - Added the
as.dagitty.DAG()function to allow direct conversion ofDAGobjects todagittyobjects.
Bug Fixes
- Previously, the
sim_n_datasets()function usedstats::runif(1)as a default for theseedargument. Because seeds are coerced to integers inset.seed(), this essentially meant theseedargument was always set to 0 (unless changed by the user), which was not intended. We changed the default to beNULL, which is equivalent to not setting aseed. This might change results obtained using previous versions. To get the same result as in previous versions, useseed=0orseed=stats::runif(1). - Fixed a bug that occurred when calling
node()ornode_td()inside a function with objects passed toparentsorformula.
Documentation
- Added explanations for how to simulate data for Cox models with time-varying covariates and Aalen additive hazards models with time-varying covariates to the cookbook vignette.
simDAG 0.4.0
CRAN release: 2025-08-27
New Features
- Added the
network(),network_td()andnet()functions to allow simulations with network based dependencies among individuals. This includes static and dynamic networks in regularDAGs and discrete-time simulations.
Enhancements
- Added the
kindargument tonode_identity()to allow different kinds of input to theformulaargument. - Added the
include_networksargument todag2matrix()andas.igraph(), due to the new networks-based simulation features. - Added the
unifargument tonode_time_to_event()to allow users to generate multiple time-to-event nodes at once that are basically using the same “seed” value for the random number generator.
Bug Fixes
- Fixed a minor bug that occurred when using
node + DAG(in this order). - Fixed a faulty error message produced when using
formulawith just one predictor in nodes that do not need an intercept. - Fixed a faulty error message when using a string of a
formulawithnode_identity()insim_discrete_time().
Documentation
- Added a new vignette to describe the new networks-based simulation features.
- Updated existing documentation pages to include networks-based simulation features.
simDAG 0.3.2
CRAN release: 2025-06-24
Documentation
- Added a vignette of the Journal of Statistical Software paper (provisionally accepted)
- Changed all citation information accordingly
simDAG 0.3.1
CRAN release: 2025-05-28
Enhancements
- Added the
remove_varsargument to thesim2data()function, to allow users to exclude certain variables from the output if desired.
Bug Fixes
- Fixed a bug where
sim_n_datasets()would fail withn_cores > 1whenever nested custom functions were used in nodes.
Documentation
- The previous
node_customdocumentation page has been turned into a vignette (which it should have been from the start).
simDAG 0.3.0
CRAN release: 2025-03-30
New Features
- Support for random effects and random slopes (mixed model syntax) has been added to the
formulainterface ofnode()andnode_td()when using nodes of type"gaussian","binomial"or"poisson". - Added seven new node types:
node_aftreg(),node_ahreg(),node_poreg(),node_ypreg(),node_ehreg(),node_zeroinfl()andnode_mixture().
Enhancements
- Added the
referenceargument torbernoulli()andrcategorical()to make it easier to specify the reference category when coding the output as a factor variable. -
+.DAGnow checks whether theDAGwould become cyclic when adding anode()and returns an error if it does. - Added the
include_td_nodesandinclude_root_nodesarguments toas.igraph.DAG(). - Changed the default of
n_coresin thesim_n_datasets()function to 1 fromparallel::detectCores() - Function input to the
cens_distargument in thenode_cox()function is now allowed. - The argument
as_two_colswas added to thenode_cox()function to allow users to return only the time-to-event as a single column if no censoring is applied.
Bug Fixes
- Fixed a bug that occurred when a user-specified root node function returned a
data.frame-like object with more than one column. - Fixed a bug when printing the structural equation of a poisson node, in which the
exp()call did not show up when the node was defined using theformulaargument.
Documentation
- Added new “cookbook” vignette to showcase more possible use cases of the package.
- Visual update of the DAGs shown in the vignette figures.
simDAG 0.2.2
CRAN release: 2025-02-23
Bug Fixes
- When specifying a node as both a root or child node and as a time-dependent node, it is no longer counted twice in
print.DAG() - Fix small error in tests due to changes in
data.table
simDAG 0.2.1
CRAN release: 2025-01-07
Enhancements
- External variables may now be used in the formula interface using
eval()calls. - Added the
remove_not_at_riskargument to thesim2data()function. - Change default of
t0_sort_daginsim_discrete_time()fromTRUEtoFALSEfor more consistency withsim_from_dag().
Bug Fixes
- Using
sim2data()with time-dependent nodes of typenode_competing_events()no longer results in an unwarranted error message. - Using the column name
"time"in thetimeargument oflong2start_stop()now works properly.
New Features
- Added the
node_identity()function to allow users to directly calculate nodes as an R expression of other nodes without the need to define a new function.
Documentation
- Added more examples in the formula vignette.
simDAG 0.2.0
CRAN release: 2024-09-03
Enhancements
- Added the
outputargument to therbernoulli()function to allow different output formats. - Change default of
sort_daginsim_from_dag()fromTRUEtoFALSE. - Moved the functionality of the
coerce2factorandcoerce2numericarguments inrcategorical(),node_multinomial()andnode_binomial()to theoutputargument for a more consistent syntax and easier usage. - It is now allowed to directly supply functions to the
typeargument innode()andnode_td(). - Passing optional arguments to the
layoutfunction inplot.DAG()is now supported.
Bug Fixes
- The
node_fillargument of theplot.DAG()function is no longer being ignored ifmark_td_nodeswas set toTRUE.
New Features
- Added a new enhanced formula interface, which allows users to directly type out the underlying structural equations for many node types. This replaces the old
formulaargument. Standard formulas (without betas and intercepts) are still supported, but no longer mentioned in the documentation and will be deprecated in future versions.
Documentation
- Added a new vignette explaining in detail how the new enhanced formula interface for the
node()function works.
simDAG 0.1.2
CRAN release: 2024-06-13
General
-
simDAGno longer listsdata.tableunder “Depends” in the description file. It is instead listed under “Imports” as recommended by thedata.tablecrew
Enhancements
- Print underlying structural equations in
summary.DAG()andsummary.DAG.node() - Added the
overlapargument to bothlong2start_stop()andsim2data()to directly create start-stop data with overlapping durations, as needed for some statistical models - Added the
target_eventandkeep_only_firstarguments tosim2data()and related functions, to allow direct transformation into model-ready dataset - Made the
long2start_stop()function more computationally efficient
Bug Fixes
- Fixed a small bug in input checks of the
node_time_to_event()function, which printed an error when not all arguments toprob_funwere supplied, even when these arguments had default values - Fixed bug in
print.DAG.node()which occurred when a time-to-event node with no parents was supplied - Fixed a bug in
sim2data()which lead to inconsistent results whenevent_duration=0was used in one or more nodes of type “time_to_event” or “competing_events”. This made me realize that event durations smaller than 1 make no sense. They are now no longer allowed and the default of the node types has been changed accordingly. - Fixed a bug that resulted in errors when interaction terms were being supplied through
formulaobjects of child nodes
New Features
- Added the
as.igraph.DAG()method which extends the generic functionas.igraph()to conveniently parseDAGobjects toigraphobjects - Added
as.data.table.simDT()andas.data.frame.simDT()for user convenience
Documentation
- Documentation pages of most nodes now include formal descriptions of the data generation mechanism
- Re-wrote the documentation page for custom node definition
simDAG 0.1.1
CRAN release: 2024-03-07
Enhancements
-
node()andnode_td()now support character vectors in the ‘name’ argument, allowing easy creation of multiple nodes with the same definition
Bug Fixes
- There was a bug in the
node_time_to_event()function that lead to theimmunity_durationparameter being used incorrectly. Since events were still recorded correctly, this was only apparent when usingsave_states="all". Works correctly now. - There was a small bug in
dag2matrix()if the dag object contained only root nodes. In this case, a logical matrix was returned. Now it returns the correct numeric matrix.
New Features
- Added the
sim_n_datasets()function to generate multiple datasets from a single dag object, possibly using multicore processing
Documentation
- Minor changes to documentation pages
- Minor changes to vignettes
