showClass("stsubpop")
# create a steppp window
win1 <- stepp.win(type="sliding", r1=5,r2=10)
# generate the covariate of interest
Y <- rnorm(100)
# create and generate the stepp subpopulation
sp <- new("stsubpop")
sp <- generate(sp, win=win1, cov=Y)
summary(sp)
# event-based windows using the BIG data set
data(bigKM)
rxgroup <- bigKM$trt
time <- bigKM$time
evt <- bigKM$event
cov <- bigKM$ki67
swin_e <- new("stwin", type = "sliding_events", e1 = 10, e2 = 20)
subp_e <- new("stsubpop")
subp_e <- generate(subp_e, win = swin_e, covariate = cov, coltype = evt,
coltrt = rxgroup, trts = c(1, 2), minsubpops = 5)
summary(subp_e)
Run the code above in your browser using DataLab