TimeDepFrail: Time-Dependent Shared Frailty Cox Models in R

TimeDepFrail is the ultimate R package for fitting and analyzing Time-Dependent Shared Frailty Cox Models. These models extend the traditional Shared (Gamma) Frailty Cox Models by incorporating a time-dependent frailty component, making it a robust tool for studying how unexplained heterogeneity in data evolves over time.

This package implements the methods discussed in “Centre-Effect on Survival After Bone Marrow Transplantation: Application of Time-Dependent Frailty Models” by C.M. Wintrebert et al. (2004).

Installation

You can install the development version of the package from GitHub:

devtools::install_github("alessandragni/TimeDepFrail")

Dataset data_dropout

The data_dropout dataset is used to exemplify the package. It tracks the academic progress of students enrolled in 2012 over three academic years (six semesters). This dataset aims to explore the factors leading to student dropout.

The dataset is composed of four variables:

Students are followed for a maximum of 6 semesters (3 academic years), from the end of first semester until they drop out or the follow-up ends.

Model execution

To fit a Time-Dependent Shared Frailty model, the following elements are required:

Once these elements are prepared, you can call the desired model using the AdPaikModel() function.

For full examples, refer to the Examples/ReplicationCode.R script.

Additionally, for guidance on selecting model parameters such as time_axis, categories_range_min and categories_range_max, we recommend base these choices on insights gained after fitting a Time-Unvarying Shared Frailty model. You can find a relevant example in the Examples/ReplicationCode.R, in the Appendix D Section.

Analyzing results

Several built-in methods are available to analyze the results of the fitted model:

These methods provide insightful visualizations and summaries to help you interpret your model results effectively.

Furthermore, also a support function suitable for the choice of the range of parameters and analysis of the 1D log-likelihood is available, AdPaik_1D().

To be aware of

Authors and maintainers of the code

Alessandra Ragni (alessandra.ragni@polimi.it), Giulia Romani (giulia.romani@mail.polimi.it), Chiara Masci (chiara.masci@polimi.it).