stepp.subpop: The constructor to create the stsubpop object and generate...

View source: R/stsubpop.R

stepp.subpopR Documentation

The constructor to create the stsubpop object and generate the subpopulations based on the specified stepp window and covariate of interest

Description

This is the constructor function to create a stepp subpopulation object. In addition, it will also generate the stepp subpopulations based on the stepp window and covariate specified.

Usage

stepp.subpop(swin, cov, coltype, coltrt, trts, minsubpops)

Arguments

swin

the stepp window set up for the analysis

cov

the covariate of interest

coltype

variable providing the event type; required only for event-based windows

coltrt

variable providing the treatment indicators; required only for event-based windows

trts

vector containing the treatments list; required only for event-based windows

minsubpops

length-one numeric vector providing the minimum number of subpopulations to generate; required only for event-based windows

Value

It returns the stsubpop object with subpopulations generated.

Author(s)

Wai-Ki Yip

See Also

stwin, stsubpop, stmodelKM, stmodelCI, stmodelGLM, steppes, stmodel, stepp.win, stepp.KM, stepp.CI, stepp.GLM, stepp.test, estimate, generate

Examples

# 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   <- stepp.subpop(swin=win1, cov=Y)

# 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)

stepp documentation built on June 18, 2022, 5:06 p.m.

Related to stepp.subpop in stepp...