Learn R Programming

PRIMEplus (version 1.0.16)

generate_data: Simulated data

Description

Generate simulated data

Usage

generate_data(N=500, rand_ratio=0.5, effect_p=0.6, enroll_rate=380*0.25/6, 
              lambda1=0.117, HR=0.5, tau=12*5, t1=1)

Value

A data frame with columns:

NameDescription
idid variable
trttreatment allocation: 1 = treatment arm
D1patient's response status for group 1
D2patient's response status for group 2
Dmpatient's response status for non-responders
tautotal study duration
enroll_timepatients' enrollment times
time_to_eventpatients' event times
event_statuscensoring indicator
Xobservational time
t1delayed duration

Arguments

N

Maximum sample size

rand_ratio

Allocation ratio

effect_p

Vector for proportion of responders in the treatment arm at baseline (see details)

enroll_rate

Enrollment rate in subjects per month

lambda1

Baseline hazard in terms of months

HR

Vector of hazard ratios for responders against controls (see details)

tau

Total study duration

t1

Delayed duration

Author

Zhenzhen Xu <Zhenzhen.Xu@fda.hhs.gov>, Yongsoek Park <yongpark@pitt.edu> and Bin Zhu <bin.zhu@nih.gov>

Details

The length and order of effect_p must be the same as HR. Both of these vectors should contain information only for the groups of responders. For example, if there are full responders and partial responders, then effect_p and HR would be vectors of length two.

Examples

Run this code
  data <- generate_data()
  data[1:5, ]

Run the code above in your browser using DataLab