Skip to content

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.