confint.tp.survtmle: confint.tp.survtmle

Description Usage Arguments Value Examples

View source: R/utils.R

Description

Computes confidence intervals for a fitted tp.survtmle object.

Usage

1
2
## S3 method for class 'tp.survtmle'
confint(object, parm, level = 0.95, ...)

Arguments

object

An object of class tp.survtmle, as produced by invoking the function timepoints on an object produced by survtmle, for which a confidence interval is to be computed.

parm

A numeric vector indicating which indexes of object$est to return confidence intervals for (default is to return all). NOT USED NOW.

level

A numeric indicating the level of the confidence interval to be computed.

...

Other arguments. Not currently used.

Value

A list of matrices, each with columns giving the lower and upper confidence limits for each parameter. These will be labeled as (1-level)/2 and 1 - (1-level)/2 in percent. The default is 2.5 contains as many matrices as their are comparison groups in the input data.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
# simulate data
set.seed(1234)
n <- 100
ftime <- round(runif(n, 1, 4))
ftype <- round(runif(n, 0, 2))
trt <- rbinom(n, 1, 0.5)
adjustVars <- data.frame(W1 = rnorm(n), W2 = rnorm(n))

# fit a survtmle object
fit <- survtmle(ftime = ftime, ftype = ftype, trt = trt,
                adjustVars = adjustVars, glm.trt = "W1 + W2",
                glm.ftime = "trt + W1 + W2", glm.ctime = "trt + W1 + W2",
                method = "mean", t0 = 4)
# extract cumulative incidence at each timepoint
tpfit <- timepoints(fit, times = seq_len(4))
# get confidence intervals
ci <- confint(tpfit)
ci

survtmle documentation built on May 2, 2019, 9:44 a.m.