View source: R/Functions_Rsurrogate.R
delta.surv.estimate | R Documentation |
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.
delta.surv.estimate(xone, xzero, deltaone, deltazero, t, var = FALSE, conf.int = FALSE, weight = NULL, weight.perturb = NULL, approx = T)
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 n_1+n_0 by x matrix of weights where n_1 = sample size in treatment group and n_0 = sample size in the control group, default is null; generally not supplied by use but only used by other functions. |
weight.perturb |
a n_1+n_0 by x matrix of weights where n_1 =sample size in treatment group and n_0 = 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. |
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,
Δ(t)=E\{ I(T^{(1)}>t)\} - E\{I(T^{(0)}>t)\} = P(T^{(1)}>t) - P(T^{(0)}>t)
where t>t_0
Due to censoring, our data consist of n_1 observations \{(X_{1i}, δ_{1i}), i=1,...,n_1\} from the treatment group G=1 and n_0 observations \{(X_{0i}, δ_{0i}), i=1,...,n_0\} from the control group G=0 where X_{gi} = \min(T_{gi}, C_{ gi}), δ_{gi} = I(T_{gi} < C_{gi}), and C_{gi} denotes the censoring time for g= 1,0, for individual i. Throughout, we estimate the treatment effect Δ(t) as
\hat{Δ}(t) = n_1^{-1} ∑_{i=1}^{n_1} \frac{I(X_{1i}>t)}{\hat{W}^C_1(t)} - n_0^{-1} ∑_{i=1}^{n_0} \frac{I(X_{0i}>t)}{\hat{W}^C_0(t)}
where \hat{W}^C_g(\cdot) 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 ≤ft \{ V^{(b)} = (V_{11}^{(b)}, ...V_{1n_1}^{(b)}, V_{01}^{(b)}, ...V_{0n_0}^{(b)})^T, b=1,....,D \right \} be n \times D independent copies of a positive random variables V from a known distribution with unit mean and unit variance. Let
\hat{Δ}^{(b)} (t) = \frac{ ∑_{i=1}^{n_1} V_{1i}^{(b)} I(X_{1i}>t)}{ ∑_{i=1}^{n_1} V_{1i}^{(b)} \hat{W}_1^{C(b)}(t)} -\frac{ ∑_{i=1}^{n_0} V_{0i}^{(b)} I(X_{0i}>t)}{ ∑_{i=1}^{n_0} V_{0i}^{(b)} \hat{W}_0^{C(b)}(t)}.
In this package, we use weights generated from an Exponential(1) distribution and use D=500. The variance of \hat{Δ}(t) is obtained as the empirical variance of \{\hat{Δ}(t)^{(b)}, b = 1,...,D\}. We construct two versions of the 95\%confidence interval for \hat{Δ}(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 \hat{Δ}(t)^{(b)}.
A list is returned:
delta |
the estimate, \hat{Δ}(t), described above. |
var |
the variance estimate of \hat{Δ}(t); if var = TRUE or conf.int = TRUE. |
conf.int.normal |
a vector of size 2; the 95% confidence interval for \hat{Δ}(t) based on a normal approximation; if conf.int = TRUE. |
conf.int.quantile |
a vector of size 2; the 95% confidence interval for \hat{Δ}(t) based on sample quantiles of the perturbed values, described above; if conf.int = TRUE. |
Layla Parast
data(d_example_surv) names(d_example_surv) delta.surv.estimate(xone = d_example_surv$x1, xzero = d_example_surv$x0, deltaone = d_example_surv$delta1, deltazero = d_example_surv$delta0, t = 3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.