Description Usage Arguments Value Examples
Step function plots for both raw and smoothed (monotonic) estimates, the latter by isotonic regression of the raw estimates, of cumulative incidence.
1 2 3 |
x |
object of class |
... |
additional arguments passed |
type |
|
pal |
A |
object of class ggplot
containing a step function plot of the
raw or smoothened point estimates of cumulative incidence across a series of
timepoints of interest.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | library(survtmle)
set.seed(341796)
n <- 100
t_0 <- 10
W <- data.frame(W1 = runif(n), W2 = rbinom(n, 1, 0.5))
A <- rbinom(n, 1, 0.5)
T <- rgeom(n,plogis(-4 + W$W1 * W$W2 - A)) + 1
C <- rgeom(n, plogis(-6 + W$W1)) + 1
ftime <- pmin(T, C)
ftype <- as.numeric(ftime == T)
suppressWarnings(
fit <- survtmle(ftime = ftime, ftype = ftype,
adjustVars = W, glm.ftime = "I(W1*W2) + trt + t",
trt = A, glm.ctime = "W1 + t", method = "hazard",
verbose = TRUE, t0 = t_0, maxIter = 2)
)
tpfit <- timepoints(fit, times = seq_len(t_0))
plot(tpfit)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.