This R package was developed as part of the Sheffield Tobacco and Alcohol Policy Modelling https://stapm.gitlab.io/ by the School of Health and Related Research at the University of Sheffield.
The aim of the research programme is to identify and evaluate approaches to reducing the harm from tobacco and alcohol, with the aim of improving commissioning in a public health policy context, i.e. providing knowledge to support benefits achieved by policymakers.
The two objectives of the research programme are:
The STAPM modelling is not linked to the tobacco or alcohol industry and is conducted without industry funding or influence.
The code has been made open source for the following two reasons:
The code is actively being used in project work. It is being reviewed and developed all the time; more tests and checks are being added.
The repository is not intended to be maintained by an open source community wider than the development team.
The list of diseases considered in the modelling is available here https://osf.io/v945r
The code on Github (https://github.com/STAPM/tobalcepi) is a mirror of the code in a private Gitlab repository where the actual development takes place (https://gitlab.com/stapm/r-packages/tobalcepi). The code in the Github repository is linked to a repository on the Open Science Framework, which provides the doi for the package citation (https://osf.io/xq8mv/).
Gillespie D, Webster L, Henney M, Brennan A, Angus C ([YEAR]). tobalcepi: An R Package for Computing the Relative Risks and Population Attributable Fractions of Diseases Related to Tobacco and Alcohol. R package version [x.x.x]. University of Sheffield. https://stapm.github.io/tobalcepi/. doi: https://doi.org/10.17605/OSF.IO/XQ8MV
The motivation for tobalcepi
was to organise how we store, process and use the information on the risks of disease that stem from tobacco and/or alcohol consumption, including to provide functions to easily use these risk estimates in modelling.
tobalcepi
was created as part of a programme of work on the health economics of tobacco and alcohol at the School of Health and Related Research (ScHARR), The University of Sheffield. This programme is based around the development of the Sheffield Tobacco and Alcohol Policy Modelling (STAPM), which aims to use comparable methodologies to evaluate the impacts of tobacco and alcohol policies, and investigate the consequences of clustering and interactions between tobacco and alcohol consumption behaviours.
The disease lists and risk functions in this package all have published sources, which we have referenced (Angus et al. 2018; Webster et al. 2018). We have written some working technical descriptions to explain how these risk functions are implemented in STAPM. In order to obtain mathematical descriptions of the risk functions for use in modelling, we needed to contact some authors to ask for additional information.
The high-level function for alcohol is tobalcepi::RRalc()
, which calculates individual risks of diseases as follows:
tobalcepi::RRalc()
. Updates to these risk functions must therefore be made by changing the function code.tobalcepi::PArisk()
, which is called by tobalcepi::RRalc()
.tobalcepi::WArisk_acute()
, which is called by tobalcepi::RRalc()
.tobalcepi::RRalc()
.tobalcepi::RRtob()
takes a lookup table of the risks associated with current vs. never smoking and assigns these to individuals based on their smoking state, age and sex (Webster et al. 2018).tobalcepi::RRTobDR()
to stratify the risks of some cancers according to the amount smoked per day by current smokers. There is limited info on these dose-response effects, so we are gradually building up the epidemiological detail in this area as we review, critically appraise and integrate new risk data into our modelling.Lag times are the information on the delay between a change to tobacco or alcohol consumption and the decline in the risk of disease associated with that consumption. The relevant functions are tobalcepi::TobLags()
(which uses lags stored in tobalcepi::tobacco_lag_times
) and tobalcepi::AlcLags()
(which contains lags hard-coded into the function).
We use estimates of potential tobacco - alcohol risk interactions for:
These estimates are stored in tobalcepi::tob_alc_risk_int
.
Some useful, not risk-bearing, data is stored within the package and is installed onto your computer when you download and load the package. We use package data for data that is likely to be used across several projects, that it is important to keep standardised across projects, and is only likely to need updating after a long interval e.g. at least annually.
The types of data included in tobalcepi are:
When these data need to be updated, the inputs and code in the package folder data-raw
will need to be changed, and the package rebuild with a new version.
tobalcepi
is a package for predicting individual risk of disease due to tobacco and alcohol consumption based on published sources, and summarising that risk. The suite of functions within tobalcepi
processes the published data on the relative risks of disease that stem from chronic and acute alcohol consumption, from smoking, and on the decline in risk after ceasing or reducing consumption. The package also includes functions to estimate population attributable fractions, and to explore the interaction between the disease risks that stem from tobacco and alcohol consumption.
The inputs are the published estimates of relative risk for each disease (sometimes stratified by population subgroup).
The processes applied by the functions in tobalcepi
give options to estimate:
The outputs of these processes are datasets in which an individual’s tobacco and/or alcohol consumption has been matched to their relative risks of certain diseases, and aggregated datasets that summarise the risks of disease within certain population subgroups.
tobalcepi
is publicly available via Github.
By default the user should install the latest tagged version of the package. Otherwise, if you want to reproduce project work and know the version of the package used, install that version.
If on a University of Sheffield managed computer, install the R, RStudio and Rtools bundle from the Software Centre. Install Rtools - using the installr package can make this easier. Then install the latest or a specified version of tobalcepi
from Github with:
#install.packages("devtools")
devtools::install_git(
"https://github.com/stapm/tobalcepi.git",
ref = "x.x.x",
build_vignettes = FALSE)
# ref = "x.x.x" is the version to install - change to the version you want e.g. "1.2.3"
Or clone the package repo locally and use the ‘install and restart’ button in the Build tab of RStudio. This option is more convenient when testing development versions.
Then load the package, and some other packages that are useful. Note that the code within tobalcepi
uses the data.table::data.table()
syntax.