tprob: Nonparametric estimation of transition probabilities in the...

Description Usage Arguments Details Value Author(s) References Examples

View source: R/tprob.R

Description

This function is used to obtain nonparametric estimates of the transition probabilities in the illness-death model.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
tprob(
  formula,
  s,
  method = "AJ",
  conf = FALSE,
  conf.level = 0.95,
  conf.type = "log",
  n.boot = 199,
  data,
  z.value,
  bw = "dpik",
  window = "gaussian",
  method.weights = "NW",
  cluster = FALSE,
  ncores = NULL,
  na.rm = TRUE
)

Arguments

formula

A formula object, which must have a survIDM object as the response on the left of the ~ operator and, if desired, a term on the right. The term may be a qualitative or quantitative variable. Without covariates, the right hand side should be ~ 1.

s

The first time for obtaining estimates for the transition probabilities. If missing, 0 will be used.

method

The method used to compute the transition probabilities. Possible options are "AJ", "LIDA" "LM", "PLM", "LMAJ", "PLMAJ", "PAJ", "IPCW" and "breslow". Defaults to "AJ". The "IPCW" method is recommended to obtain conditional transition probabilities (i.e., with a quantitative term on the right hand side of formula). The "breslow" method is based on a Cox's regression model (Cox, 1972) fitted marginally to each allowed transition, with the corresponding baseline hazard function estimated by the Breslow's method (Breslow, 1972).

conf

Provides pointwise confidence bands. Defaults to FALSE.

conf.level

Level of confidence. Defaults to 0.95 (corresponding to 95%).

conf.type

Method to compute the confidence intervals. Depends on the choice of the estimation method of the transition probabilities. For Aalen-Johansen type estimators ("AJ", "LMAJ", "PAJ" and "PLMAJ") possible choices are "linear", "log" and "log-log". Default method is "log". The "linear" option provides the standard intervals curve +-k *se(curve), where k is determined from "conf.int". The "log" option calculates the intervals based on the cumulative hazard or -log(survival). The "log-log" option uses the log hazard function or log(-log(survival)). For the remaining estimation methods ("LIDA", "LM", "PLM", "IPCW" and "breslow") the percentile bootstrap which resamples each datum with probability 1/n is used.

n.boot

The number of bootstrap replicates to compute the variance of the non-Markovian estimator. Default is 199.

data

A data.frame including at least four columns named time1, event1, Stime and event, which correspond to disease free survival time, disease free survival indicator, time to death or censoring, and death indicator, respectively.

z.value

The value of the covariate on the right hand side of formula at which the transition probabilities are computed. For quantitative covariates, i.e. of class integer and numeric.

bw

A single numeric value to compute a kernel density bandwidth. Use "dpik" for the KernSmooth package based selector or "np" for the 'npudensbw' function of the np package.

window

A character string specifying the desired kernel. See details below for possible options. Defaults to "gaussian" where the gaussian density kernel will be used.

method.weights

A character string specifying the desired weights method. Possible options are "NW" for the Nadaraya-Watson weights and "LL" for local linear weights. Defaults to "NW".

cluster

A logical value. If TRUE (default), the bootstrap procedure for the confidence intervals is parallelized. Note that there are cases (e.g., a low number of bootstrap repetitions) that R will gain in performance through serial computation. R takes time to distribute tasks across the processors also it will need time for binding them all together later on. Therefore, if the time for distributing and gathering pieces together is greater than the time need for single-thread computing, it does not worth parallelize.

ncores

An integer value specifying the number of cores to be used in the parallelized procedure. If NULL (default), the number of cores to be used is equal to the number of cores of the machine - 1.

na.rm

A logical value indicating whether NA values should be stripped in the computation.

Details

Possible options for argument window are "gaussian", "epanechnikov", "tricube", "boxcar", "triangular", "quartic" or "cosine". The LIDA estimator was labelled according to the acronym of the Lifetime Data Analysis journal in which the estimator was described for the first time (Meira-Machado, U?a-?lvarez and Cadarso-Su?rez, 2006).

Possible methods are:

Value

An object of class "survIDM" and one of the following five classes: "AJ", "LIDA", "LM", "PLM", "LMAJ", "PLMAJ", "PAJ", "tpIPCW" and "tpBreslow". Objects are implemented as a list with elements:

est

data.frame with estimates of the transition probabilities.

CI

data.frame with the confidence intervals of the transition probabilities.

conf.level

Level of confidence.

s

The first time for obtaining estimates for the transition probabilities.

t

The time for obtaining the estimates of transition probabilities.

conf

logical; if FALSE (default) the pointwise confidence bands are not given.

conf.type

Type of the confidence interval.

callp

The expression of the estimated probability.

Nlevels

The number of levels of the covariate. Provides important information when the covariate at the right hand side of formula is of class factor.

levels

The levels of the qualitative covariate (if it is of class factor) on the right hand side of formula.

formula

A formula object.

call

A call object.

Author(s)

Luis Meira-Machado, Marta Sestelo and Gustavo Soutinho.

References

Aalen O. O., Johansen S. (1978) An Empirical Transition Matrix for Nonhomogeneous Markov Chains Based on Censored Observations. Scandinavian Journal of Statistics 5(3), 141–150.

Meira-Machado L. F., de Una-Alvarez J. and Cadarso-Suarez C. (2006). Nonparametric estimation of transition probabilities in a non-Markov illness-death model. Lifetime Data Anal 12(3), 325–344.

de Una-Alvarez J. and Meira-Machado L. (2015). Nonparametric estimation of transition probabilities in a non-Markov illness-death model: a comparative study. Biometrics 71, 364–375.

Cox, DR (1972). Regression models and life tables (with discussion). Journal of the Royal Statistical Society, Series B 34, 187-200.

Breslow, N. (1972). Discussion of paper by dr cox. Journal of Royal Statistical Society, Series B 34, 216-217.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
## Not run: 
# Aalen-Johansen
res <- tprob(survIDM(time1, event1, Stime, event) ~ 1, s = 0,
method = "AJ", conf = FALSE, data = colonIDM)
summary(res, time=365*1:6)
plot(res)
# Transition Probabilities Pij(t)=Pij(365,t)
# LIDA
res1 <- tprob(survIDM(time1, event1, Stime, event) ~ 1, s = 365,
             method = "LIDA", conf = FALSE, data = colonIDM)

summary(res1, time=365*1:6)
plot(res1)
plot(res1, trans="01", ylim=c(0,0.15))
# Landmark (LM)
res2 <- tprob(survIDM(time1, event1, Stime, event) ~ 1, s = 365,
              method = "LM", conf = FALSE, data = colonIDM)
summary(res2, time=365*1:6)
plot(res2)
# Presmoothed LM
res3 <- tprob(survIDM(time1, event1, Stime, event) ~ 1, s = 365,
              method = "PLM", conf = TRUE, data = colonIDM)
summary(res3, time=365*1:6)
autoplot(res3, interactive = TRUE)
# Conditional transition probabilities
# With factor
res4 <- tprob(survIDM(time1, event1, Stime, event) ~ factor(sex), s = 365,
              method = "AJ", conf = TRUE, data = colonIDM)
summary(res4, time=365*1:6)
plot(res4, trans="02", ylim=c(0,0.5))
res5 <- tprob(survIDM(time1, event1, Stime, event) ~ rx, s =365,
              method = "breslow", z.value='Lev', conf = TRUE, data =colonIDM)
summary(res5, time=365*1:6)
plot(res5,trans="02", ylim=c(0,0.5))
# with continuous covariate (IPCW and Breslow Method)
res6 <- tprob(survIDM(time1, event1, Stime, event) ~ age, s = 365,
              method = "IPCW", z.value = 48, conf = FALSE, data = colonIDM,
              bw = "dpik", window = "gaussian", method.weights = "NW")
summary(res6, time=365*1:6)
plot(res6)
res7 <- tprob(survIDM(time1, event1, Stime, event) ~ age, s =365,
              method = "breslow", z.value=60, conf = FALSE, data =colonIDM)
summary(res7, time=365*1:6)
autoplot(res7, interactive=TRUE)
res8 <- tprob(survIDM(time1, event1, Stime, event) ~ age, s =365,
              method = "breslow", conf.type='bootstrap', z.value=60, conf = TRUE, data =colonIDM)
summary(res8, time=365*1:6)
plot(res8)
res9 <- tprob(survIDM(time1, event1, Stime, event) ~ rx, s =365,
              method = "breslow", conf.type='bootstrap',  conf = TRUE, data =colonIDM)
summary(res9, time=365*1:6)
plot(res9, trans="02", ylim=c(0,0.5))
# more than a covariate (Breslow Method)
res10<- tprob(survIDM(time1, event1, Stime, event) ~ nodes + factor(rx), s =365,
              method = "breslow", conf = TRUE, data =colonIDM)
summary(res10,t=365*1:5)
autoplot(res10)
res11<- tprob(survIDM(time1, event1, Stime, event) ~ nodes + factor(rx), s =365,
              method = "breslow", z.value=c(10,'Obs'), conf = TRUE, data =colonIDM)
summary(res11,t=365*1:5)
autoplot(res11)
# more than a covariate for Non Linear Models (Breslow Method)
res12<- tprob(survIDM(time1, event1, Stime, event) ~ pspline(age)+ nodes + factor(rx), s =365,
              method = "breslow", conf = TRUE, data =colonIDM)
summary(res12,t=365*1:5)
autoplot(res12)
# Confidence intervals
res13 <- tprob(survIDM(time1, event1, Stime, event) ~ 1, s = 365,
               method = "AJ", conf = TRUE, n.boot = 5, conf.level = 0.95,
               conf.type = "log", data = colonIDM)
summary(res13, time=365*1:7)
autoplot(res13)

## End(Not run)

sestelo/idmsurv documentation built on June 29, 2021, 3:04 p.m.