powered by
Draw time to event (tte) from a Poisson or Poisson-Gamma (PG) Mixture/Negative Binomial (NB) Process using C++
rpoisgamma_rcpp( n, rate, theta = NULL, obs_time = 1, t_reps = NULL, seed = NULL, return_ind_rate = FALSE, return_df = FALSE )
If return_df=TRUE: a data.frame (or NULL if no events). Else: list with tte and optionally ind_rate.
The number of observations to be drawn
rate of the event (events per unit time)
Optional. If provided, Poisson-Gamma (NB). Represents gamma shape.
period over which events are observable
Optional. Number of TBEs to be generated to capture events within the observation window.
Optional integer seed for reproducibility.
Logical: include individual rate vector in output when theta provided.
Logical: return a data.frame with event-level rows (if TRUE).
rpoisgamma_rcpp(1, rate = 1, obs_time = 1, theta = 1)
Run the code above in your browser using DataLab