Skip to content

Repository for a simple Markov Model that can be amended within a Shiny App

License

Notifications You must be signed in to change notification settings

NHS-Transformation-Unit/markov_example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TU logo

Markov Model - Shiny Example

This repository contains the code for creating a shiny app for running simple Markov Models.

Table of Contents

  1. Overview
  2. Using the Repository
  3. Repository Structure
  4. Contributors

Overview

This repository contains the code to create a Shiny App to demonstrate how Markov Models are constructed and how to run simple models. Markov models are used widely in health economics and epidemiology to understand how patients can move between different health states. Comparing different models with different transition probabilities can enable comparisons of employing different healthcare solutions.

The Markov Model App is available for demonstration here.

Using the Repository

To run the model locally the repository can be cloned:

git clone https://github.com/NHS-Transformation-Unit/markov_example.git
cd markov_example

Dependencies should be installed using renv.lock but please review the required packages in the app.R script.

The app can then be run using the following command in R:

library(shiny)
runApp("app.R")

Structure

The folder structure of the repository is shown below:


├───R
  └───markov_model.R
├───renv
  ├───.gitignore
  ├───activate.R
  └───settings.json
├───tests
  ├───testthat.R
├───www
  ├───images
  └───themes
├───README.md
├───renv.lock
├───.gitignore
├───markov_example.Rproj
├───.Rprofile
├───app.R
├───LICENSE

R

This folder contains the markov_model.R script. This has the necessary functions for running the markov model.

renv

Contains necessary files for renv for reproducibility and collaboration.

tests

Contains unit tests for checking the Markov Model returns correct sized matrix and that the values returned from multiple cycles are correct.

www

Contains the images and theme files used within the app. The images include diagrams of markov models and screenshots of the app. The themes include TU .css themes and ggplot themes for the app.

app.R

This is the shiny app that is deployed here.

Contributors

This repository has been created and developed by:

About

Repository for a simple Markov Model that can be amended within a Shiny App

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published