Learn R Programming

BayesAT (version 0.1.0)

Simulate_Enroll: Survival data simulation

Description

Simulate_Enroll generates multiple streams of data sets with survival time, censoring status, and enrollment time.

Usage

Simulate_Enroll(
  n,
  lambda,
  event,
  M,
  group,
  maxt,
  accrual,
  censor,
  followup,
  partition = "Even"
)

Value

Simulated survival data contain both survival time, censoring status, and enrollment time.

Arguments

n

Integer. Sample size of patients

lambda

Numerical range 0 and 1. Hazard rate of expoential distribution

event

Numerical range 0 and 1. Event rate

M

Integer. Number of trials generated for multiple streams of MCMC

group

Integer. Number of subgroup for patient enrollment

maxt

Numerical. The maximum time length of entire trial

accrual

Numerical. The duration of patient enrolment

censor

Numerical range 0 and 1. The censoring rate of patients leaving before trial ends.

followup

Integer. The time length of follow up.

partition

Logical. If partition == "Even", the trial recruits equal numbers of patients in each stage; and if partition == "Uneven", the trial recruits unequal numbers of patients in each stage.

Examples

Run this code
data <- Simulate_Enroll(n = c(50,20,20), lambda = 0.03,
                        event = 0.1, M = 3, group = 3, maxt = 5,
                        accrual = 3,  censor = 0.9, followup = 2,
                        partition = "Uneven")
head(data[[1]])
head(data[[2]])
head(data[[3]])

Run the code above in your browser using DataLab