Analysis of Event Data with Two Time Scales

Analyse time to event data with two time scales by estimating a smooth hazard that varies over two time scales. If covariates are available, estimate a proportional hazards model with such a two-dimensional baseline hazard. Functions are provided to prepare the raw data for estimation, to fit the model and to plot the two-dimensional smooth hazard. Extension to a competing risks model is implemented. For details about the method please refer to Carollo et al. (2025) .


TwoTimeScales

TwoTimeScales website

TwoTimeScales

R-CMD-check

TwoTimeScales provides a suite of functions for the analysis of time to event data with two time scales.

The package provides tools to estimate a smooth hazard that varies over two time scales and also, if covariates are available, to estimate a proportional hazards model with such a two-dimensional baseline hazard. The hazard of one event is modelled by means of two-dimensional P-splines model of Poisson data with offset. Regression model to study the effect of covariates on the baseline hazard are possible in a proportional hazards fashion. Functions to plot the (baseline) hazard are also provided.

Additionally, functions to estimate cumulated surfaces (such as cumulated hazard, survival function and incidence function) over two time scales are included.

Installation

From CRAN

Just run install.packages(“TwoTimeScales”)

From GitHub

You can install the development version of TwoTimeScales from GitHub with:

# install.packages("devtools")
devtools::install_github("AngelaCar/TwoTimeScales")

Vignettes need to be explicitly requested. To install a version of the package including the vignettes, please run:

devtools::install_github("AngelaCar/TwoTimeScales",
                          dependencies = TRUE, build_vignettes = TRUE)

Vignettes can be also read online here: TwoTimeScales

How to use TwoTimeScales

A general introduction to the usage of the package is given in:

vignette("TwoTimeScales")

or here Introduction.

Further examples on can be found in the vignettes.

vignette("onetime")
vignette("twotimes")
vignette("visualization")

Acknowledgments

We are very grateful to Guillermo Briseno Sanchez, José Carlos Andrade Santacruz and Lisa Rieker for testing the package and their helpful feedback.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("TwoTimeScales")

1.3.1 by Angela Carollo, a month ago


https://github.com/AngelaCar/TwoTimeScales, https://angelacar.github.io/TwoTimeScales/


Report a bug at https://github.com/AngelaCar/TwoTimeScales/issues


Browse source code at https://github.com/cran/TwoTimeScales


Authors: Angela Carollo [aut, cre, cph] (ORCID: , Paul H.C. Eilers [aut] , Jutta Gampe [aut]


Documentation:   PDF Manual  


GPL-3 license


Imports colorspace, Epi, fields, JOPS, LMMsolver, popEpi, reshape2, spam, ucminf, viridis

Suggests knitr, rmarkdown, spelling, testthat


See at CRAN