| Title: | Yang and Prentice Model with Piecewise Exponential Baseline Distribution |
|---|---|
| Description: | Semiparametric modeling of lifetime data with crossing survival curves via Yang and Prentice model with piecewise exponential baseline distribution. Details about the model can be found in Demarqui and Mayrink (2019) <arXiv:1910.02406>. Model fitting carried out via likelihood-based and Bayesian approaches. The package also provides point and interval estimation for the crossing survival times. |
| Authors: | Fabio Demarqui [aut, cre] |
| Maintainer: | Fabio Demarqui <[email protected]> |
| License: | GPL (>= 2) |
| Version: | 1.0.1 |
| Built: | 2026-10-29 10:00:08 UTC |
| Source: | https://github.com/cran/YPPE |
Semiparametric modeling of lifetime data with crossing survival curves via Yang and Prentice model with piecewise exponential baseline distribution curves. Details about the model can be found in Demarqui and Mayrink (2019) <arXiv:1910.02406>. Model fitting carried out via likelihood-based and Bayesian approaches. The package also provides point and interval estimation for the crossing survival times.
Demarqui, F. N. and Mayrink, V. D. (2019). A fully likelihood-based approach to model survival data with crossing survival curves. <arXiv:1910.02406>
Stan Development Team (2019). RStan: the R interface to Stan. R package version 2.19.2. https://mc-stan.org
Yang, S. and Prentice, R. L. (2005). Semiparametric analysis of short-term and long-term hazard ratios with two-sample survival data. Biometrika 92, 1-17.
Generic S3 method coef
coef(object, ...)coef(object, ...)
object |
a fitted model object |
... |
further arguments passed to or from other methods. |
the estimated regression coefficients
Estimated regression coefficients
## S3 method for class 'yppe' coef(object, ...)## S3 method for class 'yppe' coef(object, ...)
object |
an object of the class yppe |
... |
further arguments passed to or from other methods |
the estimated regression coefficients
Generic S3 method confint
confint(object, ...)confint(object, ...)
object |
a fitted model object |
... |
further arguments passed to or from other methods. |
the estimated regression coefficients
Confidence intervals for the regression coefficients
## S3 method for class 'yppe' confint(object, level = 0.95, ...)## S3 method for class 'yppe' confint(object, level = 0.95, ...)
object |
an object of the class yppe |
level |
the confidence level required |
... |
further arguments passed to or from other methods |
100(1-alpha) confidence intervals for the regression coefficients
Generic S3 method crossTime
crossTime(object, ...)crossTime(object, ...)
object |
a fitted model object |
... |
further arguments passed to or from other methods. |
the crossing survival time
Computes the crossing survival times
## S3 method for class 'yppe' crossTime(object, newdata1, newdata2, conf.level = 0.95, nboot = 4000, ...)## S3 method for class 'yppe' crossTime(object, newdata1, newdata2, conf.level = 0.95, nboot = 4000, ...)
object |
an object of class yppe |
newdata1 |
a data frame containing the first set of explanatory variables |
newdata2 |
a data frame containing the second set of explanatory variables |
conf.level |
level of the confidence/credible intervals |
nboot |
number of bootstrap samples (default nboot=4000); ignored if approach="bayes". |
... |
further arguments passed to or from other methods. |
the crossing survival time
# ML approach: library(YPPE) mle <- yppe(Surv(time, status)~arm, data=ipass, approach="mle") summary(mle) newdata1 <- data.frame(arm=0) newdata2 <- data.frame(arm=1) tcross <- crossTime(mle, newdata1, newdata2) tcross ekm <- survfit(Surv(time, status)~arm, data=ipass) newdata <- data.frame(arm=0:1) St <- survfit(mle, newdata) time <- sort(ipass$time) plot(ekm, col=1:2) lines(time, St[[1]]) lines(time, St[[2]], col=2) abline(v=tcross, col="blue") # Bayesian approach: bayes <- yppe(Surv(time, status)~arm, data=ipass, approach="bayes") summary(bayes) newdata1 <- data.frame(arm=0) newdata2 <- data.frame(arm=1) tcross <- crossTime(bayes, newdata1, newdata2) tcross ekm <- survfit(Surv(time, status)~arm, data=ipass) newdata <- data.frame(arm=0:1) St <- survfit(bayes, newdata) time <- sort(ipass$time) plot(ekm, col=1:2) lines(time, St[[1]]) lines(time, St[[2]], col=2) abline(v=tcross, col="blue")# ML approach: library(YPPE) mle <- yppe(Surv(time, status)~arm, data=ipass, approach="mle") summary(mle) newdata1 <- data.frame(arm=0) newdata2 <- data.frame(arm=1) tcross <- crossTime(mle, newdata1, newdata2) tcross ekm <- survfit(Surv(time, status)~arm, data=ipass) newdata <- data.frame(arm=0:1) St <- survfit(mle, newdata) time <- sort(ipass$time) plot(ekm, col=1:2) lines(time, St[[1]]) lines(time, St[[2]], col=2) abline(v=tcross, col="blue") # Bayesian approach: bayes <- yppe(Surv(time, status)~arm, data=ipass, approach="bayes") summary(bayes) newdata1 <- data.frame(arm=0) newdata2 <- data.frame(arm=1) tcross <- crossTime(bayes, newdata1, newdata2) tcross ekm <- survfit(Surv(time, status)~arm, data=ipass) newdata <- data.frame(arm=0:1) St <- survfit(bayes, newdata) time <- sort(ipass$time) plot(ekm, col=1:2) lines(time, St[[1]]) lines(time, St[[2]], col=2) abline(v=tcross, col="blue")
Data set from a clinical trial conducted by the Gastrointestinal Tumor Study Group (GTSG) in 1982. The data set refers to the survival times of patients with locally nonresectable gastric cancer. Patients were either treated with chemotherapy combined with radiation or chemotherapy alone.
A data frame with 90 rows and 3 variables:
time: survival times (in days)
status: failure indicator (1 - failure; 0 - otherwise)
trt: treatments (1 - chemotherapy + radiation; 0 - chemotherapy alone)
Fabio N. Demarqui [email protected]
Gastrointestinal Tumor Study Group. (1982) A Comparison of Combination Chemotherapy and Combined Modality Therapy for Locally Advanced Gastric Carcinoma. Cancer 49:1771-7.
Reconstructed IPASS clinical trial data reported in Argyropoulos and Unruh (2015). Although reconstructed, this data set preserves all features exhibited in references with full access to the observations from this clinical trial. The data base is related to the period of March 2006 to April 2008. The main purpose of the study is to compare the drug gefitinib against carboplatin/paclitaxel doublet chemotherapy as first line treatment, in terms of progression free survival (in months), to be applied to selected non-small-cell lung cancer (NSCLC) patients.
A data frame with 1217 rows and 3 variables:
time: progression free survival (in months)
status: failure indicator (1 - failure; 0 - otherwise)
arm: (1 - gefitinib; 0 - carboplatin/paclitaxel doublet chemotherapy)
Fabio N. Demarqui [email protected]
Argyropoulos, C. and Unruh, M. L. (2015). Analysis of time to event outcomes in randomized controlled trials by generalized additive models. PLOS One 10, 1-33.
Print the summary.yppe output
## S3 method for class 'summary.yppe' print(x, ...)## S3 method for class 'summary.yppe' print(x, ...)
x |
an object of the class summary.yppe. |
... |
further arguments passed to or from other methods. |
a summary of the fitted model.
Summary for the yppe model
## S3 method for class 'yppe' summary(object, ...)## S3 method for class 'yppe' summary(object, ...)
object |
an objecto of the class 'yppe'. |
... |
further arguments passed to or from other methods. |
Generic S3 method survfit
survfit(object, ...)survfit(object, ...)
object |
a fitted model object |
... |
further arguments passed to or from other methods. |
the crossing survival time
Survival function for the YPPE model
## S3 method for class 'yppe' survfit(object, newdata, ...)## S3 method for class 'yppe' survfit(object, newdata, ...)
object |
an object of the class yppe |
newdata |
a data frame containing the set of explanatory variables. |
... |
further arguments passed to or from other methods. |
a list containing the estimated survival probabilities.
# ML approach: library(YPPE) mle <- yppe(Surv(time, status)~arm, data=ipass, approach="mle") summary(mle) ekm <- survfit(Surv(time, status)~arm, data=ipass) newdata <- data.frame(arm=0:1) St <- survfit(mle, newdata) time <- sort(ipass$time) plot(ekm, col=1:2) lines(time, St[[1]]) lines(time, St[[2]], col=2) # Bayesian approach: bayes <- yppe(Surv(time, status)~arm, data=ipass, approach="bayes") summary(bayes) ekm <- survfit(Surv(time, status)~arm, data=ipass) newdata <- data.frame(arm=0:1) St <- survfit(bayes, newdata) time <- sort(ipass$time) plot(ekm, col=1:2) lines(time, St[[1]]) lines(time, St[[2]], col=2)# ML approach: library(YPPE) mle <- yppe(Surv(time, status)~arm, data=ipass, approach="mle") summary(mle) ekm <- survfit(Surv(time, status)~arm, data=ipass) newdata <- data.frame(arm=0:1) St <- survfit(mle, newdata) time <- sort(ipass$time) plot(ekm, col=1:2) lines(time, St[[1]]) lines(time, St[[2]], col=2) # Bayesian approach: bayes <- yppe(Surv(time, status)~arm, data=ipass, approach="bayes") summary(bayes) ekm <- survfit(Surv(time, status)~arm, data=ipass) newdata <- data.frame(arm=0:1) St <- survfit(bayes, newdata) time <- sort(ipass$time) plot(ekm, col=1:2) lines(time, St[[1]]) lines(time, St[[2]], col=2)
Time grid
timeGrid(time, status, n_int = NULL)timeGrid(time, status, n_int = NULL)
time |
Vector of failure times |
status |
Vector of failure indicators |
n_int |
Optional. Number of intervals. If |
Time grid.
Generic S3 method vcov
vcov(object, ...)vcov(object, ...)
object |
a fitted model object |
... |
further arguments passed to or from other methods. |
the variance-covariance matrix associated the regression coefficients.
Covariance of the regression coefficients
## S3 method for class 'yppe' vcov(object, ...)## S3 method for class 'yppe' vcov(object, ...)
object |
an object of the class yppe |
... |
further arguments passed to or from other methods. |
the variance-covariance matrix associated with the regression coefficients.
Fits the Yang and Prentice model with baseline distribution modelled by the piecewise exponential distribution.
yppe( formula, data, n_int = NULL, rho = NULL, tau = NULL, hessian = TRUE, approach = c("mle", "bayes"), hyper_parms = list(h1_gamma = 0, h2_gamma = 4, mu_psi = 0, sigma_psi = 4, mu_phi = 0, sigma_phi = 4, mu_beta = 0, sigma_beta = 4), ... )yppe( formula, data, n_int = NULL, rho = NULL, tau = NULL, hessian = TRUE, approach = c("mle", "bayes"), hyper_parms = list(h1_gamma = 0, h2_gamma = 4, mu_psi = 0, sigma_psi = 4, mu_phi = 0, sigma_phi = 4, mu_beta = 0, sigma_beta = 4), ... )
formula |
an object of class "formula" (or one that can be coerced to that class): a symbolic description of the model to be fitted. |
data |
an optional data frame, list or environment (or object coercible by as.data.frame to a data frame) containing the variables in the model. If not found in data, the variables are taken from environment(formula), typically the environment from which yppe is called. |
n_int |
number of intervals of the PE distribution. If NULL, default value (square root of n) is used. |
rho |
the time grid of the PE distribution. If NULL, the function timeGrid is used to compute rho. |
tau |
the maximum time of follow-up. If NULL, tau = max(time), where time is the vector of observed survival times. |
hessian |
logical; If TRUE (default), the hessian matrix is returned when approach="mle". |
approach |
approach to be used to fit the model (mle: maximum likelihood; bayes: Bayesian approach). |
hyper_parms |
a list containing the hyper-parameters of the prior distributions (when approach = "bayes"). If not specified, default values are used. |
... |
Arguments passed to either 'rstan::optimizing' or 'rstan::sampling' . |
yppe returns an object of class "yppe" containing the fitted model.
# ML approach: library(YPPE) mle <- yppe(Surv(time, status)~arm, data=ipass, approach="mle") summary(mle) # Bayesian approach: bayes <- yppe(Surv(time, status)~arm, data=ipass, approach="bayes") summary(bayes)# ML approach: library(YPPE) mle <- yppe(Surv(time, status)~arm, data=ipass, approach="mle") summary(mle) # Bayesian approach: bayes <- yppe(Surv(time, status)~arm, data=ipass, approach="bayes") summary(bayes)