simBivRec {BivRec}R Documentation

Bivariate Alternating Recurrent Event Response and Covariate Data Simulation

Description

This function simulates a series of alternating recurrent events based on the simulation setting in Lee, Huang, Xu, Luo (2018).

Usage

simBivRec(nsize, beta1, beta2, tau_c, set)

Arguments

nsize

Sample size which refers to the number of subjects in the data set where each subject could have multiple episodes of events.

beta1

True coefficients for Type I gap times in the accelerated failure time model (AFT).

beta2

True coefficients for Type II gap times in the accelerated failure time model (AFT).

tau_c

Maximum support of censoring time. It can take values as follows:

  • tau_c=63 (default): corresponds to a 15% censoring rate for each scenario in Tables 1 and 2 of Lee, Huang, Xu, Luo (2018).

  • tau_c=30: corresponds to a 30% censoring rate for each scenario in Tables 1 and 2 of Lee, Huang, Xu, Luo (2018).

set

Simulation setting based on scenarios outlined in Tables 1 and 2 in Lee, Huang, Xu, Luo (2018). Choose 1.1 (default) for scenario 1 with ρ=1 in the covariance matrix of the frailty vector, 1.2 for scenario 1 with ρ=0.5, 1.3 for scenario 1 with ρ=0 and 2.0 for scenario 2.

Value

Data frame with the alternating recurrent event data and one continuous and one binary covariate.

References

Lee CH, Huang CY, Xu G, Luo X. (2018). Semiparametric regression analysis for alternating recurrent event data. Statistics in Medicine, 37: 996-1008. doi: 10.1002/sim.7563

Examples

library(BivRec)
set.seed(1234)
sim_data <- simBivRec(nsize=150, beta1=c(0.5,0.5), beta2=c(0,-0.5),
            tau_c=63, set=1.1)
head(sim_data)


[Package BivRec version 1.2.1 Index]