Skip to content

Repository files navigation

Smoothed Hazards Simulation

About this repository

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.R
  • simulations_mixture_weibull.R
  • simulations_two_arm_relative.R

Usage

Required packages

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.

Run the simulations

  1. Install required R packages (see the top of each script for the full list).
  2. From the repository root, run one of the scripts:
source("simulations_constant.R")
source("simulations_mixture_weibull.R")
source("simulations_two_arm_relative.R")

Outputs

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.

Stored Results

The results of simulations will be saved (as an RData file) in the ./results_store working directory.

Authors

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.

Maintainer

For questions, please contact: Jack Williams, HTA & Modelling Science, AstraZeneca — jack.williams1@astrazeneca.com

About

Smoothed Hazard Simulation Study

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages