Releases: RobinDenz1/simDAG
Releases · RobinDenz1/simDAG
Release list
simDAG 1.0.1
Bug Fixes
- Temporary fix for a bug caused by changes in
lme4, which in turn caused a bug in thesimrpackage. Installingsimrfrom github already fixes the issue, so this update was made solely to retainsimDAGon CRAN.
simDAG 1.0.0
New features
- Allow arbitrary baseline hazard functions in
node_cox(). This also makes it possible to perform discrete-event simulations usingsim_discrete_event()with variables that have continuous time-dependent baseline hazards, by using themodelargument.
Enhancements
- Added the
all_levelsargument to thercategorical()function to allow users to keep all levels, even when some never occur in the generated data. - When defining custom node generation functions for custom nodes required for the
dag_from_data()function, additional arguments are now supported.
Bug Fixes
- Fixed a bug that occurred when using
dag_from_data()with categorical parents in nodes based on generalized linear models and negative binomial regression models.
Documentation
- Added the official citation information for the newly published Journal of Statistical Software paper.
simDAG 0.5.2
Bug Fixes
- This update was only done to fix failing tests on CRAN due to an update in the
simrpackage. Nothing else changed.
simDAG 0.5.1
New Features
- Added the
node_polr()function to allow generation of data from an ordered logistic or probit regression.
Enhancements
- Added support for all
rsurvpackage based time-to-event nodes in themodelargument ofnode_next_time()nodes in discrete-event simulation. Many thanks to Fábio N. Demarqui (@fndemarqui) for making this possible! - Removed the
allow_tiesargument fromsim_discrete_event()(ties are now handled automatically in a more efficient manner, without the need for user intervention).
simDAG 0.5.0
New Features
- Added the
sim_discrete_event()function, which allows users to perform discrete-event simulations to generate complex longitudinal data in continuous time. This function is usually much faster than comparablesim_discrete_time()calls, although at the cost of some flexibility. - Added the
rtexp()function to allow sampling from left-truncated exponential distributions. - Added the
rsample()function as a convenient wrapper aroundsample(), as suggested by Ed Hagen. - Added the
node_aalen()function to allow data to be generated according to an Aalen additive hazards model with time-constant betas and baseline hazard. - Added the
as_tidy_dagitty.DAG()method, which allows direct conversion ofDAGtotidy_dagittyobjects used to create plots in theggdagpackage.
Enhancements
- Added the
remove_ifandbreak_ifarguments to thesim_discrete_time()function, to allow users some options that potentially make the simulation much faster. - Allow function input to the
data_formatargument of thesim_n_datasets()function to avoid potentially weird bugs in parallel processing. - There was a slight change to
node_binomial(), which increases performance ifreturn_probs=TRUEis used (avoiding a needlessrbernoulli()call). The results of simulations with aDAGcontaining a node with bothtype="binomial"andreturn_probs=TRUEmight therefore differ on the same random number generator seed as compared to previous versions. - Made the
node_cox()function faster, added theleftargument to it to allow left-truncation and changed the default ofcens_disttoNULL. These changes likely result in different data being generated as compared to previous versions, even with the same random number generator seed. - Added the
formulaargument tonode_time_to_event()to allow users to easily calculate event probabilities from binomial regression models without having to specify aprob_fun. - Allow
DAG.nodedefinitions in thevaluesargument of thedo()function, to make changing existingDAGs easier.
Bug Fixes
- Fixed a bug where using
n_sim=1insim_from_dag()lead to a false error with some child node types. - Function calls on the
interceptpart of enhancedformulas are now supported correctly. Previously,formulas like~ log(0.1) + 2*Awould have resulted in a false error.
Documentation
- Small changes to include the new
sim_discrete_event()everywhere. - Added a new vignette introducing the
sim_discrete_event()function.
simDAG 0.4.1
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
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
Documentation
- Added a vignette of the Journal of Statistical Software paper (provisionally accepted)
- Changed all citation information accordingly
simDAG 0.3.1
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
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.