Skip to content

Releases: RobinDenz1/simDAG

simDAG 1.0.1

Choose a tag to compare

@RobinDenz1 RobinDenz1 released this 31 Jul 09:37

Bug Fixes

  • Temporary fix for a bug caused by changes in lme4, which in turn caused a bug in the simr package. Installing simr from github already fixes the issue, so this update was made solely to retain simDAG on CRAN.

simDAG 1.0.0

Choose a tag to compare

@RobinDenz1 RobinDenz1 released this 15 May 12:26

New features

  • Allow arbitrary baseline hazard functions in node_cox(). This also makes it possible to perform discrete-event simulations using sim_discrete_event() with variables that have continuous time-dependent baseline hazards, by using the model argument.

Enhancements

  • Added the all_levels argument to the rcategorical() 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

Choose a tag to compare

@RobinDenz1 RobinDenz1 released this 30 Mar 11:38

Bug Fixes

  • This update was only done to fix failing tests on CRAN due to an update in the simr package. Nothing else changed.

simDAG 0.5.1

Choose a tag to compare

@RobinDenz1 RobinDenz1 released this 10 Mar 07:49

New Features

  • Added the node_polr() function to allow generation of data from an ordered logistic or probit regression.

Enhancements

  • Added support for all rsurv package based time-to-event nodes in the model argument of node_next_time() nodes in discrete-event simulation. Many thanks to Fábio N. Demarqui (@fndemarqui) for making this possible!
  • Removed the allow_ties argument from sim_discrete_event() (ties are now handled automatically in a more efficient manner, without the need for user intervention).

simDAG 0.5.0

Choose a tag to compare

@RobinDenz1 RobinDenz1 released this 08 Jan 17:57

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 comparable sim_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 around sample(), 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 of DAG to tidy_dagitty objects used to create plots in the ggdag package.

Enhancements

  • Added the remove_if and break_if arguments to the sim_discrete_time() function, to allow users some options that potentially make the simulation much faster.
  • Allow function input to the data_format argument of the sim_n_datasets() function to avoid potentially weird bugs in parallel processing.
  • There was a slight change to node_binomial(), which increases performance if return_probs=TRUE is used (avoiding a needless rbernoulli() call). The results of simulations with a DAG containing a node with both type="binomial" and return_probs=TRUE might therefore differ on the same random number generator seed as compared to previous versions.
  • Made the node_cox() function faster, added the left argument to it to allow left-truncation and changed the default of cens_dist to NULL. These changes likely result in different data being generated as compared to previous versions, even with the same random number generator seed.
  • Added the formula argument to node_time_to_event() to allow users to easily calculate event probabilities from binomial regression models without having to specify a prob_fun.
  • Allow DAG.node definitions in the values argument of the do() function, to make changing existing DAGs easier.

Bug Fixes

  • Fixed a bug where using n_sim=1 in sim_from_dag() lead to a false error with some child node types.
  • Function calls on the intercept part of enhanced formulas are now supported correctly. Previously, formulas like ~ log(0.1) + 2*A would 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

Choose a tag to compare

@RobinDenz1 RobinDenz1 released this 15 Oct 16:51

New Features

  • Added the link argument to node_gaussian(), node_binomial(), node_poisson(), node_negative_binomial() and node_zeroinfl() to allow different link functions when generating data from these nodes.
  • Added the as.dagitty.DAG() function to allow direct conversion of DAG objects to dagitty objects.

Bug Fixes

  • Previously, the sim_n_datasets() function used stats::runif(1) as a default for the seed argument. Because seeds are coerced to integers in set.seed(), this essentially meant the seed argument was always set to 0 (unless changed by the user), which was not intended. We changed the default to be NULL, which is equivalent to not setting a seed. This might change results obtained using previous versions. To get the same result as in previous versions, use seed=0 or seed=stats::runif(1).
  • Fixed a bug that occurred when calling node() or node_td() inside a function with objects passed to parents or formula.

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

Choose a tag to compare

@RobinDenz1 RobinDenz1 released this 27 Aug 19:01

New Features

  • Added the network(), network_td() and net() functions to allow simulations with network based dependencies among individuals. This includes static and dynamic networks in regular DAGs and discrete-time simulations.

Enhancements

  • Added the kind argument to node_identity() to allow different kinds of input to the formula argument.
  • Added the include_networks argument to dag2matrix() and as.igraph(), due to the new networks-based simulation features.
  • Added the unif argument to node_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 formula with just one predictor in nodes that do not need an intercept.
  • Fixed a faulty error message when using a string of a formula with node_identity() in sim_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

Choose a tag to compare

@RobinDenz1 RobinDenz1 released this 24 Jun 14:22

Documentation

  • Added a vignette of the Journal of Statistical Software paper (provisionally accepted)
  • Changed all citation information accordingly

simDAG 0.3.1

Choose a tag to compare

@RobinDenz1 RobinDenz1 released this 28 May 08:10

Enhancements

  • Added the remove_vars argument to the sim2data() function, to allow users to exclude certain variables from the output if desired.

Bug Fixes

  • Fixed a bug where sim_n_datasets() would fail with n_cores > 1 whenever nested custom functions were used in nodes.

Documentation

  • The previous node_custom documentation page has been turned into a vignette (which it should have been from the start).

simDAG 0.3.0

Choose a tag to compare

@RobinDenz1 RobinDenz1 released this 30 Mar 17:36

New Features

  • Support for random effects and random slopes (mixed model syntax) has been added to the formula interface of node() and node_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() and node_mixture().

Enhancements

  • Added the reference argument to rbernoulli() and rcategorical() to make it easier to specify the reference category when coding the output as a factor variable.
  • +.DAG now checks whether the DAG would become cyclic when adding a node() and returns an error if it does.
  • Added the include_td_nodes and include_root_nodes arguments to as.igraph.DAG().
  • Changed the default of n_cores in the sim_n_datasets() function to 1 from parallel::detectCores()
  • Function input to the cens_dist argument in the node_cox() function is now allowed.
  • The argument as_two_cols was added to the node_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 the formula argument.

Documentation

  • Added new "cookbook" vignette to showcase more possible use cases of the package.
  • Visual update of the DAGs shown in the vignette figures.