Package: TemporalHazard 1.1.0

John Ehrlinger

TemporalHazard: Temporal Parametric Hazard Modeling

Provides native R implementations of the multiphase parametric hazard model of Blackstone, Naftel, and Turner (1986) <doi:10.1080/01621459.1986.10478314> with a focus on behavioral parity, transparent numerics, and reproducible validation against reference outputs from the original 'C'/'SAS' HAZARD program, originally developed at the University of Alabama at Birmingham (UAB). The 'SAS'/'C' code and this R package are currently developed and maintained at The Cleveland Clinic Foundation, and the R code was wholly developed at The Cleveland Clinic Foundation. The generalized temporal decomposition family extends to longitudinal mixed-effects settings (Rajeswaran et al. 2018 <doi:10.1177/0962280215623583>). The package is intentionally implemented in pure R first; performance-critical paths may later be accelerated with 'Rcpp' without changing the public interface.

Authors:John Ehrlinger [aut, cre, cph]

TemporalHazard_1.1.0.tar.gz
TemporalHazard_1.1.0.tar.gz(r-4.7-any)TemporalHazard_1.1.0.tar.gz(r-4.6-any)
TemporalHazard_1.1.0.tgz(r-4.6-emscripten)
manual.pdf |manual.html
card.svg |card.png
TemporalHazard/json (API)
NEWS

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

Bug tracker:https://github.com/ehrlinger/temporal_hazard/issues

Pkgdown/docs site:https://ehrlinger.github.io

Datasets:
  • avc - AVC: Atrioventricular Canal Repair
  • cabgkul - CABGKUL: Primary Isolated Coronary Artery Bypass Grafting
  • omc - OMC: Open Mitral Commissurotomy
  • tga - TGA: Transposition of the Great Arteries
  • valves - Valves: Primary Heart Valve Replacement

On CRAN:

Conda:

quarto

3.94 score 11 scripts 309 downloads 20 exports 3 dependencies

Last updated from:7010bfd109. Checks:4 OK. Indexed: no.

TargetResultTimeFilesSyslog
linux-devel-x86_64OK200
source / vignettesOK291
linux-release-x86_64OK185
wasm-releaseOK121

Exports:hazardhzr_argument_mappinghzr_bootstraphzr_calibratehzr_clamp_probhzr_competing_riskshzr_decileshzr_decomposhzr_decompos_g3hzr_gofhzr_kaplanhzr_log1mexphzr_log1pexphzr_nelsonhzr_phasehzr_phase_cumhazhzr_phase_hazardhzr_stepwiseis_hzr_phasestepwise_trace

Dependencies:latticeMatrixsurvival

Complete Clinical Analysis Walkthrough

Rendered fromclinical-analysis-walkthrough.qmdusingquarto::htmlon Jun 12 2026.

Last update: 2026-05-30
Started: 2026-05-30

Fitting Hazard Models

Rendered fromfitting-hazard-models.qmdusingquarto::htmlon Jun 12 2026.

Last update: 2026-06-12
Started: 2026-05-30

Getting Started with TemporalHazard

Rendered fromgetting-started.qmdusingquarto::htmlon Jun 12 2026.

Last update: 2026-05-30
Started: 2026-05-30

Inference & Diagnostics

Rendered frominference-diagnostics.qmdusingquarto::htmlon Jun 12 2026.

Last update: 2026-06-12
Started: 2026-05-30

Mathematical Foundations of TemporalHazard

Rendered frommf-mathematical-foundations.qmdusingquarto::htmlon Jun 12 2026.

Last update: 2026-06-12
Started: 2026-05-30

Migrating from SAS HAZARD to TemporalHazard

Rendered fromsas-to-r-migration.qmdusingquarto::htmlon Jun 12 2026.

Last update: 2026-05-30
Started: 2026-05-30

Package Architecture

Rendered fromar-architecture.qmdusingquarto::htmlon Jun 12 2026.

Last update: 2026-05-30
Started: 2026-05-30

Prediction & Visualization

Rendered fromprediction-visualization.qmdusingquarto::htmlon Jun 12 2026.

Last update: 2026-05-30
Started: 2026-05-30

Readme and manuals

Help Manual

Help pageTopics
AVC: Atrioventricular Canal Repairavc
CABGKUL: Primary Isolated Coronary Artery Bypass Grafting (KU Leuven)cabgkul
Extract coefficients from hazard modelcoef.hazard
Build and optionally fit a hazard modelhazard
Legacy HAZARD to TemporalHazard argument mappinghzr_argument_mapping
Bootstrap resampling for hazard model coefficientshzr_bootstrap print.hzr_bootstrap
Calibrate a continuous variable against an outcomehzr_calibrate
Clamp probabilities away from 0 and 1hzr_clamp_prob
Competing risks cumulative incidencehzr_competing_risks print.hzr_competing_risks
Decile-of-risk calibrationhzr_deciles
Generalized temporal decompositionhzr_decompos
Late-phase (G3) temporal decompositionhzr_decompos_g3
Goodness-of-fit: observed vs. predicted eventshzr_gof
Kaplan-Meier survival with exact logit confidence limitshzr_kaplan
Numerically stable log(1 - exp(-x)) for x > 0hzr_log1mexp
Numerically stable log(1 + exp(x))hzr_log1pexp
Wayne Nelson cumulative hazard estimator with lognormal confidence limitshzr_nelson print.hzr_nelson
Specify a single hazard phasehzr_phase print.hzr_phase
Cumulative hazard contribution from a single phasehzr_phase_cumhaz
Instantaneous hazard contribution from a single phasehzr_phase_hazard
Stepwise covariate selection for a parametric hazard modelas.data.frame.hzr_stepwise hzr_stepwise print.hzr_stepwise print.summary.hzr_stepwise summary.hzr_stepwise
Test if an object is an hzr_phaseis_hzr_phase
OMC: Open Mitral Commissurotomyomc
Predict from a hazard model objectpredict.hazard
Print method for hzr_calibrateprint.hzr_calibrate
Print method for hzr_decilesprint.hzr_deciles
Print method for hzr_gofprint.hzr_gof
Print method for hzr_kaplanprint.hzr_kaplan
Extract the captured console trace from an 'hzr_stepwise' fitstepwise_trace
Summarize a hazard modelsummary.hazard
TGA: Transposition of the Great Arteriestga
Valves: Primary Heart Valve Replacementvalves
Extract variance-covariance matrix from hazard modelvcov.hazard