Description Usage Arguments Details Value References Examples

This function returns a dataset generated from a Weibull proportional hazards model with a shared discrete frailty term, for given Weibull parameters, hazard ratios, distribution of groups among latent populations, frailty values for each latent population, and randomly-generated covariate values.

1 | ```
sim_weibdf(J, N = NULL, lambda, rho, beta, p, w_values, cens_perc)
``` |

`J` |
number of groups in the data |

`N` |
number of individuals in each group |

`lambda` |
Weibull baseline rate parameter (see below), interpreted as the rate parameter with covariate values of 0 and frailty ratio 1. For |

`rho` |
Weibull shape parameter (see below) |

`beta` |
covariate effects in the Weibull distribution, interpreted as log hazard ratios (see below) |

`p` |
vector of K elements. The kth element gives the proportion of groups in the kth latent population of groups. |

`w_values` |
vector of K distinct frailty values, one for each latent population. |

`cens_perc` |
cens_perc percentage of censored events. Censoring times are assumed to be distributed as a Normal with variance equal to 1. |

The "proportional hazards" parameterisation of the Weibull distribution is used, with survivor function *S(t) = exp(-λ t^{ρ} w exp(x^T {β}) )*. Note this is different from the "accelerated failure time" parameterisation used in, e.g. `dweibull`

. Distribution functions for the proportional hazards parameterisation can be found in the flexsurv package.

A data frame with one row for each simulated individual, and the following columns:

`family`

: the group which the individual is in (integers 1, 2, ...)

`time`

: the simulated event time.

`status`

: the simulated survival status. Censoring times are generated from a Normal distribution with standard deviation equal to 1 and the mean is estimated in order to guarantee the determined percentage of censored events. The event time is observed (status=1) if it is less than the censoring time, and censored otherwise (status=0).

`x`

: matrix of covariate values, generated from a standard normal distribution.

`belong`

: the frailty hazard ratio corresponding to the cluster of groups in which the individual's group has been allocated.

Wan, F. (2017). Simulating survival data with predefined censoring rates for proportional hazards models. *Statistics in medicine*, 36(5), 838-854.

1 2 3 4 5 6 7 8 9 10 |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.