This repository contains a simulation study of smoothed hazard functions.
There are three components of the simulation study.
- Analysis of smoothed hazard accuracy using a constant hazard function.
- Analysis of smoothed hazard accuracy using a mixture Weibull hazard function.
- Analysis of two-arm settings, estimating the proportion of hazard functions which cross when assuming a constant treatment effect (i.e. proportional hazards).
The following scripts correspond to each of these analyses:
simulations_constant.Rsimulations_mixture_weibull.Rsimulations_two_arm_relative.R
A full list of required packages is provided in each script.
Simulated datasets are estimated with the survsim package. Smoothed hazard functions evaluated include muhaz and bshazard packages. Plots are generated using ggplot and cowplot.
- Install required R packages (see the top of each script for the full list).
- From the repository root, run one of the scripts:
source("simulations_constant.R")
source("simulations_mixture_weibull.R")
source("simulations_two_arm_relative.R")Plots (PNG files) and tables (CSV files) with results will be saved into the ./results working directory.
These include plots and tables reporting the Mean Absolute Error (MAE) and Mean Absolute Percentage Error (MAPE) of the smoothed hazards across different follow-up time or numbers at risk.
The results of simulations will be saved (as an RData file) in the ./results_store working directory.
An author file is available within the repository with full author details.
✒️ Jack Williams, Thomas Haugli-Stephens, Michael J. Sweeting, Iain R. Timmins, Robert Hettle.
For questions, please contact: Jack Williams, HTA & Modelling Science, AstraZeneca — jack.williams1@astrazeneca.com