View source: R/landest_functions.R
surv.iptw.km | R Documentation |
Estimates the probability of survival past some specified time using inverse probability of treatment weighted (IPTW) Kaplan-Meier estimation
surv.iptw.km(tl, dl, tt, var = FALSE, conf.int = FALSE, ps.weights,
weight.perturb = NULL,perturb.ps = FALSE, perturb.vector = FALSE)
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. |
tt |
the time of interest, function estimates the probability of survival past this time |
var |
TRUE or FALSE; indicates whether a variance estimate for survival is requested, default is FALSE. |
conf.int |
TRUE or FALSE; indicates whether a 95% confidence interval for survival is requested, default is FALSE. |
ps.weights |
propensity score (or inverse probability of treatment) weights |
weight.perturb |
a n by x matrix of weights where n = length of tl; 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 |
perturb.vector |
TRUE or FALSE; indicates whether a vector of the perturbed values of the survival estimate is requested, default is FALSE. This argument is ignored if both var and conf.int are FALSE. |
See documentation for delta.iptw.km for details.
A list is returned:
S.estimate |
the estimate of survival at the time of interest, |
S.var |
the variance estimate of |
conf.int.normal.S |
a vector of size 2; the 95% confidence interval for |
conf.int.quantile.S |
a vector of size 2; the 95% confidence interval for |
perturb.vector |
a vector of size x where x is the number of columns of the provided weight.perturb matrix (or x=500 if weight.perturb is not provided); the perturbed values of |
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.
data(example_obs)
W.weight = ps.wgt.fun(treat = example_obs$treat, cov.for.ps = as.matrix(example_obs$Z))
example_obs.treat = example_obs[example_obs$treat == 1,]
surv.iptw.km(tl=example_obs.treat$TL, dl = example_obs.treat$DL, tt=2, ps.weights =
W.weight[example_obs$treat == 1])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.