Title: | Nonparametric and Semiparametric Methods for Multivariate Failure Time Data |
---|---|
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. |
Authors: | Eric Bair [aut, cre], Taylor Petty [aut], Shanshan Zhao [aut] |
Maintainer: | Eric Bair <[email protected]> |
License: | GPL-3 |
Version: | 0.2.3 |
Built: | 2024-10-25 04:16:25 UTC |
Source: | https://github.com/cran/mhazard |
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.
data(anemia)
data(anemia)
A data frame with 64 rows and 5 variables:
Treatment group, either cyclosporine and methotrexate (CSPMTX) or methotrexate only (MTX).
Time in days to severe (stage >=2) acute graft versus host disease, death, or last contact.
Patient assigned to laminar air flow isolation room at baseline. LAF = 1 signifies yes, LAF = 0 signifies no.
Age of patient in years.
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.
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.
Prentice, R., Zhao, S. "The statistical analysis of multivariate failure time data: A marginal modeling approach", CRC Press (2019).
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.
data(bladder)
data(bladder)
A data frame with 86 rows and 13 variables:
Placebo vs treatment (thiotepa).
Number of tumors present at baseline, with 8 denoting 8 or more.
Size of largest tumor at baseline, in centimeters.
Censor time, in months.
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.
See T1.
See T1.
See T1.
See T1.
See T1.
See T1.
See T1.
See T1.
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.
Prentice, R., Zhao, S. "The statistical analysis of multivariate failure time data: A marginal modeling approach", CRC Press (2019).
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).
data(clayton_sim)
data(clayton_sim)
A data frame with 150 rows and 5 variables:
Parameter value in Clayton-Oakes model.
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.
I(T_1=S_1), i.e. 1 if T_1 = S_1 and 0 otherwise.
See S1.
See d1.
Table 3.4, page 70 of Prentice and Zhao 2019.
Prentice, R., Zhao, S. "The statistical analysis of multivariate failure time data: A marginal modeling approach", CRC Press (2019).
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.
genClayton2(n, theta, lambda10, lambda01, lambdaC1, lambdaC2)
genClayton2(n, theta, lambda10, lambda01, lambdaC1, lambdaC2)
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. |
A data frame containing the following elements:
Survival times for the simulated data
Censoring indicators for the simulated data
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).
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).
x <- genClayton2(1000, 0, 1, 1, 2, 2)
x <- genClayton2(1000, 0, 1, 1, 2, 2)
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.
genClayton3(n, theta, lambdaC1, lambdaC2, lambdaC3)
genClayton3(n, theta, lambdaC1, lambdaC2, lambdaC3)
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. |
A data frame containing the following elements:
Survival times for the simulated data
Censoring indicators for the simulated data
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).
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).
x <- genClayton3(200, 0, 0.5, 0.5, 0.5)
x <- genClayton3(200, 0, 0.5, 0.5, 0.5)
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.
genClaytonReg( n, theta, Xp, lambda10, lambda01, b10, b01, b11, lambdaC1, lambdaC2 )
genClaytonReg( n, theta, Xp, lambda10, lambda01, b10, b01, b11, lambdaC1, lambdaC2 )
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. |
A data frame containing the following elements:
Survival times for the simulated data
Censoring indicators for the simulated data
X |
Covariate matrix (of dimension n x 1). |
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).
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).
x <- genClaytonReg(1000, 2, 0.5, 1, 1, log(2), log(2), log(8/3), 2, 2)
x <- genClaytonReg(1000, 2, 0.5, 1, 1, log(2), log(2), log(8/3), 2, 2)
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.
mHR2(Y1, Y2, Delta1, Delta2, X)
mHR2(Y1, Y2, Delta1, Delta2, X)
Y1 , Y2
|
Vectors of event times (continuous). |
Delta1 , Delta2
|
Vectors of censoring indicators (1=event, 0=censored). |
X |
Matrix of covariates (continuous or binary). |
A list containing the following elements:
Original vectors of event times
Original vectors of censoring indicators
Original covariate matrix
Total number of events for the first/second outcome
Total number of double events
Regression coefficient estimates
Baseline hazard estimates
Sandwich estimates of the standard deviation of the regression coefficients
Standard deviation estimates for the regression coefficients based on a univariate Cox model
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
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)
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)
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.
mHR2.LF( mHR2.obj, X0_out, X1_out, T1_out, T2_out, confidence = c("none", "CI", "CB"), n.boot = 100 )
mHR2.LF( mHR2.obj, X0_out, X1_out, T1_out, T2_out, confidence = c("none", "CI", "CB"), n.boot = 100 )
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". |
A list containing the following elements:
Total number of events for the first/second outcome
Total number of double events
Regression coefficient estimates
Baseline hazard estimates
Estimates of Lambda11 at T1_out, T2_out for X=X0_out and X=X1_out
Estimates of F at T1_out, T2_out for X=X0_out and X=X1_out
Lower and upper bounds for Lambda11 at X=X0_out
Lower and upper bounds for Lambda11 at X=X1_out
Lower and upper bounds for F at X=X0_out
Lower and upper bounds for F at X=X1_out
Lower and upper bounds for Lambda11 at X=X0_out, at three T1_out, T2_out combinations
Lower and upper bounds for Lambda11 at X=X1_out, at three T1_out, T2_out combinations
Lower and upper bounds for F at X=X0_out, at three T1_out, T2_out combinations
Lower and upper bounds for F at X=X1_out, at three T1_out, T2_out combinations
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".
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.
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")
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")
Fits a semiparametric Cox regression model for a bivariate outcome with time-varying covariates. Currently only the regression coefficients are computed.
mHR2.tvc(Y1, Y2, Delta1, Delta2, ids, X)
mHR2.tvc(Y1, Y2, Delta1, Delta2, ids, X)
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. |
A list containing the following elements:
Regression coefficient estimates
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.
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
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)
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)
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.
npSurv2( Y1, Y2, Delta1, Delta2, newT1 = NULL, newT2 = NULL, estimator = c("dabrowska", "volterra", "prentice-cai"), conf.int = FALSE, R = 1000, ... )
npSurv2( Y1, Y2, Delta1, Delta2, newT1 = NULL, newT2 = NULL, estimator = c("dabrowska", "volterra", "prentice-cai"), conf.int = FALSE, R = 1000, ... )
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. |
A list containing the following elements:
Unique uncensored Y1 values
Unique uncensored Y2 values
Estimated bivariate survival function (computed at T1, T2)
Lower 95% confidence bounds for Fhat
Upper 95% confidence bounds for Fhat
Estimated marginal survival function for T1 (computed at newT1)
Lower 95% confidence bounds for Fmarg1
Upper 95% confidence bounds for Fmarg1
Estimated marginal survival function for T2 (computed at newT2)
Lower 95% confidence bounds for Fmarg2
Upper 95% confidence bounds for Fmarg2
Estimated survival function (computed at newT1, newT2)
Lower 95% confidence bounds for F.est
Upper 95% confidence bounds for F.est
Estimated cross ratio (computed at T1, T2)
Estimated Kendall\'s tau (computed at T1, T2)
Estimated cross ratio (computed at newT1, newT2)
Estimated Kendall\'s tau (computed at newT1, newT2)
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.
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.
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)))
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)))
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.
npSurv3( Y1, Y2, Y3, Delta1, Delta2, Delta3, newT1 = NULL, newT2 = NULL, newT3 = NULL, conf.int = FALSE, R = 1000, ... )
npSurv3( Y1, Y2, Y3, Delta1, Delta2, Delta3, newT1 = NULL, newT2 = NULL, newT3 = NULL, conf.int = FALSE, R = 1000, ... )
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. |
A list containing the following elements:
Unique values of Y1 at which Fhat was computed
Unique values of Y2 at which Fhat was computed
Unique values of Y3 at which Fhat was computed
Estimated survival function (computed at T1, T2, T3)
Lower 95% confidence bounds for Fhat
Upper 95% confidence bounds for Fhat
Estimated marginal survival function for T11 (computed at newT1)
Lower 95% confidence bounds for Fmarg1
Upper 95% confidence bounds for Fmarg1
Estimated marginal survival function for T2 (computed at newT2)
Lower 95% confidence bounds for Fmarg2
Upper 95% confidence bounds for Fmarg2
Estimated marginal survival function for T3 (computed at newT3)
Lower 95% confidence bounds for Fmarg3
Upper 95% confidence bounds for Fmarg3
Estimated survival function (computed at newT1, newT2, newT3)
Lower 95% confidence bounds for F.est
Upper 95% confidence bounds for F.est
Pairwise marginal cross ratio estimator C110 (computed at newT1, newT2, newT3)
Pairwise marginal cross ratio estimator C101 (computed at newT1, newT2, newT3)
Pairwise marginal cross ratio estimator C011 (computed at new T1, newT2, newT3)
Trivariate dependency estimator C111 (computed at newT1, newT2, newT3)
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.
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.
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)
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)
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.
plotnpSurv2.3D( npSurv2.obj, col = "grey", shade = 0.25, theta = 120, xlab = "T1", ylab = "T2", zlab = "Fhat", ... )
plotnpSurv2.3D( npSurv2.obj, col = "grey", shade = 0.25, theta = 120, xlab = "T1", ylab = "T2", zlab = "Fhat", ... )
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. |
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)
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)
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.
plotnpSurv2.HM( npSurv2.obj, contour = TRUE, col = terrain.colors(100), xlab = "T1", ylab = "T2", ... )
plotnpSurv2.HM( npSurv2.obj, contour = TRUE, col = terrain.colors(100), xlab = "T1", ylab = "T2", ... )
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. |
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)
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)
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.
tvc.example(Y1, Y2, Delta1, Delta2, X)
tvc.example(Y1, Y2, Delta1, Delta2, X)
Y1 , Y2
|
Vectors of event times (continuous). |
Delta1 , Delta2
|
Vectors of censoring indicators (1=event, 0=censored). |
X |
Matrix of covariates (continuous or binary). |
A list containing the following elements:
A vector of ids
Time-varying covariate matrix
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.
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)
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)