| drawTttSequence | R Documentation |
Draw treatment sequence for multiple and intermittent exposures (treatment switches) in the estimation of IPW using a survival model. Based on two vectors defining if treatment starts, is continued, is stopped or if no treatment on the time interval.
drawTttSequence(x = seqx, returnType = "init")
x |
a treatment sequence (made of 0 and 1) |
returnType |
define which vector to return (init of term) |
init takes values of 1 (treatment started), 0 (no treatment) or NA (if term is non missing) ; term takes values of 1 (treatment stopped), 0 (treatment continuation) or NA (if init is non missing)
vector
JuG
seqx <- c(1,1,1,0,0,1,1,0,1,1)
seqx <- c(0, 1, 0, 0, 1, 1, 1, 1)
seqx <- c(0,0,0,0,0)
seqx <- c(1,1,1,1,1)
init <- drawTttSequence(x = seqx, returnType = "init")
term <- drawTttSequence(x = seqx, returnType = "term")
rbind(seqx, init, term)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.