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 user can also request a variance estimate, estimated using perturbating-resampling, and a 95% confidence interval. If a confidence interval is requested two versions are provided: a normal approximation based interval and a quantile based interval, both use perturbation-resampling.
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.
var: TRUE or FALSE; indicates whether a variance estimate for delta is requested, default is FALSE.
conf.int: TRUE or FALSE; indicates whether a 95% confidence interval for delta is requested, default is FALSE.
weight: a n1+n0 by x matrix of weights where n1= sample size in treatment group and n0= sample size in the control group, default is null; generally not supplied by use but only used by other functions.
weight.perturb: a n1+n0 by x matrix of weights where n1=sample size in treatment group and n0= sample size in the control group, default is null; generally used for confidence interval construction and may be supplied by user.
approx: TRUE or FALSE indicating whether an approximation should be used when calculating the probability of censoring; most relevant in settings where the survival time of interest for the primary outcome is greater than the last observed event but before the last censored case, default is TRUE.
Details
Let G be the binary treatment indicator with G=1 for treatment and G=0 for control and we assume throughout that subjects are randomly assigned to a treatment group at baseline. Let T denote the time of the primary outcome of interest, death for example. We use potential outcomes notation such that T(g) denotes the time of the primary outcome under treatment G=g. We define the treatment effect, Δ(t), as the difference in survival rates by time t under treatment versus control,
Due to censoring, our data consist of n1 observations {(X1i,δ1i),i=1,...,n1} from the treatment group G=1 and n0 observations {(X0i,δ0i),i=1,...,n0} from the control group G=0 where Xgi=min(Tgi,Cgi), δgi=I(Tgi<Cgi), and Cgi denotes the censoring time for g=1,0, for individual i. Throughout, we estimate the treatment effect Δ(t) as
where W^gC(⋅) is the Kaplan-Meier estimator of survival for censoring for g=1,0.
Variance estimation and confidence interval construction are performed using perturbation-resampling. Specifically, let {V(b)=(V11(b),...V1n1(b),V01(b),...V0n0(b))T,b=1,....,D} be n×D independent copies of a positive random variables V from a known distribution with unit mean and unit variance. Let
In this package, we use weights generated from an Exponential(1) distribution and use D=500. The variance of Δ^(t) is obtained as the empirical variance of {Δ^(t)(b),b=1,...,D}. We construct two versions of the 95%confidence interval for Δ^(t): one based on a normal approximation confidence interval using the estimated variance and another taking the 2.5th and 97.5th empirical percentiles of Δ^(t)(b).
Returns
A list is returned: - delta: the estimate, Δ^(t), described above.
var: the variance estimate of Δ^(t); if var = TRUE or conf.int = TRUE.
conf.int.normal: a vector of size 2; the 95% confidence interval for Δ^(t) based on a normal approximation; if conf.int = TRUE.
conf.int.quantile: a vector of size 2; the 95% confidence interval for Δ^(t) based on sample quantiles of the perturbed values, described above; if conf.int = TRUE.