Title: | Nonparametric Estimation of the Distribution of Gap Times for Recurrent Events |
---|---|
Description: | Provides estimates for the bivariate and trivariate distribution functions and bivariate and trivariate survival functions for censored gap times. Two approaches, using existing methodologies, are considered: (i) the Lin's estimator, which is based on the extension the Kaplan-Meier estimator of the distribution function for the first event time and the Inverse Probability of Censoring Weights for the second time (Lin DY, Sun W, Ying Z (1999) <doi:10.1093/biomet/86.1.59> and (ii) another estimator based on Kaplan-Meier weights (Una-Alvarez J, Meira-Machado L (2008) <https://w3.math.uminho.pt/~lmachado/Biometria_conference.pdf>). The proposed methods are the landmark estimators based on subsampling approach, and the estimator based on weighted cumulative hazard estimator. The package also provides nonparametric estimator conditional to a given continuous covariate. All these methods have been submitted to be published. |
Authors: | Gustavo Soutinho [aut, cre]
|
Maintainer: | Gustavo Soutinho <[email protected]> |
License: | GPL-3 |
Version: | 1.1 |
Built: | 2025-03-07 03:48:51 UTC |
Source: | https://github.com/cran/survivalREC |
b3 data set.
data("b3")
data("b3")
A data frame with 85 observations on the following 4 variables. Below a brief description is given for each of these variables.
First time or censoring time.
The total time of the process.
Indicator of the first time; 0 if the first time is censored and 1 otherwise.
Censoring indicator of the survival time of the process; 0 if the total time is censored and 1 otherwise.
data(b3) head(b3)
data(b3) head(b3)
b3size data set.
data("b3size")
data("b3size")
A data frame with 85 observations on the following 5 variables. Below a brief description is given for each of these variables.
First time or censoring time.
The total time of the process
Indicator of the first time; 0 if the first time is censored and 1 otherwise.
Censoring indicator of the survival time of the process; 0 if the total time is censored and 1 otherwise.
Values of covariate size.
data(b3size)
data(b3size)
b3state data set.
data("b3state")
data("b3state")
A data frame with 85 observations on the following 4 variables. Below a brief description is given for each of these variables.
First time or censoring time.
The total time of the process.
Indicator of the first time; 0 if the first time is censored and 1 otherwise.
Censoring indicator of the survival time of the process; 0 if the total time is censored and 1 otherwise.
data(b3state) str(b3state)
data(b3state) str(b3state)
b3state2 data set
data("b3state2")
data("b3state2")
A data frame with 85 observations on the following 5 variables. Below a brief description is given for each of these variables.
First time or censoring time.
The total time of the process
Indicator of the first time; 0 if the first time is censored and 1 otherwise.
Censoring indicator of the survival time of the process; 0 if the total time is censored and 1 otherwise.
Values of covariate size.
data(b3state2) str(b3state2)
data(b3state2) str(b3state2)
b4 data set.
data("b4")
data("b4")
A data frame with 85 observations on the following 6 variables. Below a brief description is given for each of these variables.
First time or censoring time.
Second time.
The total time of the process
Indicator of the first time; 0 if the first time is censored and 1 otherwise.
Indicator of the second time; 0 if the first time is censored and 1 otherwise.
Censoring indicator of the survival time of the process; 0 if the total time is censored and 1 otherwise.
data(b4) head(b4)
data(b4) head(b4)
b4state data set.
data("b4state")
data("b4state")
A data frame with 85 observations on the following 6 variables. Below a brief description is given for each of these variables.
First time or censoring time.
Second time.
The total time of the process
Indicator of the first time; 0 if the first time is censored and 1 otherwise.
Indicator of the second time; 0 if the first time is censored and 1 otherwise.
Censoring indicator of the survival time of the process; 0 if the total time is censored and 1 otherwise.
data(b4state) ## maybe str(b4state) ; plot(b4state) ...
data(b4state) ## maybe str(b4state) ; plot(b4state) ...
Computes the conditional survival probability P(T > y|Z = z)
Beran(time, status, covariate, delta, x, y, kernel = "gaussian", bw, lower.tail = FALSE)
Beran(time, status, covariate, delta, x, y, kernel = "gaussian", bw, lower.tail = FALSE)
time |
The survival time of the process. |
status |
Censoring indicator of the total time of the process; 0 if the total time is censored and 1 otherwise. |
covariate |
Covariate values for obtaining estimates for the conditional probabilities. |
delta |
Censoring indicator of the covariate. |
x |
The first time (or covariate value) for obtaining estimates for the conditional probabilities. If missing, 0 will be used. |
y |
The total time for obtaining estimates for the conditional probabilities. |
kernel |
A character string specifying the desired kernel. See details below for possible options. Defaults to "gaussian" where the gaussian density kernel will be used. |
bw |
A single numeric value to compute a kernel density bandwidth. |
lower.tail |
logical; if FALSE (default), probabilities are P(T > y|Z = z) otherwise, P(T <= y|Z = z). |
Possible options for argument window are "gaussian", "epanechnikov", "tricube", "boxcar", "triangular", "quartic" or "cosine"
Vector with the estimation of the conditional distribution function of the response, given the covariate under random censoring.
Gustavo Soutinho and Luis Meira-Machado
R. Beran. Nonparametric regression with randomly censored survival data. Technical report, University of California, Berkeley, 1981.
data("bladder4state") b3state<-multidf(gap1=bladder4state$y1, event1=bladder4state$d1, gap2=bladder4state$y2, status=bladder4state$d2, size=bladder4state$size) head(b3state[[1]]) ##P(T>y|size=3) library(KernSmooth) obj0 <- b3state[[1]] h <- dpik(obj0$size) Beran(time = obj0$time, status = obj0$status, covariate =obj0$size, x = 3, y = 50, bw = h) ##P(T<=y|size=3) Beran(time = obj0$time, status = obj0$status, covariate =obj0$size, x = 3, y = 50, bw = h, lower.tail = TRUE)
data("bladder4state") b3state<-multidf(gap1=bladder4state$y1, event1=bladder4state$d1, gap2=bladder4state$y2, status=bladder4state$d2, size=bladder4state$size) head(b3state[[1]]) ##P(T>y|size=3) library(KernSmooth) obj0 <- b3state[[1]] h <- dpik(obj0$size) Beran(time = obj0$time, status = obj0$status, covariate =obj0$size, x = 3, y = 50, bw = h) ##P(T<=y|size=3) Beran(time = obj0$time, status = obj0$status, covariate =obj0$size, x = 3, y = 50, bw = h, lower.tail = TRUE)
bladder3-description
data("bladder3")
data("bladder3")
A data frame with 85 observations on the following 6 variables.
t1
First time or censoring time.
d1
Indicator of the first time; 0 if the first time is censored and 1 otherwise.
t2
The total time of the process
d2
Censoring indicator of the survival time of the process; 0 if the total time is censored and 1 otherwise.
rx
Values of covariate rx.
size
Values of covariate size.
data(bladder3) str(bladder3)
data(bladder3) str(bladder3)
bladder3state data set.
data("bladder3state")
data("bladder3state")
A data frame with 85 observations on the following 7 variables.
id
Identification number.
y1
First gap time.
d1
Indicator of the first gap time; 0 if the first time is censored and 1 otherwise.
y2
Second gap time.
d2
Censoring indicator of the second gap time; 0 if the total time is censored and 1 otherwise.
rx
Values of covariate rx.
size
Values of covariate size.
data(bladder3state) str(bladder3state)
data(bladder3state) str(bladder3state)
bladder4 data set.
data("bladder4")
data("bladder4")
A data frame with 85 observations on the following 8 variables.
t1
First time or censoring time.
d1
Indicator of the first time; 0 if the first time is censored and 1 otherwise.
t2
Second time or censoring time.
d2
Indicator of the second time; 0 if the first time is censored and 1 otherwise.
t3
The total time of the process.
d3
Censoring indicator of the survival time of the process; 0 if the total time is censored and 1 otherwise.
rx
Values of covariate rx.
size
Values of covariate size.
data(bladder4)
data(bladder4)
bladder4state data set.
data("bladder4state")
data("bladder4state")
A data frame with 85 observations on the following 9 variables.
id
Identification number.
y1
First gap time.
d1
Indicator of the first gap time; 0 if the first time is censored and 1 otherwise.
y2
Second gap time.
d2
Censoring indicator of the second gap time; 0 if the total time is censored and 1 otherwise.
y3
Third gap time.
d3
Censoring indicator of the third gap time; 0 if the total time is censored and 1 otherwise.
rx
Values of covariate rx.
size
Values of covariate size.
data(bladder4state)
data(bladder4state)
bladder5 data set.
data("bladder5")
data("bladder5")
A data frame with 85 observations on the following 10 variables.
t1
First time or censoring time.
d1
Indicator of the first time; 0 if the first time is censored and 1 otherwise.
t2
Second time or censoring time.
d2
Indicator of the second time; 0 if the first time is censored and 1 otherwise.
t3
Third time or censoring time.
d3
Indicator of the third time; 0 if the first time is censored and 1 otherwise.
t4
The total time of the process
d4
Censoring indicator of the survival time of the process; 0 if the total time is censored and 1 otherwise.
rx
Values of covariate rx.
size
Values of covariate size.
data(bladder5)
data(bladder5)
bladder5state data set.
data("bladder5state")
data("bladder5state")
A data frame with 85 observations on the following 11 variables.
id
Identification number.
y1
First gap time.
d1
Indicator of the first gap time; 0 if the first time is censored and 1 otherwise.
y2
Second gap time.
d2
Censoring indicator of the second gap time; 0 if the total time is censored and 1 otherwise.
y3
Third gap time.
d3
Censoring indicator of the third gap time; 0 if the total time is censored and 1 otherwise.
y4
Fourth gap time.
d4
Censoring indicator of the fourth gap time; 0 if the total time is censored and 1 otherwise.
rx
Values of covariate rx.
size
Values of covariate size.
data(bladder5state)
data(bladder5state)
Provides estimates for the bivariate distribution function based on the Inverse Probability of Censoring Weighting estimator (IPCW).
IPCWdf(object, x, y, covariate, cov.value, bw, window = "gaussian")
IPCWdf(object, x, y, covariate, cov.value, bw, window = "gaussian")
object |
An object of class multidf. |
x |
The first time for obtaining estimates for the bivariate distribution function. |
y |
The second time for obtaining estimates for the bivariate distribution function. |
covariate |
Name of the quantitative covariate. |
cov.value |
The value of the quantitative covariate. |
bw |
A single numeric value to compute a kernel density bandwidth. Use
|
window |
A character string specifying the desired kernel. See details
below for possible options. Defaults to |
Vector with the IPWC estimates for the bivariate distribution function.
Gustavo Soutinho and Luis Meira-Machado.
Gustavo Soutinho and Luis Meira-Machado
de Una-Alvarez, J. and Meira-Machado, L. (2008). A simple estimator of the bivariate distribution function for censored gap times, Statistics and Probability Letters 78, 2440-2445.
KMWdf
, LDMdf
, LINdf
and
WCHdf
.
data("bladder4state") b3state<-multidf(gap1=bladder4state$y1, event1=bladder4state$d1, gap2=bladder4state$y2, status=bladder4state$d2, size=bladder4state$size) b3size<-multidf(gap1=bladder3$t1, event1=bladder3$d1, gap2=bladder3$t2-bladder3$t1,status=bladder4state$d2, size=bladder3$size) library(KernSmooth) IPCWdf(object=b3state, x=13, y=15, covariate="size", cov.value=3, window = "gaussian") IPCWdf(object=b3state, x=13, y=15, covariate="size", bw=2, cov.value=3, window = "gaussian") IPCWdf(object=b3size, x=13, y=15, covariate="size", cov.value=3, window = "gaussian") IPCWdf(object=b3size, x=13, y=15, covariate="size", bw=2, cov.value=3, window = "gaussian")
data("bladder4state") b3state<-multidf(gap1=bladder4state$y1, event1=bladder4state$d1, gap2=bladder4state$y2, status=bladder4state$d2, size=bladder4state$size) b3size<-multidf(gap1=bladder3$t1, event1=bladder3$d1, gap2=bladder3$t2-bladder3$t1,status=bladder4state$d2, size=bladder3$size) library(KernSmooth) IPCWdf(object=b3state, x=13, y=15, covariate="size", cov.value=3, window = "gaussian") IPCWdf(object=b3state, x=13, y=15, covariate="size", bw=2, cov.value=3, window = "gaussian") IPCWdf(object=b3size, x=13, y=15, covariate="size", cov.value=3, window = "gaussian") IPCWdf(object=b3size, x=13, y=15, covariate="size", bw=2, cov.value=3, window = "gaussian")
This function provides survival estimates using the product-limit Kaplan-Meier estimator.
KM(time, status, t)
KM(time, status, t)
time |
Survival time of the process. |
status |
Censoring indicator of the survival time of the process; 0 if the survival time is censored and 1 otherwise. |
t |
The time for obtaining survival estimates. |
Vector with Kaplan-Meier estimate of survival.
Gustavo Soutinho and Luis Meira-Machado
E. Kaplan and P. Meier. Nonparametric estimation from incomplete observations. Journal of the American Statistical Association, 53:457-481, 1958.
require(survival) data("bladder4state") obj<- multidf(gap1=bladder4state$y1, event1=bladder4state$d1, gap2=bladder4state$y2, status=bladder4state$d2, size=bladder4state$size) obj2<-obj[[1]] KM(time = obj2$time, status = obj2$status, t = 20) fit <- survfit(Surv(obj2$time, obj2$status) ~ 1, data = obj2) summary(fit, time = 20)$surv
require(survival) data("bladder4state") obj<- multidf(gap1=bladder4state$y1, event1=bladder4state$d1, gap2=bladder4state$y2, status=bladder4state$d2, size=bladder4state$size) obj2<-obj[[1]] KM(time = obj2$time, status = obj2$status, t = 20) fit <- survfit(Surv(obj2$time, obj2$status) ~ 1, data = obj2) summary(fit, time = 20)$surv
This function returns a vector with the Kaplan-Meier weights.
KMW(time, status)
KMW(time, status)
time |
Survival time of the process. |
status |
Censoring indicator of the survival time of the process; 0 if the survival time is censored and 1 otherwise. |
Vector with Kaplan-Meier weights.
Gustavo Soutinho and Luis Meira-Machado
E. Kaplan and P. Meier. Nonparametric estimation from incomplete observations. Journal of the American Statistical Association, 53:457-481, 1958.
data("bladder4state") obj<- multidf(gap1=bladder4state$y1, event1=bladder4state$d1, gap2=bladder4state$y2, status=bladder4state$d2, size=bladder4state$size) obj2<-obj[[1]] kmw <- KMW(time = obj2$time, status = obj2$status) require(survival) bladder.surv <- survfit(Surv(time, status) ~ 1, obj2) times <- summary(bladder.surv)$time surv <- summary(bladder.surv)$surv nevent <- summary(bladder.surv)$n.event p <- match(obj2$time, times) kmw2 <- -diff(c(1, surv))/nevent kmw2 <- kmw2[p]*obj2$status kmw2[is.na(kmw2)] <- 0 all.equal(kmw, kmw2)
data("bladder4state") obj<- multidf(gap1=bladder4state$y1, event1=bladder4state$d1, gap2=bladder4state$y2, status=bladder4state$d2, size=bladder4state$size) obj2<-obj[[1]] kmw <- KMW(time = obj2$time, status = obj2$status) require(survival) bladder.surv <- survfit(Surv(time, status) ~ 1, obj2) times <- summary(bladder.surv)$time surv <- summary(bladder.surv)$surv nevent <- summary(bladder.surv)$n.event p <- match(obj2$time, times) kmw2 <- -diff(c(1, surv))/nevent kmw2 <- kmw2[p]*obj2$status kmw2[is.na(kmw2)] <- 0 all.equal(kmw, kmw2)
Provides estimates for three gap times distribution function based on Kaplan-Meier Weights (KMW).
KMW3df(object, x, y, z)
KMW3df(object, x, y, z)
object |
An object of class multidf. |
x |
The first time for obtaining estimates for the trivariate distribution function. |
y |
The second time for obtaining estimates for the trivariate distribution function. |
z |
The third time for obtaining estimates for the trivariate distribution function. |
Vector with the Kaplan-Meier Weighted estimates for three gapes times distribution function.
Gustavo Soutinho and Luis Meira-Machado
de Una-Alvarez J, Meira Machado LF (2008). "A Simple Estimator of the Bivariate Distribution Function for Censored Gap Times", Statistical and Probability Letters, 78, 2440-2445.
Davison, A.C. and Hinkley, D.V. (1997) "Bootstrap Methods and Their Application", Chapter 5. Cambridge University Press.
data("bladder5state") b4state<-multidf(gap1=bladder5state$y1, event1=bladder4state$d1, gap2=bladder5state$y2, event2=bladder4state$d2, gap3=bladder5state$y3, status=bladder4state$d3) head(b4state)[[1]] KMW3df(b4state, x=13, y=20, z=40) b4<-multidf(gap1=bladder4$t1, event1=bladder4$d1, gap2=bladder4$t2-bladder4$t1, event2=bladder4$d2, gap3=bladder4$t3-bladder4$t2, status=bladder4state$d3) KMW3df(b4, x=13, y=20, z=40)
data("bladder5state") b4state<-multidf(gap1=bladder5state$y1, event1=bladder4state$d1, gap2=bladder5state$y2, event2=bladder4state$d2, gap3=bladder5state$y3, status=bladder4state$d3) head(b4state)[[1]] KMW3df(b4state, x=13, y=20, z=40) b4<-multidf(gap1=bladder4$t1, event1=bladder4$d1, gap2=bladder4$t2-bladder4$t1, event2=bladder4$d2, gap3=bladder4$t3-bladder4$t2, status=bladder4state$d3) KMW3df(b4, x=13, y=20, z=40)
Provides estimates for the bivariate distribution function based on Kaplan-Meier Weights (KMW).
KMWdf(object, x, y)
KMWdf(object, x, y)
object |
An object of class multidf. |
x |
The first time for obtaining estimates for the bivariate distribution function. |
y |
The second time for obtaining estimates for the bivariate distribution function. |
Vector with the Kaplan-Meier weights estimates for the bivariate distribution function.
Gustavo Soutinho and Luis Meira-Machado
de Una-Alvarez J, Meira Machado LF (2008). "A Simple Estimator of the Bivariate Distribution Function for Censored Gap Times", Statistical and Probability Letters, 78, 2440-2445.
Davison, A.C. and Hinkley, D.V. (1997) "Bootstrap Methods and Their Application", Chapter 5. Cambridge University Press.
IPCWdf
, LDMdf
, LINdf
and
WCHdf
.
data("bladder4state") b3state<-multidf(gap1=bladder4state$y1, event1=bladder4state$d1, gap2=bladder4state$y2, status=bladder4state$d2, size=bladder4state$size) KMWdf(b3state, x=13, y=20)
data("bladder4state") b3state<-multidf(gap1=bladder4state$y1, event1=bladder4state$d1, gap2=bladder4state$y2, status=bladder4state$d2, size=bladder4state$size) KMWdf(b3state, x=13, y=20)
Provides estimates for three gap times distribution function based on landmarking. The extension of the landmark estimator (LDM) to three gap times is a consequence of Bayes' theorem.
LDM3df(object, x, y, z)
LDM3df(object, x, y, z)
object |
An object of class multidf. |
x |
The first time for obtaining estimates for the trivariate distribution function. |
y |
The second time for obtaining estimates for the trivariate distribution function. |
z |
The third time for obtaining estimates for the trivariate distribution function. |
Vector with the Landmark estimates for three gap times distribution function.
Gustavo Soutinho and Luis Meira-Machado
van Houwelingen, H.C. (2007). Dynamic prediction by landmarking in event history analysis, Scandinavian Journal of Statistics, 34, 70-85.
Kaplan, E. and Meier, P. (1958). Nonparametric Estimation from Incomplete Observations, Journal of the American Statistical Association 53(282), 457-481.
data("bladder5state") b4state<-multidf(gap1=bladder5state$y1, event1=bladder4state$d1, gap2=bladder5state$y2, event2=bladder4state$d2, gap3=bladder5state$y3, status=bladder4state$d3) head(b4state)[[1]] LDM3df(b4state, x=13, y=20, z=40) b4<-multidf(gap1=bladder4$t1, event1=bladder4$d1, gap2=bladder4$t2-bladder4$t1, event2=bladder4$d2, gap3=bladder4$t3-bladder4$t2, status=bladder4state$d3) LDM3df(b4,x=13,y=20,z=40)
data("bladder5state") b4state<-multidf(gap1=bladder5state$y1, event1=bladder4state$d1, gap2=bladder5state$y2, event2=bladder4state$d2, gap3=bladder5state$y3, status=bladder4state$d3) head(b4state)[[1]] LDM3df(b4state, x=13, y=20, z=40) b4<-multidf(gap1=bladder4$t1, event1=bladder4$d1, gap2=bladder4$t2-bladder4$t1, event2=bladder4$d2, gap3=bladder4$t3-bladder4$t2, status=bladder4state$d3) LDM3df(b4,x=13,y=20,z=40)
Provides estimates for the bivariate distribution function based on Bayes' theorem and Kaplan-Meier survival function. This approach is also named as landmarking.
LDMdf(object, x, y)
LDMdf(object, x, y)
object |
An object of class multidf. |
x |
The first time for obtaining estimates for the bivariate distribution function. |
y |
The second time for obtaining estimates for the bivariate distribution function. |
Vector with the Landmark estimates for the bivariate distribution function.
Gustavo Soutinho and Luis Meira-Machado
van Houwelingen, H.C. (2007). Dynamic prediction by landmarking in event history analysis, Scandinavian Journal of Statistics, 34, 70-85.
Kaplan, E. and Meier, P. (1958). Nonparametric Estimation from Incomplete Observations, Journal of the American Statistical Association 53(282), 457-481.
IPCWdf
, KMWdf
, LINdf
and WCHdf
.
b3state<-multidf(gap1=bladder4state$y1, event1=bladder4state$d1, gap2=bladder4state$y2, status=bladder4state$d2, size=bladder4state$size) LDMdf(b3state, x=13, y=20)
b3state<-multidf(gap1=bladder4state$y1, event1=bladder4state$d1, gap2=bladder4state$y2, status=bladder4state$d2, size=bladder4state$size) LDMdf(b3state, x=13, y=20)
Provides estimates for three gap times distribution function based on the extension the Lin's estimator.
LIN3df(object, x, y, z)
LIN3df(object, x, y, z)
object |
An object of class multidf. |
x |
The first time for obtaining estimates for the triviate distribution function. |
y |
The second time for obtaining estimates for the triviate distribution function. |
z |
The third time for obtaining estimates for the triviate distribution function. |
Vector with the Lin's estimates for three gapes times distribution function.
Gustavo Soutinho and Luis Meira-Machado
Lin, D. Y., Sun, W. and Ying, Z. (1999). Nonparametric estimation of the gap time distributions for serial events with censored data, Biometrika 86, 59-70.
data("bladder5state") b4state<-multidf(gap1=bladder5state$y1, event1=bladder4state$d1, gap2=bladder5state$y2, event2=bladder4state$d2, gap3=bladder5state$y3, status=bladder4state$d3) head(b4state)[[1]] LIN3df(b4state, x=13, y=20, z=40) b4<-multidf(gap1=bladder4$t1, event1=bladder4$d1, gap2=bladder4$t2-bladder4$t1, event2=bladder4$d2, gap3=bladder4$t3-bladder4$t2, status=bladder4state$d3) LIN3df(b4, x=13, y=20, z=40)
data("bladder5state") b4state<-multidf(gap1=bladder5state$y1, event1=bladder4state$d1, gap2=bladder5state$y2, event2=bladder4state$d2, gap3=bladder5state$y3, status=bladder4state$d3) head(b4state)[[1]] LIN3df(b4state, x=13, y=20, z=40) b4<-multidf(gap1=bladder4$t1, event1=bladder4$d1, gap2=bladder4$t2-bladder4$t1, event2=bladder4$d2, gap3=bladder4$t3-bladder4$t2, status=bladder4state$d3) LIN3df(b4, x=13, y=20, z=40)
Provides estimates for the bivariate distribution function based on the extension the Kaplan-Meier estimator of the distribution function for the first event time and the Inverse Probability of Censoring Weights for the second time.
LINdf(object, x, y)
LINdf(object, x, y)
object |
An object of class multidf. |
x |
The first time for obtaining estimates for the bivariate distribution function. |
y |
The second time for obtaining estimates for the bivariate distribution function. |
Vector with the Lin's estimates for the bivariate distribution function.
Gustavo Soutinho and Luis Meira-Machado
Lin, D. Y., Sun, W. and Ying, Z. (1999). Nonparametric estimation of the gap time distributions for serial events with censored data, Biometrika 86, 59-70.
IPCWdf
, LDMdf
, KMWdf
and
WCHdf
.
b3state<-multidf(gap1=bladder4state$y1, event1=bladder4state$d1, gap2=bladder4state$y2, status=bladder4state$d2, size=bladder4state$size) LINdf(b3,x=13,y=20)
b3state<-multidf(gap1=bladder4state$y1, event1=bladder4state$d1, gap2=bladder4state$y2, status=bladder4state$d2, size=bladder4state$size) LINdf(b3,x=13,y=20)
Creates a "multidf" object, usually used as a response variable in a model formula.
multidf(gap1, gap2, gap3=NULL, event1, status, event2=NULL, ...)
multidf(gap1, gap2, gap3=NULL, event1, status, event2=NULL, ...)
gap1 |
First gap time. |
gap2 |
Second gap time. |
gap3 |
Third gap time. By default is NULL. |
event1 |
Indicator of the first time; 0 if the first time is censored and 1 otherwise. |
status |
Censoring indicator of the survival time of the process; 0 if the total time is censored and 1 otherwise. For instance, for three gap times, status is given by the indicator of the third time. |
event2 |
Indicator of the second time; 0 if the first time is censored and 1 otherwise. By default is NULL. |
... |
Other options. Additional arguments, such as covariates, can also be included in the data set. |
Arguments in this function must be introduced in the following
order: gap1
, event1
, gap2
and status
, where
gap1
and gap2
are ordered event times and
event1
and status
their corresponding indicator statuses.
Other arguments can be also added. These should consider intermediate times
and corresponding censoring indicators or covariates.
An object of class "multidf". "multidf" objects are implemented as a single data frame.
Gustavo Soutinho and Luis Meira-Machado
library(survivalREC) data("bladder4state") b3state<-multidf(gap1=bladder4state$y1, event1=bladder4state$d1, gap2=bladder4state$y2, status=bladder4state$d2, size=bladder4state$size) head(b3state[[1]]) class(b3state) b4state<-multidf(gap1=bladder4state$y1, event1=bladder4state$d1, gap2=bladder4state$y2, event2=bladder4state$d2, gap3=bladder4state$y3, status=bladder4state$d3, size=bladder4state$size) head(b4state[[1]])
library(survivalREC) data("bladder4state") b3state<-multidf(gap1=bladder4state$y1, event1=bladder4state$d1, gap2=bladder4state$y2, status=bladder4state$d2, size=bladder4state$size) head(b3state[[1]]) class(b3state) b4state<-multidf(gap1=bladder4state$y1, event1=bladder4state$d1, gap2=bladder4state$y2, event2=bladder4state$d2, gap3=bladder4state$y3, status=bladder4state$d3, size=bladder4state$size) head(b4state[[1]])
Computes the Nadaraya-Watson weights.
NWW(covariate, x, kernel = "gaussian", bw)
NWW(covariate, x, kernel = "gaussian", bw)
covariate |
Covariate values for obtaining weights. |
x |
Covariate value to compute the weight at. |
kernel |
A character string specifying the desired kernel. See details below for possible options. Defaults to "gaussian" where the gaussian density kernel will be used. |
bw |
A single numeric value to compute a kernel density bandwidth. |
Possible options for argument window are "gaussian", "epanechnikov", "tricube", "boxcar", "triangular", "quartic" or "cosine".
A vector with Nadaraya-Watson weights.
Gustavo Soutinho and Luis Meira-Machado
b3state<-multidf(gap1=bladder4state$y1, event1=bladder4state$d1, gap2=bladder4state$y2, status=bladder4state$d2, size=bladder4state$size) obj0 <- b3state[[1]] NWW(covariate = obj0$size, x=3, kernel = "gaussian", bw = 3)
b3state<-multidf(gap1=bladder4state$y1, event1=bladder4state$d1, gap2=bladder4state$y2, status=bladder4state$d2, size=bladder4state$size) obj0 <- b3state[[1]] NWW(covariate = obj0$size, x=3, kernel = "gaussian", bw = 3)
Provides the plots for the bivariate distribution function and marginal distribution of the second time.
## S3 method for class 'multidf' plot(x, t1, method = "KMW", type = "s", ...)
## S3 method for class 'multidf' plot(x, t1, method = "KMW", type = "s", ...)
x |
An object of class multidf. |
t1 |
Value of the first gap time. |
method |
A character string specifying which estimator to fit. Possible values are "KMW", "LIN", "WCH" and "LANDMARK". |
type |
The type of plot that should be drawn. See details
|
... |
Other options. |
No value is returned.
Gustavo Soutinho and Luis Meira-Machado
de Una-Alvarez, J. and Meira-Machado, L. (2008). A simple estimator of the bivariate distribution function for censored gap times, Statistics and Probability Letters 78, 2440-2445.
Davison, A.C. and Hinkley, D.V. (1997) "Bootstrap Methods and Their Application", Chapter 5. Cambridge University Press.
van Houwelingen, H.C. (2007). Dynamic prediction by landmarking in event history analysis, Scandinavian Journal of Statistics, 34, 70-85. Kaplan, E. and Meier, P. (1958). Nonparametric Estimation from Incomplete Observations, Journal of the American Statistical Association 53(282), 457-481.
KMWdf
, LDMdf
, LINdf
and
WCHdf
.
data("bladder4state") b3state<-multidf(gap1=bladder4state$y1, event1=bladder4state$d1, gap2=bladder4state$y2, status=bladder4state$d2, size=bladder4state$size) head(b3state[[1]]) KMWdf(b3state,x=13,y=20) LDMdf(b3state,x=13,y=20) LINdf(b3state,x=13,y=20) WCHdf(b3state,x=13,y=20) plot(x=b3state, t1=3, method="KMW", type = "s") plot(x=b3state, t1=3, method="LIN", type = "s") plot(x=b3state, t1=3, method="WCH", type = "s") plot(x=b3state, t1=3, method="LANDMARK", type = "s")
data("bladder4state") b3state<-multidf(gap1=bladder4state$y1, event1=bladder4state$d1, gap2=bladder4state$y2, status=bladder4state$d2, size=bladder4state$size) head(b3state[[1]]) KMWdf(b3state,x=13,y=20) LDMdf(b3state,x=13,y=20) LINdf(b3state,x=13,y=20) WCHdf(b3state,x=13,y=20) plot(x=b3state, t1=3, method="KMW", type = "s") plot(x=b3state, t1=3, method="LIN", type = "s") plot(x=b3state, t1=3, method="WCH", type = "s") plot(x=b3state, t1=3, method="LANDMARK", type = "s")
Provides estimates for three gap times distribution function based on Weighted cumulative hazard estimator (WCH).
WCH3df(object, x, y, z)
WCH3df(object, x, y, z)
object |
An object of class multidf. |
x |
The first time for obtaining estimates for the three gap times distribution function. |
y |
The second time for obtaining estimates for the three gap times distribution function. |
z |
The third time for obtaining estimates for the three gap times distribution function. |
Vector with the Weighted cumulative hazard estimates for three gap times distribution function.
Gustavo Soutinho and Luis Meira-Machado
Wang, M.C. and Wells, M.T. (1998). Nonparametric Estimation of successive duration times under dependent censoring, Biometrika 85, 561-572.
data("bladder5state") b4state<-multidf(gap1=bladder5state$y1, event1=bladder4state$d1, gap2=bladder5state$y2, event2=bladder4state$d2, gap3=bladder5state$y3, status=bladder4state$d3) head(b4state)[[1]] WCH3df(b4state, x=13, y=20, z=40) b4<-multidf(gap1=bladder4$t1, event1=bladder4$d1, gap2=bladder4$t2-bladder4$t1, event2=bladder4$d2, gap3=bladder4$t3-bladder4$t2, status=bladder4state$d3) WCH3df(b4, x=13, y=20, z=40)
data("bladder5state") b4state<-multidf(gap1=bladder5state$y1, event1=bladder4state$d1, gap2=bladder5state$y2, event2=bladder4state$d2, gap3=bladder5state$y3, status=bladder4state$d3) head(b4state)[[1]] WCH3df(b4state, x=13, y=20, z=40) b4<-multidf(gap1=bladder4$t1, event1=bladder4$d1, gap2=bladder4$t2-bladder4$t1, event2=bladder4$d2, gap3=bladder4$t3-bladder4$t2, status=bladder4state$d3) WCH3df(b4, x=13, y=20, z=40)
Provides estimates for the bivariate distribution function based on Weighted cumulative hazard estimator (WCH).
WCHdf(object, x, y)
WCHdf(object, x, y)
object |
An object of class multidf. |
x |
The first time for obtaining estimates for the bivariate distribution function. |
y |
The second time for obtaining estimates for the bivariate distribution function. |
Vector with the Weighted cumulative hazard estimates for the bivariate distribution function.
Gustavo Soutinho and Luis Meira-Machado
Wang, M.C. and Wells, M.T. (1998). Nonparametric Estimation of successive duration times under dependent censoring, Biometrika 85, 561-572.
IPCWdf
, KMWdf
, LINdf
and
LDMdf
.
data("bladder3") b3<-multidf(gap1=bladder3$t1, event1=bladder3$d1, gap2=bladder3$t2-bladder3$t1,status=bladder4state$d2) head(b3[[1]]) WCHdf(b3,x=13,y=20)
data("bladder3") b3<-multidf(gap1=bladder3$t1, event1=bladder3$d1, gap2=bladder3$t2-bladder3$t1,status=bladder4state$d2) head(b3[[1]]) WCHdf(b3,x=13,y=20)