This function returns a ggplot derived from an rpsftm object showing exposure to randomized and switch treatment over time. It assumes that only a single switch in treatment occurs i.e. a patient who is randomized to control but has 25 percents exposure to experimental is assumed to have switched at 0.75 times the event time.

ggexposure(x)

Arguments

x

rpsftm object (rpsftm)

Examples

# use data included in rpsftm package
library(rpsftm)
immdef <- rpsftm::immdef
immdef$rx <- with(immdef, 1 - xoyrs/progyrs)

# fit the model
imm.fit <- rpsftm(Surv(progyrs, prog) ~ rand(imm, rx),
                  data=immdef,
                  censor_time=censyrs)

ggexposure(imm.fit)