README.md

covid-simr

simple package containing functions to generate a projection of deaths arising from insufficent acute/ICU capacity for a given trajectory of covid19 cases requiring hospitalisation, and to model the effect of various user-defined mitigating scenarios

author: BNSSG Modelling and Analytics

version: 1.0

date: 26 March 2020

contact: bnssg.analytics@nhs.net

OVERVIEW

INPUTS

Some hospitalisation scenarios are included in the package and can be found in the symbols cases_current_strategy, cases_current_strategy_flattened, and cases_do_nothing.

ENGINE

FUNCTION ARGUMENTS

The primary function of the package is covid_simr(), which requires the following arguments:

OUTPUTS

The covid_simr() function returns a list with multiple elements:

The simulation output list also includes some element that are used in plotting functions also included with this package, namely; capand uncert.

VIEWING THE OUTPUTS

A plot containg a grid of six plots can be generated using the plot() function on the output object from covid_simr()

This mosasic plot shows:

(i) cases per day requiring hospitalisation,

(ii) occupied beds per day,

(iii) deaths resulting from insufficient capacity per day,

(iv) cumulative number of admitted patients,

(v) cumulative total of patients who could not be admitted but survived, and

(vi) cumulative total of patients who died because they could not be admitted

Additionally,

INSTALATION AND EXAMPLE USAGE

The package can be installed using {devtools} as follows:

devtools::install_github("https://github.com/nhs-bnssg-analytics/covid-simr")

A simulation can be run for a given scenario as such (for the current strategy scenario):

out <- covid_simr(cases = cases_do_nothing,
                  los_median = 3,
                  los_95 = 10,
                  cap = 45,
                  pfat = 0.99,
                  nreps = 10)

The results can plotted as follows:

plot(out)

Which will display the result interactively in the viewer, should you wish to export a PDF you can try:

pdf("filename.pdf")
plot(out)
dev.off()

Finally, the output data for the simulation can be accessed and exported as such:

output_data <- out$data

write.csv(output_data, path = "filename.csv")


nhs-bnssg-analytics/covid-simr documentation built on May 12, 2020, 4:55 p.m.