Description Usage Arguments Details Value Author(s) References Examples

View source: R/landest_functions.R

Estimates the probability of survival past some specified time and the treatment effect, defined as the difference in survival at the specified time, using inverse probability of treatment weighted (IPTW) Kaplan-Meier estimation

1 2 |

`tl` |
observed event time of primary outcome, equal to min(T, C) where T is the event time and C is the censoring time. |

`dl` |
event indicator, equal to I(T<C) where T is the event time and C is the censoring time. |

`treat` |
treatment indicator, should be 0/1. |

`tt` |
the time of interest, function estimates the probability of survival past this time |

`var` |
TRUE or FALSE; indicates whether variance estimates for the treatment effect and survival in each group are requested, default is FALSE. |

`conf.int` |
TRUE or FALSE; indicates whether 95% confidence intervals for the treatment effect and survival in each group are requested, default is FALSE. |

`ps.weights` |
propensity score (or inverse probability of treatment) weights |

`weight.perturb` |
a (n1+n0) by x matrix of weights where n1 = length of tl for treatment group 1 and n0 = length of tl for treatment group 0; used for perturbation-resampling, default is null. If var or conf.int is TRUE and weight.perturb is not provided, the function generates exponential(1) weights. |

`perturb.ps` |
TRUE or FALSE indicating whether the weight.perturb matrix includes the perturbed propensity score (or inverse probability of treatment) weights; if cov.for.ps is supplied instead of ps.weights, this is forced to be TRUE. |

`cov.for.ps` |
matrix of covariates to be used to estimate propensity score (or inverse probability of treatment) weights; either ps.weights or cov.for.ps must be supplied. |

Let *T_{Li}* denote the time of the primary event of interest for person *i*, *C_i* denote the censoring time, *Z_{i}* denote the vector of baseline (pretreatment) covariates, and *G_i* be the treatment group indicator such that *G_i = 1* indicates treatment and *G_i = 0* indicates control. Due to censoring, we observe *X_{Li}= min(T_{Li}, C_{i})* and *δ_{Li} = I(T_{Li}≤q C_{i})*. This function estimates survival at time t within each treatment group, *S_j(t) = P(T_{L} > t | G = j)* for *j = 1,0* and the treatment effect defined as *Δ(t) = S_1(t) - S_0(t)*.

The inverse probability of treatment weighted (IPTW) Kaplan-Meier (KM) estimate of survival at time t for each treatment group is

* \hat{S}_{IPTW,KM, j}(t) =
∏ _{t_{kj} ≤q t} ≤ft [1-\frac{d_{kj}^w}{y_{kj}^w}\right ] \mbox{ if } t≥q t_{1j}, \mbox{ or }
1 \mbox{ if } t<t_{1j}*

where *t_{1j},...,t_{Dj}* are the distinct observed event times of the primary outcome in treatment group j, *d_{kj}^w = ∑_{i: X_{Li} = t_{kj}, δ_{Li} = 1} {\hat{W}_j(Z_i)}^{-1}δ_{Li} I(G_i = j)* and *y_{kj}^w = ∑_{i: X_{Li} ≥q t_{kj}} {\hat{W}_j(Z_i)}^{-1} I(G_i = j), W_j(Z_i) = {P(G_{i} = j | Z_i)}*, and *\hat{W}_j(Z_i)* is the estimated propensity score (see ps.wgt.fun for more information). The IPTW KM estimate of treatment effect at time t is *\hat{Δ}_{IPTW,KM}(t) = \hat{S}_{IPTW,KM, 1}(t) - \hat{S}_{IPTW,KM, 0}(t)*.

To obtain variance estimates and construct confidence intervals, we use a perturbation-resampling method. Specifically, let *\{V^{(b)}=(V_1^{(b)}, . . . ,V_n^{(b)})^{T}, b=1,...B\}* be
*n\times B* independent copies of a positive random variable U from a known distribution with unit mean and unit variance such as an Exp(1) distribution. To estimate the variance of our estimates, we appropriately weight the estimates using these perturbation weights to obtain perturbed values: *\hat{S}_{IPTW,KM,0} (t)^{(b)}*, *\hat{S}_{IPTW,KM,1} (t)^{(b)}*, and *\hat{Δ}_{IPTW,KM} (t)^{(b)}, b=1,...B*. We then estimate the variance of each estimate as the empirical variance of the perturbed quantities. To construct confidence intervals, one can either use the empirical percentiles of the perturbed samples or a normal approximation.

A list is returned:

`S.estimate.1` |
the estimate of survival at the time of interest for treatment group 1, |

`S.estimate.0` |
the estimate of survival at the time of interest for treatment group 0, |

`delta.estimate` |
the estimate of treatment effect at the time of interest |

`S.var.1 ` |
the variance estimate of |

`S.var.0 ` |
the variance estimate of |

`delta.var` |
the variance estimate of |

`p.value` |
the p-value from testing |

`conf.int.normal.S.1` |
a vector of size 2; the 95% confidence interval for |

`conf.int.normal.S.0` |
a vector of size 2; the 95% confidence interval for |

`conf.int.normal.delta` |
a vector of size 2; the 95% confidence interval for |

`conf.int.quantile.S.1` |
a vector of size 2; the 95% confidence interval for |

`conf.int.quantile.S.0` |
a vector of size 2; the 95% confidence interval for |

`conf.int.quantile.delta` |
a vector of size 2; the 95% confidence interval for |

Layla Parast

Xie, J., & Liu, C. (2005). Adjusted Kaplan-Meier estimator and log-rank test with inverse probability of treatment weighting for survival data. Statistics in Medicine, 24(20), 3089-3110.

Rosenbaum, P. R., & Rubin, D. B. (1983). The central role of the propensity score in observational studies for causal effects. Biometrika, 70(1), 41-55.

Rosenbaum, P. R., & Rubin, D. B. (1984). Reducing bias in observational studies using subclassification on the propensity score. Journal of the American Statistical Association, 79(387), 516-524.

1 2 3 4 5 6 | ```
data(example_obs)
W.weight = ps.wgt.fun(treat = example_obs$treat, cov.for.ps = as.matrix(example_obs$Z))
delta.iptw.km(tl=example_obs$TL, dl = example_obs$DL, treat = example_obs$treat, tt=2,
ps.weights = W.weight)
delta.iptw.km(tl=example_obs$TL, dl = example_obs$DL, treat = example_obs$treat, tt=2,
cov.for.ps = as.matrix(example_obs$Z))
``` |

```
$S.estimate.1
[1] 0.4781018
$S.estimate.0
[1] 0.4211204
$delta.estimate
[1] 0.05698143
$S.estimate.1
[1] 0.4781018
$S.estimate.0
[1] 0.4211204
$delta.estimate
[1] 0.05698143
```

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.