HazReg is an R package for fitting parametric hazard-based regression models
for survival data in both the overall survival and relative (net) survival
frameworks. The package is built around the General Hazard (GH) structure,
which nests the most widely used hazard regression models as special cases:
| Model | Abbreviation | Special case of GH |
|---|---|---|
| General Hazard | GH | — |
| Proportional Hazards | PH | ✓ |
| Accelerated Failure Time | AFT | ✓ |
| Accelerated Hazards | AH | ✓ |
Models are fitted by maximum likelihood via nlminb and optim. Users should
specify initial values and verify convergence of the optimisation, as is standard
practice for these routines.
# install.packages("devtools")
devtools::install_github("FJRubio67/HazReg")
library(HazReg)| Function | Framework | Description |
|---|---|---|
GHMLE |
Overall survival | Fits GH, PH, AFT, and AH models |
GEHMLE |
Relative (excess) survival | Fits excess hazard versions of the above |
simGH |
— | Simulates survival times from a GH structure |
For full documentation: ?GHMLE, ?GEHMLE, ?simGH
Both GHMLE and GEHMLE support the following parametric baseline hazards.
All positive parameters are log-transformed for unconstrained optimisation.
| Distribution | Key | GH | PH | AFT | AH |
|---|---|---|---|---|---|
| Power Generalised Weibull | PGW | ✓ | ✓ | ✓ | ✓ |
| Exponentiated Weibull | EW | ✓ | ✓ | ✓ | ✓ |
| Generalised Gamma | GenGamma | ✓ | ✓ | ✓ | ✓ |
| Gamma | Gamma | ✓ | ✓ | ✓ | ✓ |
| Log-normal | LogNormal | ✓ | ✓ | ✓ | ✓ |
| Log-logistic | LogLogistic | ✓ | ✓ | ✓ | ✓ |
| Weibull | Weibull | — | ✓ | ✓ | ✓ |
Hazard and related functions (PDF, CDF, survival) are also exported directly,
e.g. ?hpgw, ?hggama.
- Overall survival: HazReg models — RPubs
- Overall survival: HazReg models — Quarto Pub
- Relative survival: Excess hazard models — RPubs
- Simulating from a GH structure — RPubs
- Simulating from a GH structure with flexible baseline — RPubs
- Short course on Parametric Survival Analysis
- HazReg.jl — Julia implementation
- MEGH — GH models for clustered survival data
- SimLT — Simulating survival times from life tables
If you use HazReg in your work, please cite the package and the relevant
methodological papers linked in the tutorials above.