c****s 发帖数: 63 | 1 题目如下:
To produce two groups (group =1 is the treated group and group =0 is
untreated). I would like to set up the simulation so that group =1
experiences outcome =1 at a faster rate than group =0. We do not need to
have loss to follow up right now, so we can treat the days variable as the
time to the event.
We want to set up the simulation so that the time to event occurs at a
faster rate in the treated group. I think I can use the exponential
distribution, or we may have to program a hazard | l********s 发帖数: 430 | 2 group<-c(rep(0,100),rep(1,100))
time<-c(rexp(100,1),rexp(100,2)) |
|