Learn R Programming

SurrogateTest (version 1.3)

delta.estimate: Calculates the treatment effect, the difference in survival at time t

Description

This function calculates the treatment effect in the survival setting i.e. the difference in survival at time t between the treatment group and the control group. The inverse probability of censoring weighted estimate of survival within each treatment group is used; there is an option to use the Kaplan-Meier estimate instead. This function is generally not expected to be used directly by the user, it is called by the recover.B function.

Usage

delta.estimate(xone, xzero, deltaone, deltazero, t, weight = NULL, KM = FALSE)

Arguments

xone

numeric vector, the observed event times in the treatment group, X = min(T,C) where T is the time of the primary outcome and C is the censoring time.

xzero

numeric vector, the observed event times in the control group, X = min(T,C) where T is the time of the primary outcome and C is the censoring time.

deltaone

numeric vector, the event indicators for the treatment group, D = I(T<C) where T is the time of the primary outcome and C is the censoring time.

deltazero

numeric vector, the event indicators for the control group, D = I(T<C) where T is the time of the primary outcome and C is the censoring time.

t

the time of interest.

weight

a \(n_1+n_0\) by \(x\) matrix of weights where \(n_1 =\) sample size in the treatment group and \(n_0 =\) sample size in the control group, default is null; generally not supplied by user, only used by other functions.

KM

true or false, indicating whether the Kaplan-Meier estimate of survival should be used instead of the inverse probability of censoring weighted estimate

Value

the difference in survival at time t (treatment group minus control group)

Examples

Run this code
# NOT RUN {
data(dataA)
delta.estimate(xone = dataA$x1, xzero = dataA$x0, deltaone = dataA$delta1, deltazero = 
dataA$delta0, t=1)

delta.estimate(xone = dataA$x1, xzero = dataA$x0, deltaone = dataA$delta1, deltazero = 
dataA$delta0, t=0.5)

# }

Run the code above in your browser using DataLab