Title: | Nonparametric and Semiparametric Methods for Multivariate Failure Time Data |
Version: | 0.2.3 |
Description: | Nonparametric survival function estimates and semiparametric regression for the multivariate failure time data with right-censoring. For nonparametric survival function estimates, the Volterra, Dabrowska, and Prentice-Cai estimates for bivariate failure time data may be computed as well as the Dabrowska estimate for the trivariate failure time data. Bivariate marginal hazard rate regression can be fitted for the bivariate failure time data. Functions are also provided to compute (bootstrap) confidence intervals and plot the estimates of the bivariate survival function. For details, see "The Statistical Analysis of Multivariate Failure Time Data: A Marginal Modeling Approach", Prentice, R., Zhao, S. (2019, ISBN: 978-1-4822-5657-4), CRC Press. |
Depends: | R (≥ 3.5.0) |
License: | GPL-3 |
Encoding: | UTF-8 |
RoxygenNote: | 7.2.3 |
LinkingTo: | Rcpp, RcppArmadillo |
Imports: | Rcpp, boot, plot3D, survival, rootSolve |
NeedsCompilation: | yes |
Packaged: | 2023-08-16 09:21:13 UTC; ebair |
Author: | Eric Bair [aut, cre], Taylor Petty [aut], Shanshan Zhao [aut] |
Maintainer: | Eric Bair <eric.bair@sciome.com> |
Repository: | CRAN |
Date/Publication: | 2023-08-17 14:32:39 UTC |
Aplastic anemia clinical trial data.
Description
Failure time data for 64 patients having severe aplastic anemia. Patients were randomly assigned to receive either cyclosporine plus methotrexate (CSPMTX) or methotrexate alone (MTX) with time from assignment to the diagnosis of stage 2 or greater acute graft versus host disease (A-GVHD) as a key outcome.
Usage
data(anemia)
Format
A data frame with 64 rows and 5 variables:
- Treatment:
Treatment group, either cyclosporine and methotrexate (CSPMTX) or methotrexate only (MTX).
- Time:
Time in days to severe (stage >=2) acute graft versus host disease, death, or last contact.
- LAF:
Patient assigned to laminar air flow isolation room at baseline. LAF = 1 signifies yes, LAF = 0 signifies no.
- Age:
Age of patient in years.
- Censored:
Boolean for whether or not time to severe A-GVHD is right-censored; i.e., the patient died without severe A-GVHD or was without severe A-GVHD at last contact.
Source
Table 1.1, page 14 of Prentice and Zhao 2019, taken from Table 1.2 on page 3 in The Statistical Analysis of Failure Time Data, Second Edition, by J. D. Kalbfleisch and R. L. Prentice. New York: Wiley and Sons, 2002.
References
Prentice, R., Zhao, S. "The statistical analysis of multivariate failure time data: A marginal modeling approach", CRC Press (2019).
Bladder tumor recurrence data.
Description
Data from a randomized trial of patient recurrences of superficial bladder tumor recurrence as conducted by the Veterans Administration Cooperative Urological Group. These data were used to compare the frequency of recurrences among 48 patients assigned to placebo, among whom there were a total of 87 post-randomization recurrences, and 38 patients assigned to treatment with a drug called thiotepa, among whom there were 45 recurrences during the follow-up period, which averaged about 31 months.
Usage
data(bladder)
Format
A data frame with 86 rows and 13 variables:
- Group:
Placebo vs treatment (thiotepa).
- Number:
Number of tumors present at baseline, with 8 denoting 8 or more.
- Size:
Size of largest tumor at baseline, in centimeters.
- CensorTime:
Censor time, in months.
- T1:
For i = 1,...,9, T_i is the recurrence time, in months. If there is no recurrence, T_1, ..., T_9 will be NA. If there is only one, T_1 will be filled and T_2, ..., T_9 will be NA, and so on.
- T2:
See T1.
- T3:
See T1.
- T4:
See T1.
- T5:
See T1.
- T6:
See T1.
- T7:
See T1.
- T8:
See T1.
- T9:
See T1.
Source
Table 1.2, page 18 of Prentice and Zhao 2019, taken from Table 9.2 on page 292 in The Statistical Analysis of Failure Time Data, Second Edition, by J. D. Kalbfleisch and R. L. Prentice. New York: Wiley and Sons, 2002.
References
Prentice, R., Zhao, S. "The statistical analysis of multivariate failure time data: A marginal modeling approach", CRC Press (2019).
Simulated Clayton-Oakes data.
Description
Data simulated under Clayton-Oakes model (Equation 1.7, page 7 of Prentice and Zhao) at various theta values and n = 50, with each observed time having a 1/3 probability of being censored. Variate T_i is right-censored by C_i for i = 1,2 (see pages 52 and 53 of Prentice and Zhao 2019), and min(T_i,C_i) = S_i, with delta_i = 1 if T_i = S_i, and 0 otherwise (i.e., if T_i = S_i then the data was not censored).
Usage
data(clayton_sim)
Format
A data frame with 150 rows and 5 variables:
- Theta:
Parameter value in Clayton-Oakes model.
- S1:
min(T_1, C_1), where T_1 is time of interest and C_1 is a censoring variable. We see T_1 if it is not censored (i.e. C_1 > T_1), and we see C_1 otherwise.
- d1:
I(T_1=S_1), i.e. 1 if T_1 = S_1 and 0 otherwise.
- S2:
See S1.
- d2:
See d1.
Source
Table 3.4, page 70 of Prentice and Zhao 2019.
References
Prentice, R., Zhao, S. "The statistical analysis of multivariate failure time data: A marginal modeling approach", CRC Press (2019).
Generates survival data from a bivariate Clayton-Oakes model
Description
Generates simulated survival data from a bivariate Clayton-Oakes model, which can be used to create example data for bivariate survival function estimation. The marginal distributions are exponential with given rate parameters. The joint distribution is defined using a Clayton copula. The censoring times are also exponentially distributed with given rate parameters.
Usage
genClayton2(n, theta, lambda10, lambda01, lambdaC1, lambdaC2)
Arguments
n |
Sample size for the simulated data set. |
theta |
Parameter for the Clayton copula. Must be -1 or larger. |
lambda10 , lambda01 |
Rate parameters for the (marginal) exponential distributions. |
lambdaC1 , lambdaC2 |
Rate parameters for the censoring times. No censoring occurs if this parameter is equal to 0. |
Value
A data frame containing the following elements:
- Y1, Y2:
Survival times for the simulated data
- Delta1, Delta2:
Censoring indicators for the simulated data
Details
This function simulates data with the following survival function: F(t1,t2) = [F(t1,0)^(-theta) + F(0,t2)^(-theta) - 1]^(-1/theta) (The survival function is defined to be equal to 0 if this quantity is negative.) The marginal survival functions F(t1,0) and F(0,t2) are exponentially distributed with rate parameters lambda10 and lambda01, respectively. After generating survival times Y1 and Y2 (of length n) under this distribution, censoring times C1 and C2 (also of length n) are generated. C1/C2 are generated under an exponential distribution with rate parameters lambdaC1 and lambdaC2. If C1[i]<Y1[i] for a given observation i, then observation i is considered to be censored (i.e., Delta1[i]=0). Delta2 is defined in a similar manner. If lambdaC1 or lambdaC2 is equal to 0, then the corresponding variable is uncensored (meaning that Delta[i]=1 for all i).
References
Clayton, D. "Model for association in bivariate life tables and its application in epidemiological studies of familial tendency in chronic disease incidence.", Biometrika (1978) 65:141-151. Prentice, R., Zhao, S. "The statistical analysis of multivariate failure time data: A marginal modeling approach", CRC Press (2019).
Examples
x <- genClayton2(1000, 0, 1, 1, 2, 2)
Generates survival data from a trivariate Clayton-Oakes model
Description
Generates simulated survival data from a trivariate Clayton-Oakes model, which can be used to create example data for trivariate survival function estimation. The marginal distributions are exponential with rate parameter 1. The joint distribution is defined using a Clayton copula. The censoring times are also exponentially distributed with given rate parameters.
Usage
genClayton3(n, theta, lambdaC1, lambdaC2, lambdaC3)
Arguments
n |
Sample size for the simulated data set. |
theta |
Parameter for the Clayton copula. Must be -1 or larger. |
lambdaC1 , lambdaC2 , lambdaC3 |
Rate parameters for the censoring times. No censoring occurs if this parameter is equal to 0. |
Value
A data frame containing the following elements:
- Y1, Y2, Y3:
Survival times for the simulated data
- Delta1, Delta2, Delta3:
Censoring indicators for the simulated data
Details
This function simulates data with the following survival function: F(t1,t2,t3) = [F(t1,0,0)^(-theta) + F(0,t2,0)^(-theta) + F(0,0,t3) - 2]^(-1/theta) (The survival function is defined to be equal to 0 if this quantity is negative.) The marginal survival functions F(t1,0,0), F(0,t2,0), and F(0,0,t3) are exponentially distributed with rate parameter 1. After generating survival times Y1, Y2, and Y3 (of length n) under this distribution, censoring times C1, C2, and C3 (also of length n) are generated. C1/C2/C3 are generated under an exponential distribution with rate parameters lambdaC1, lambdaC2, lambdaC3, respectively. If C1[i]<Y1[i] for a given observation i, then observation i is considered to be censored (i.e., Delta1[i]=0). Delta2 and Delta3 are defined in a similar manner. If lambdaC1, lambdaC2, and/or lambdaC3 is equal to 0, then the corresponding variable is uncensored (meaning that Delta[i]=1 for all i).
References
Clayton, D. "Model for association in bivariate life tables and its application in epidemiological studies of familial tendency in chronic disease incidence.", Biometrika (1978) 65:141-151. Prentice, R., Zhao, S. "The statistical analysis of multivariate failure time data: A marginal modeling approach", CRC Press (2019).
Examples
x <- genClayton3(200, 0, 0.5, 0.5, 0.5)
Generates regression data from a bivariate Clayton-Oakes model
Description
Generates simulated survival data from a bivariate Clayton-Oakes model where the hazard depends on a binary coefficient X. This can be used to create example data for bivariate Cox regression. The marginal distributions are exponential with given rate parameters. The joint distribution is defined using a Clayton copula. The censoring times are also exponentially distributed with given rate parameters.
Usage
genClaytonReg(
n,
theta,
Xp,
lambda10,
lambda01,
b10,
b01,
b11,
lambdaC1,
lambdaC2
)
Arguments
n |
Sample size for the simulated data set. |
theta |
Parameter for the Clayton copula. Must be -1 or larger. |
Xp |
Probability that the covariate is equal to 1. Must satisfy 0<Xp<1. |
lambda10 , lambda01 |
Rate parameters for the (marginal) exponential distributions when X=0. |
b10 , b01 , b11 |
Regression coefficient values. |
lambdaC1 , lambdaC2 |
Rate parameters for the censoring times. No censoring occurs if this parameter is equal to 0. |
Value
A data frame containing the following elements:
- Y1, Y2:
Survival times for the simulated data
- Delta1, Delta2:
Censoring indicators for the simulated data
X |
Covariate matrix (of dimension n x 1). |
Details
This function simulates data with the following survival function: F(t1,t2) = [F(t1,0)^(-eta) + F(0,t2)^(-eta) - 1]^(-1/eta) (The survival function is defined to be equal to 0 if this quantity is negative.) Here eta=thetaexp(Xb11). The marginal survival functions F(t1,0) and F(0,t2) are exponentially distributed with rate parameters lambda10exp(Xb10) and lambda01exp(Xb01), respectively. After generating survival times Y1 and Y2 (of length n) under this distribution, censoring times C1 and C2 (also of length n) are generated. C1/C2 are generated under an exponential distribution with rate parameters lambdaC1 and lambdaC2. If C1[i]<Y1[i] for a given observation i, then observation i is considered to be censored (i.e., Delta1[i]=0). Delta2 is defined in a similar manner. If lambdaC1 or lambdaC2 is equal to 0, then the corresponding variable is uncensored (meaning that Delta[i]=1 for all i).
References
Clayton, D. "Model for association in bivariate life tables and its application in epidemiological studies of familial tendency in chronic disease incidence.", Biometrika (1978) 65:141-151. Prentice, R., Zhao, S. "The statistical analysis of multivariate failure time data: A marginal modeling approach", CRC Press (2019).
Examples
x <- genClaytonReg(1000, 2, 0.5, 1, 1, log(2), log(2), log(8/3), 2, 2)
Cox regression for a bivariate outcome
Description
Fits a semiparametric Cox regression model for a bivariate outcome. This function computes the regression coefficients, baseline hazards, and sandwich estimates of the standard deviation of the regression coefficients. If desired, estimates of the survival function F and marginal hazard rates Lambda11 can be computed using the mHR2.LF function.
Usage
mHR2(Y1, Y2, Delta1, Delta2, X)
Arguments
Y1 , Y2 |
Vectors of event times (continuous). |
Delta1 , Delta2 |
Vectors of censoring indicators (1=event, 0=censored). |
X |
Matrix of covariates (continuous or binary). |
Value
A list containing the following elements:
- Y1, Y2:
Original vectors of event times
- Delta1, Delta2:
Original vectors of censoring indicators
- X:
Original covariate matrix
- n10, n01:
Total number of events for the first/second outcome
- n11:
Total number of double events
- beta10, beta01, beta11:
Regression coefficient estimates
- lambda10, lambda01, lambda11:
Baseline hazard estimates
- SD.beta10, SD.beta01, SD.beta11:
Sandwich estimates of the standard deviation of the regression coefficients
- SD.beta10.cox, SD.beta01.cox:
Standard deviation estimates for the regression coefficients based on a univariate Cox model
References
Prentice, R., Zhao, S. "The statistical analysis of multivariate failure time data: A marginal modeling approach", CRC Press (2019). Prentice, R., Zhao, S. "Regression models and multivariate life tables", Journal of the American Statistical Association (2021) 116(535): 1330-1345. https://doi.org/10.1080/01621459.2020.1713792
See Also
Examples
x <- genClaytonReg(1000, 2, 0.5, 1, 1, log(2), log(2), log(8/3), 2, 2)
x.mHR2 <- mHR2(x$Y1, x$Y2, x$Delta1, x$Delta2, x$X)
Bivariate regression survival function and marginal hazards estimation
Description
Estimates the survival function F and the marginal hazards Lambda11 for a bivariate Cox regression model. F and Lambda11 are estimated at two specified values of the covariates. If desired, (bootstrap) confidence intervals or confidence bounds for F and Lambda11 may also be computed.
Usage
mHR2.LF(
mHR2.obj,
X0_out,
X1_out,
T1_out,
T2_out,
confidence = c("none", "CI", "CB"),
n.boot = 100
)
Arguments
mHR2.obj |
Output from the mHR2 function. |
X0_out , X1_out |
Two possible sets of values for the covariates. F and Lambda will be estimated at X=X0_out and X=X1_out. |
T1_out , T2_out |
Vector of time points at which F and Lambda11 should be estimated. If confidence="CB", then both vectors must have length 3. |
confidence |
Type of confidence estimate to be computed. Possible values include "none", "CI" (to compute confidence intervals), and "CB" (to compute confidence bands). Defaults to "none". |
n.boot |
Number of bootstrap iterations for computing the confidence intervals/bands. Defaults to 100. Ignored if confidence="none". |
Value
A list containing the following elements:
- n10, n01:
Total number of events for the first/second outcome
- n11:
Total number of double events
- beta10, beta01, beta11:
Regression coefficient estimates
- lambda10, lambda01, lambda11:
Baseline hazard estimates
- Lambda11_out_Z0, Lambda11_out_Z1:
Estimates of Lambda11 at T1_out, T2_out for X=X0_out and X=X1_out
- F_out_X0, F_out_X1:
Estimates of F at T1_out, T2_out for X=X0_out and X=X1_out
- CI_Lambda11_X0.lb, CI_Lambda11_X0.ub:
Lower and upper bounds for Lambda11 at X=X0_out
- CI_Lambda11_X1.lb, CI_Lambda11_X1.ub:
Lower and upper bounds for Lambda11 at X=X1_out
- CI_F_X0.lb, CI_F_X0.ub:
Lower and upper bounds for F at X=X0_out
- CI_F_X1.lb, CI_F_X1.ub:
Lower and upper bounds for F at X=X1_out
- CB1_Lambda11_X0.lb, CB1_Lambda11_X0.ub, CB2_Lambda11_X0.lb, CB2_Lambda11_X0.ub, CB3_Lambda11_X0.lb, CB3_Lambda11_X0.ub:
Lower and upper bounds for Lambda11 at X=X0_out, at three T1_out, T2_out combinations
- CB1_Lambda11_X1.lb, CB1_Lambda11_X1.ub, CB2_Lambda11_X1.lb, CB2_Lambda11_X1.ub, CB3_Lambda11_X1.lb, CB3_Lambda11_X1.ub:
Lower and upper bounds for Lambda11 at X=X1_out, at three T1_out, T2_out combinations
- CB1_F_X0.lb, CB1_F_X0.ub, CB2_F_X0.lb, CB2_F_X0.ub, CB3_F_X0.lb, CB3_F_X0.ub:
Lower and upper bounds for F at X=X0_out, at three T1_out, T2_out combinations
- CB1_F_X1.lb, CB1_F_X1.ub, CB2_F_X1.lb, CB2_F_X1.ub, CB3_F_X1.lb, CB3_F_X1.ub:
Lower and upper bounds for F at X=X1_out, at three T1_out, T2_out combinations
Details
If confidence="CI" or confidence="CB", then 95% bootstrap confidence bounds are computed by estimating the standard errors of F/Lambda11 based on n.boot bootstrap iterations. Currently confidence bounds can only be computed at three specified T1out/T2out combinations (meaning that T1out and T2out must both have length 3 if confidence="CB"). No confidence measures will be returned if confidence="none".
References
Prentice, R., Zhao, S. "The statistical analysis of multivariate failure time data: A marginal modeling approach", CRC Press (2019). Prentice, R., Zhao, S. "Regression models and multivariate life tables", Journal of the American Statistical Association (2020) In press.
See Also
Examples
x <- genClaytonReg(50, 2, 0.5, 1, 1, log(2), log(2), log(8/3), 2, 2)
x.mHR2 <- mHR2(x$Y1, x$Y2, x$Delta1, x$Delta2, x$X)
x.LF <- mHR2.LF(x.mHR2, 0, 1, c(0.25, 0.5, 1), c(0.25, 0.5, 1))
x.LF.CI <- mHR2.LF(x.mHR2, 0, 1, c(0.25, 0.5, 1),
c(0.25, 0.5, 1), confidence="CI")
x.LF.CB <- mHR2.LF(x.mHR2, 0, 1, c(0.25, 0.5, 1),
c(0.25, 0.5, 1), confidence="CB")
Cox regression for a bivariate outcome with time-varying covariates
Description
Fits a semiparametric Cox regression model for a bivariate outcome with time-varying covariates. Currently only the regression coefficients are computed.
Usage
mHR2.tvc(Y1, Y2, Delta1, Delta2, ids, X)
Arguments
Y1 , Y2 |
Vectors of event times (continuous). |
Delta1 , Delta2 |
Vectors of censoring indicators (1=event, 0=censored). |
ids |
Vector of ID numbers. It is used to map the values of the time-varying covariates back to the original Y1/Y2/Delta1/Delta2 values. See Details. |
X |
Matrix of covariates (continuous or binary). See Details for the proper format of this matrix. |
Value
A list containing the following elements:
- beta10, beta01, beta11:
Regression coefficient estimates
Details
X must be a matrix with at least four columns. The first column contains the ID numbers. Each ID number in this column must map to a unique element of the ids vector. The second and third columns consists of time points for T1 and T2, respectively. They specify the time points at which the covariates take on the specified value(s). The remaining columns represent the values of the covariates on the specified time interval. For example, if we define X.tv <- matrix(c(1001, 1001, 0, 0, 0, 5, 1, 2), nrow=2) then, for the observation with ID number 1001, then when T1=0, the time-varying covariate has a value of 1 on when T2 is in [0,5) and a value of 2 when T2 is in [5,Inf). Note that the values of the time-varying covariates must be specified for when T1=0 (or T2=0) in order to compute beta10 and beta01. If a value of a covariate is constant when T1=0 or T2=0, that covariate will be dropped when computing beta10 or beta01.
Support for time-varying covariates is experimental and has not been tested extensively. Use this function at your own risk.
References
Prentice, R., Zhao, S. "The statistical analysis of multivariate failure time data: A marginal modeling approach", CRC Press (2019). Prentice, R., Zhao, S. "Regression models and multivariate life tables", Journal of the American Statistical Association (2021) 116(535): 1330-1345. https://doi.org/10.1080/01621459.2020.1713792
See Also
Examples
x <- genClaytonReg(50, 2, 0.5, 1, 1, 0, log(2), 0, 5, 5)
x.tv <- tvc.example(x$Y1, x$Y2, x$Delta1, x$Delta2, x$X)
x.mHR2 <- mHR2.tvc(x$Y1, x$Y2, x$Delta1, x$Delta2,
x.tv$ids, x.tv$X.tv)
Nonparametric estimates of the survival function for bivariate failure time data
Description
Computes the survival function for bivariate failure time data using one of three possible estimators, including Dabrowska, Volterra and Prentice-Cai estimators. Optionally (bootstrap) confidence intervals for the survival function may also be computed.
Usage
npSurv2(
Y1,
Y2,
Delta1,
Delta2,
newT1 = NULL,
newT2 = NULL,
estimator = c("dabrowska", "volterra", "prentice-cai"),
conf.int = FALSE,
R = 1000,
...
)
Arguments
Y1 , Y2 |
Vectors of event times (continuous). |
Delta1 , Delta2 |
Vectors of censoring indicators (1=event, 0=censored). |
newT1 , newT2 |
Optional vectors of times at which to estimate the survival function (which do not need to be subsets of Y1/Y2). Defaults to the unique values in Y1/Y2 if not specified. |
estimator |
Which estimator of the survival function should be used. Possible values include "dabrowska", "volterra", and "prentice-cai". Defaults to "dabrowska". |
conf.int |
Should bootstrap confidence intervals be computed? |
R |
Number of bootstrap replicates. This argument is passed to the boot function. Defaults to 1000. Ignored if conf.int is FALSE. |
... |
Additional arguments to the boot function. |
Value
A list containing the following elements:
- T1:
Unique uncensored Y1 values
- T2:
Unique uncensored Y2 values
- Fhat:
Estimated bivariate survival function (computed at T1, T2)
- Fhat.lci:
Lower 95% confidence bounds for Fhat
- Fhat.uci:
Upper 95% confidence bounds for Fhat
- Fmarg1.est:
Estimated marginal survival function for T1 (computed at newT1)
- Fmarg1.lci:
Lower 95% confidence bounds for Fmarg1
- Fmarg1.uci:
Upper 95% confidence bounds for Fmarg1
- Fmarg2.est:
Estimated marginal survival function for T2 (computed at newT2)
- Fmarg2.lci:
Lower 95% confidence bounds for Fmarg2
- Fmarg2.uci:
Upper 95% confidence bounds for Fmarg2
- F.est:
Estimated survival function (computed at newT1, newT2)
- F.est.lci:
Lower 95% confidence bounds for F.est
- F.est.uci:
Upper 95% confidence bounds for F.est
- CR:
Estimated cross ratio (computed at T1, T2)
- KT:
Estimated Kendall\'s tau (computed at T1, T2)
- CR.est:
Estimated cross ratio (computed at newT1, newT2)
- KT.est:
Estimated Kendall\'s tau (computed at newT1, newT2)
Details
If conf.int is TRUE, confidence intervals will be computed using the boot function in the boot package. Currently only 95% confidence intervals computed using the percentile method are implemented. If conf.int is FALSE, confidence intervals will not be computed, and confidence bounds will not be returned in the output.
References
Prentice, R., Zhao, S. "Nonparametric estimation of the multivariate survivor function: the multivariate Kaplan–Meier estimator", Lifetime Data Analysis (2018) 24:3-27. Prentice, R., Zhao, S. "The statistical analysis of multivariate failure time data: A marginal modeling approach", CRC Press (2019). pp. 52-60.
See Also
Examples
x <- genClayton2(100, 0, 1, 1, 2, 2)
x.npSurv2 <- npSurv2(x$Y1, x$Y2, x$Delta1, x$Delta2)
x.npSurv2.ci <- npSurv2(x$Y1, x$Y2, x$Delta1, x$Delta2,
conf.int=TRUE)
x.npSurv2.volt <- npSurv2(x$Y1, x$Y2, x$Delta1, x$Delta2,
estimator="volterra")
x.npSurv2.t <- npSurv2(x$Y1, x$Y2, x$Delta1, x$Delta2,
newT1=-1*log(c(0.55, 0.7, 0.7, 0.85, 0.85, 0.85)),
newT2=-1*log(c(0.55, 0.55, 0.7, 0.55, 0.7, 0.85)))
Nonparametric estimates of the survival function for trivariate failure time data
Description
Computes the survival function for a trivariate failure time data. The survival function for trivariate failure time data is analogous to the Kaplan-Meier estimator for a univariate failure time data and Dabrowska estimator for bivariate failure time data. Optionally (bootstrap) confidence intervals for the survival function may also be computed.
Usage
npSurv3(
Y1,
Y2,
Y3,
Delta1,
Delta2,
Delta3,
newT1 = NULL,
newT2 = NULL,
newT3 = NULL,
conf.int = FALSE,
R = 1000,
...
)
Arguments
Y1 , Y2 , Y3 |
Vectors of event times (continuous). |
Delta1 , Delta2 , Delta3 |
Vectors of censoring indicators (1=event, 0=censored). |
newT1 , newT2 , newT3 |
Optional vectors of times at which to estimate the survival function (which do not need to be subsets of Y1/Y2/Y3). Defaults to the unique values in Y1/Y2/Y3 if not specified. |
conf.int |
Should bootstrap confidence intervals be computed? |
R |
Number of bootstrap replicates. This argument is passed to the boot function. Defaults to 1000. Ignored if conf.int is FALSE. |
... |
Additional arguments to the boot function. |
Value
A list containing the following elements:
- T1:
Unique values of Y1 at which Fhat was computed
- T2:
Unique values of Y2 at which Fhat was computed
- T3:
Unique values of Y3 at which Fhat was computed
- Fhat:
Estimated survival function (computed at T1, T2, T3)
- Fhat.lci:
Lower 95% confidence bounds for Fhat
- Fhat.uci:
Upper 95% confidence bounds for Fhat
- Fmarg1.est:
Estimated marginal survival function for T11 (computed at newT1)
- Fmarg1.lci:
Lower 95% confidence bounds for Fmarg1
- Fmarg1.uci:
Upper 95% confidence bounds for Fmarg1
- Fmarg2.est:
Estimated marginal survival function for T2 (computed at newT2)
- Fmarg2.lci:
Lower 95% confidence bounds for Fmarg2
- Fmarg2.uci:
Upper 95% confidence bounds for Fmarg2
- Fmarg3.est:
Estimated marginal survival function for T3 (computed at newT3)
- Fmarg3.lci:
Lower 95% confidence bounds for Fmarg3
- Fmarg3.uci:
Upper 95% confidence bounds for Fmarg3
- F.est:
Estimated survival function (computed at newT1, newT2, newT3)
- F.est.lci:
Lower 95% confidence bounds for F.est
- F.est.uci:
Upper 95% confidence bounds for F.est
- C110:
Pairwise marginal cross ratio estimator C110 (computed at newT1, newT2, newT3)
- C101:
Pairwise marginal cross ratio estimator C101 (computed at newT1, newT2, newT3)
- C011:
Pairwise marginal cross ratio estimator C011 (computed at new T1, newT2, newT3)
- C111:
Trivariate dependency estimator C111 (computed at newT1, newT2, newT3)
Details
If conf.int is TRUE, confidence intervals will be computed using the boot function in the boot package. Currently only 95% confidence intervals computed using the percentile method are implemented. If conf.int is FALSE, confidence intervals will not be computed, and confidence bounds will not be returned in the output.
References
Prentice, R., Zhao, S. "Nonparametric estimation of the multivariate survivor function: the multivariate Kaplan–Meier estimator", Lifetime Data Analysis (2018) 24:3-27. Prentice, R., Zhao, S. "The statistical analysis of multivariate failure time data: A marginal modeling approach", CRC Press (2019). pp. 120-123.
See Also
Examples
x <- genClayton3(25, 0, 0.5, 0.5, 0.5)
x.npSurv3 <- npSurv3(x$Y1, x$Y2, x$Y3, x$Delta1, x$Delta2, x$Delta3)
x.npSurv3.ci <- npSurv3(x$Y1, x$Y2, x$Y3, x$Delta1, x$Delta2,
x$Delta3, conf.int=TRUE, R=500)
Uses a 3D perspective plot to visualize a nonparametric bivariate survival function
Description
Plots a 3D perspective plot of an estimated nonparametric bivariate survival function. This function is a wrapper for the persp3D function from the plot3D package with default parameters chosen to make the data easier to visualize.
Usage
plotnpSurv2.3D(
npSurv2.obj,
col = "grey",
shade = 0.25,
theta = 120,
xlab = "T1",
ylab = "T2",
zlab = "Fhat",
...
)
Arguments
npSurv2.obj |
Output of the npSurv2 function. |
col |
Color palette to be used for the plot. Defaults to "grey". See persp3D. |
shade |
The degree of shading of the surface facets. Defaults to 0.25. See persp. |
theta |
The azimuthal viewing direction. See persp. |
xlab |
The x-axis label. Defaults to "T1". |
ylab |
The y-axis label. Defaults to "T2". |
zlab |
The z-axis label. Defaults to "Fhat". |
... |
Additional parameters to the persp3D function. |
See Also
Examples
x <- genClayton2(100, 0, 1, 1, 2, 2)
x.npSurv2 <- npSurv2(x$Y1, x$Y2, x$Delta1, x$Delta2)
plotnpSurv2.3D(x.npSurv2)
x2 <- genClayton2(100, 2, 1, 1, 2, 2)
x2.npSurv2 <- npSurv2(x2$Y1, x2$Y2, x2$Delta1, x2$Delta2)
plotnpSurv2.3D(x2.npSurv2)
Uses a heat map to visualize a nonparametric bivariate survival function
Description
Plots a heat map of an estimated nonparametric bivariate survival function. This function is a wrapper for the image function with default parameters chosen to make the data easier to visualize.
Usage
plotnpSurv2.HM(
npSurv2.obj,
contour = TRUE,
col = terrain.colors(100),
xlab = "T1",
ylab = "T2",
...
)
Arguments
npSurv2.obj |
Output of the npSurv2 function. |
contour |
Should contour lines be added to the plot? Defaults to TRUE. |
col |
List of colors for the heat map. Defaults to terrain.colors(100). |
xlab |
The x-axis label. Defaults to "T1". |
ylab |
The y-axis label. Defaults to "T2". |
... |
Additional parameters to the image function. |
See Also
Examples
x <- genClayton2(1000, 0, 1, 1, 2, 2)
x.npSurv2 <- npSurv2(x$Y1, x$Y2, x$Delta1, x$Delta2)
plotnpSurv2.HM(x.npSurv2)
x2 <- genClayton2(1000, 2, 1, 1, 2, 2)
x2.npSurv2 <- npSurv2(x2$Y1, x2$Y2, x2$Delta1, x2$Delta2)
plotnpSurv2.HM(x2.npSurv2)
Creates an example of a matrix of time-varying covariates
Description
Given a set of (non-time-varying) covariates, creates a simple example of a matrix of time-varying covariates that can be used as input data for the mHR2.tvc function.
Usage
tvc.example(Y1, Y2, Delta1, Delta2, X)
Arguments
Y1 , Y2 |
Vectors of event times (continuous). |
Delta1 , Delta2 |
Vectors of censoring indicators (1=event, 0=censored). |
X |
Matrix of covariates (continuous or binary). |
Value
A list containing the following elements:
- ids:
A vector of ids
- X.tv:
Time-varying covariate matrix
Details
For each (non-time-varying) covariate in X, two time-varying covariates are created. The first time-varying covariate is equal to Xlog(T1), and the second is equal to Xlog(T2). (If T=0, then the time-varying covariate is set to be 0.) A vector of ID numbers and a matrix of time-varying covariates are created in a format that can be passed to the mHR2.tvc function.
See Also
Examples
x <- genClaytonReg(250, 2, 0.5, 1, 1, 0, log(2), 0, 5, 5)
x.tv <- tvc.example(x$Y1, x$Y2, x$Delta1, x$Delta2, x$X)