Generate simulated data
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)A data frame with columns:
| Name | Description |
| id | id variable |
| trt | treatment allocation: 1 = treatment arm |
| D1 | patient's response status for group 1 |
| D2 | patient's response status for group 2 |
| Dm | patient's response status for non-responders |
| tau | total study duration |
| enroll_time | patients' enrollment times |
| time_to_event | patients' event times |
| event_status | censoring indicator |
| X | observational time |
| t1 | delayed duration |
Maximum sample size
Allocation ratio
Vector for proportion of responders in the treatment arm at baseline (see details)
Enrollment rate in subjects per month
Baseline hazard in terms of months
Vector of hazard ratios for responders against controls (see details)
Total study duration
Delayed duration
Zhenzhen Xu <Zhenzhen.Xu@fda.hhs.gov>, Yongsoek Park <yongpark@pitt.edu> and Bin Zhu <bin.zhu@nih.gov>
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.
data <- generate_data()
data[1:5, ]
Run the code above in your browser using DataLab