Skip to content

STAPM/smkfreediv2

Repository files navigation

Estimating the smoke-free dividend

Project Status: WIP – Initial development is in progress, but there has not yet been a stable, usable release suitable for the public.

Motivation

The motivation for smkfreediv2 is to develop a set of standard functions for obtaining and processing raw data from OHID local tobacco profiles and combining this with data from the Smoking Toolkit Study (STS) to produce estimates of the smoke-free dividend for local authorities in England.

The package uses the methods developed in Morris et al. (2024), which should be cited with any use of this code.

Usage

The smkfreediv2 package contains functions which read in raw data files, process them into clean output variables, and combines all data files into a single output data table. The inputs are the raw Smoking Toolkit Study (STS) data files in SPSS data format.

The package uses data on smoking prevalence from the Office for Health Improvement and Disparities (OHID) local tobacco profiles. The functions in the package download these data using a separate R package. To use smkfreediv2 you will also need to install fingertipsR.

# Enable repository from ropensci
options(repos = c(
  ropensci = 'https://ropensci.r-universe.dev',
  CRAN = 'https://cloud.r-project.org'))

# Download and install fingertipsR in R
install.packages('fingertipsR')

Installation

smkfreediv2 is available on GitHub. If you are on a Windows machine you will also need to install Rtools.
Once that is sorted, you can install the latest version or a specified version from GitHub with:

#install.packages("devtools")
#install.packages("getPass")
#install.packages("git2r")

devtools::install_git(
  "https://github.com/STAPM/smkfreediv2.git", 
  ref = "x.x.x",
  build_vignettes = TRUE
)

Reference

Morris D, Gillespie D, Dockrell MJ, et al. Potential smoke-free dividend across local areas in England: a cross-sectional analysis Tobacco Control Published Online First: 20 March 2024. doi: 10.1136/tc-2023-058264

About

No description, website, or topics provided.

Resources

License

AGPL-3.0, AGPL-3.0 licenses found

Licenses found

AGPL-3.0
LICENSE
AGPL-3.0
LICENSE.md

Stars

Watchers

Forks

Packages

No packages published

Languages