Package: TwoTimeScales 1.1.0

TwoTimeScales: 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 estimate and to plot the two-dimensional smooth hazard. Extension to a competing risks model are implemented. For details about the method please refer to Carollo et al. (2024) <doi:10.1002/sim.10297>.

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

TwoTimeScales_1.1.0.tar.gz
TwoTimeScales_1.1.0.zip(r-4.5)TwoTimeScales_1.1.0.zip(r-4.4)TwoTimeScales_1.1.0.zip(r-4.3)
TwoTimeScales_1.1.0.tgz(r-4.5-any)TwoTimeScales_1.1.0.tgz(r-4.4-any)TwoTimeScales_1.1.0.tgz(r-4.3-any)
TwoTimeScales_1.1.0.tar.gz(r-4.5-noble)TwoTimeScales_1.1.0.tar.gz(r-4.4-noble)
TwoTimeScales_1.1.0.tgz(r-4.4-emscripten)TwoTimeScales_1.1.0.tgz(r-4.3-emscripten)
TwoTimeScales.pdf |TwoTimeScales.html
TwoTimeScales/json (API)
NEWS

# Install 'TwoTimeScales' in R:
install.packages('TwoTimeScales', repos = c('https://angelacar.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/angelacar/twotimescales/issues

Pkgdown site:https://angelacar.github.io

Datasets:
  • reccolon2ts - Data from the chemotherapy for stace B/C colon cancer study

On CRAN:

Conda:

6.26 score 9 stars 5 scripts 158 downloads 22 exports 75 dependencies

Last updated 2 months agofrom:5555434bad. Checks:9 OK. Indexed: yes.

TargetResultLatest binary
Doc / VignettesOKMar 05 2025
R-4.5-winOKMar 05 2025
R-4.5-macOKMar 05 2025
R-4.5-linuxOKMar 05 2025
R-4.4-winOKMar 05 2025
R-4.4-macOKMar 05 2025
R-4.4-linuxOKMar 05 2025
R-4.3-winOKMar 05 2025
R-4.3-macOKMar 05 2025

Exports:covariates_plotcumhaz2tscuminc2tsexposures_events_1dexposures_events_2dexposures_events_Lexisfit1tsfit2tsget_hazard_1dget_hazard_1d_LMMget_hazard_2dget_hazard_2d_LMMget_hrhaz2ts_summaryhaz2tsLMM_summarymake_binspredict_cif2ts_pointwisepredict_comprisks2tspredict_haz2tspredict_haz2ts_pointwiseprepare_datasurv2ts

Dependencies:ashbitopsbootcliclustercmprskcolorspacedata.tabledotCall64dplyrEpietmfansifarverfdsfieldsFNNgenericsggplot2gluegridExtragtablehdrcdeisobandJOPSkernlabKernSmoothkslabelinglatticelifecycleLMMsolverlocfitmagrittrmapsMASSMatrixmclustmgcvmulticoolmunsellmvtnormnlmenumDerivpcaPPpillarpkgconfigplyrpopEpipracmaR6rainbowRColorBrewerRcppRcppArmadilloRCurlreshape2rlangrpartscalesSemiParspamSpATSstringistringrsurvivaltibbletidyselectucminfutf8vctrsviridisviridisLitewithrzoo

Introduction to TwoTimeScales

Rendered fromTwoTimeScales.Rmdusingknitr::rmarkdownon Mar 05 2025.

Last update: 2024-12-18
Started: 2024-04-25

Smooth hazards with one time scale

Rendered fromonetime.Rmdusingknitr::rmarkdownon Mar 05 2025.

Last update: 2024-12-18
Started: 2024-04-25

Smooth hazards with two time scales

Rendered fromtwotimes.Rmdusingknitr::rmarkdownon Mar 05 2025.

Last update: 2024-12-18
Started: 2024-04-25

Visualize hazards with two time scales

Rendered fromvisualization.Rmdusingknitr::rmarkdownon Mar 05 2025.

Last update: 2024-12-18
Started: 2024-04-25

Readme and manuals

Help Manual

Help pageTopics
Plot of the covariates' effectscovariates_plot
Cumulative hazard over two time scalescumhaz2ts
Cumulative incidence surface over two time scalescuminc2ts
Bin data on one time scaleexposures_events_1d
Bin data on two time scalesexposures_events_2d
Bin data on the Lexis diagramexposures_events_Lexis
Fit a smooth hazard model with one time scalefit1ts
Numerical optimization of the 1ts modelfit1tsmodel_ucminf
Fit a smooth hazard model with two time scalesfit2ts
Numerical optimization of the 2ts modelfit2tsmodel_ucminf
Return the AIC of 1ts modelget_aic_fit_1d
Return the AIC of 2ts modelget_aic_fit_2d
Return the BIC of 1ts modelget_bic_fit_1d
Return the BIC of 2ts modelget_bic_fit_2d
Get estimated (log-)hazard values with 1 time scaleget_hazard_1d
Get estimated (log-)hazard values with 1 time scaleget_hazard_1d_LMM
Get estimated (log-)hazard surface with 2 time scalesget_hazard_2d
Get estimated (log-)hazard surface with 2 time scalesget_hazard_2d_LMM
Get the Hazard Ratios with their Standard Errorsget_hr
Calculates AIC and BIC from object fitted via LMMsolvergetAIC_BIC_LMM
Fit the 1d GLAM with covariatesGLAM_1d_covariates
Fit the 2d GLAM with covariatesGLAM_2d_covariates
Fit the 2d GLAM without covariatesGLAM_2d_no_covariates
Grid search for the optimal 1ts modelgrid_search_1d
Grid search for the optimal 2ts modelgrid_search_2d
Summary function for object of class 'haz2ts'haz2ts_summary
Summary function for object of class 'haz2tsLMM'haz2tsLMM_summary
Image Plot of 2ts hazardimageplot_2ts
Image Plot of Standard Errors for the 2ts hazardimageplot_SE
Iterative Weighted Least Squares algorithm for 1ts modeliwls_1d
Construct bins over one or more time axesmake_bins
Plot slices of the (log-) hazardplot_slices
Plot method for a haz1ts object.plot.haz1ts
Plot method for a haz1ts object.plot.haz1tsLMM
Plot method for a haz2ts object.plot.haz2ts
Plot method for a haz2tsLMM object.plot.haz2tsLMM
Point-wise prediction of cumulative incidence over 2 time scalepredict_cif2ts_pointwise
Predict overall survival and cumulative incidence functionspredict_comprisks2ts
Prediction method for objects of class ''haz2ts''predict_haz2ts
Point-wise prediction hazard 2 time scalepredict_haz2ts_pointwise
Prepare raw data by binning them in 1d or 2dprepare_data
Process data to fit model with LMMsolverprepare_data_LMMsolver
Print method for a 'data2ts' objectprint.data2ts
Data from the chemotherapy for stace B/C colon cancer studyreccolon2ts
Survival function with two time scalessurv2ts