Learn R Programming

DTRreg (version 1.7)

confint: Flexible Confidence Interval Calculations for DTRs

Description

Confidence intervals for dWOLS or DWSurv parameters, with the possibility of deriving constructing the confidence intervals using the percentile method when bootstrap is used (DWSurv only).

Usage

# S3 method for DTRreg
confint(object, parm = NULL, level = 0.95, type = "se", ...)

Value

A list with columns giving lower and upper confidence limits for each parameter. These will be labelled as (1-level)/2 and 1 - (1-level)/2 in

Arguments

object

A model object generated by the function DTRreg.

type

Typical Wald-type confidence interval "se" (default) or confidence intervals derived with the percentile method "percentile" (currently available with dWSurv only).

parm

Not available for DTRreg objects.

level

the confidence level required.

...

Space for additional arguments (not currently used by DTRreg).

Author

Gabrielle Simoneau

References

Simoneau G, Moodie EE, Wallace MP, Platt RW. Optimal dynamic treatment regimes with survival endpoints: introducing DWSurv in the R package DTRreg. Journal of Statistical Computation and Simulation. 2020 Jul 16:1-8.

Examples

Run this code
##################
# simulate data
expit <- function(x) exp(x) / (1 + exp(x))
theta1 <- c(4.7, 1.5, -0.8, 0.1, 0.1)
n <- 100
X1 <- runif(n, 0.1, 1.29) 
X12 <- rbinom(n, 1, 0.4)
A1 <- rbinom(n, 1, expit(2*X1 - 1))
delta <- rbinom(n, 1, expit(3*X12 + 0.1))
logT <- theta1[1] + theta1[2]*X1[delta == 1] + theta1[3]*X12[delta == 1] + 
theta1[4]*A1[delta == 1] + theta1[5]*A1[delta == 1]*X1[delta == 1] + 
rnorm(sum(delta), sd = 0.3)

C <- rexp(n - sum(delta), rate = 1/300)
Y <- rep(NA, n)
Y[delta == 1] <- exp(logT)
Y[delta == 0] <- C

dataset <- data.frame(X1, X12, A1, delta, Y)

model <- DWSurv(time = list(~Y), blip.mod = list(~X1), treat.mod = list(A1~X1), 
tf.mod = list(~X1 + X12), cens.mod = list(delta~X12), data = dataset, var.estim = "bootstrap", 
boot.opt = "standard", B = 200)
confint(model, type = "percentile")
#################

Run the code above in your browser using DataLab