confint.survtmle: confint.survtmle

View source: R/utils.R

confint.survtmleR Documentation

confint.survtmle

Description

Computes confidence intervals for a fitted survtmle object.

Usage

## S3 method for class 'survtmle'
confint(object, parm = seq_along(object$est), level = 0.95, ...)

Arguments

object

An object of class survtmle.

parm

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

level

The confidence level requested.

...

Other arguments. Not currently used.

Value

A matrix 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

Examples

# 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
)
# get confidence intervals
ci <- confint(fit)
ci
#

benkeser/survtmle documentation built on Nov. 23, 2023, 4:45 a.m.