Learn R Programming

surveil: Public health surveillance

The surveil R package provides time series models for routine public health surveillance tasks: model time trends in mortality or disease incidence rates to make inferences about levels of risk, cumulative and period percent change, age-standardized rates, and health inequalities.

surveil is an interface to Stan, a state-of-the-art platform for Bayesian inference. For analysis of spatial health data see the geostan R package.

Installation

surveil is available on CRAN; install from R using:

install.packages("surveil")

Vignettes

Review the package vignettes to get started:

  • vignette("demonstration"): An introduction to health modeling with surveil
  • vignette("age-standardization"): How to age-standardize surveil model results and compare age-stratified populations

Also see the online documentation.

Usage

Model time series data of mortality or disease incidence by loading the surveil package into R together with disease surveillance data. Tables exported from CDC WONDER are automatically in the correct format.

library(surveil)
library(knitr)
data(cancer)

kable(head(cancer), 
      booktabs = TRUE,
      caption = "Table 1. A glimpse of cancer surveillance data")
YearAgeCountPopulation
1999<18663708753
19991-4295914991152
19995-9222620146188
199910-14244719742631
199915-19387519585857
199920-24596918148795

Model trends in risk and easily view functions of risk estimates, such as cumulative percent change:

fit <- stan_rw(data = cancer,
               time = Year, 
               group = Age,
           cores = 4 # multi-core processing for speed
           )

fit_apc <- apc(fit)
plot(fit_apc, cumulative = TRUE)

Copy Link

Version

Install

install.packages('surveil')

Monthly Downloads

269

Version

0.3.0

License

GPL (>= 3)

Issues

Pull Requests

Stars

Forks

Maintainer

Connor Donegan

Last Published

July 8th, 2024

Functions in surveil (0.3.0)

plot.theil

Methods for Theil's index
surveil_diff

Methods for surveil_diff objects
theil

Theil's inequality index
waic

Widely Applicable Information Criteria
standardize

Age-standardized rates
surveil-package

The 'surveil' package
standard

2000 U.S. standard million population
plot.surveil

Methods for fitted surveil models
cancer

US cancer incidence by age, 1999-2017
apc

Annual and cumulative percent change
print.stand_surveil

Methods for age-standardized rates
priors

Prior distributions
print.apc

Methods for APC objects
group_diff

Measures of pairwise inequality
stan_rw

Time series models for mortality and disease incidence
msa

Colorectal cancer incidence by Texas MSA, 1999-2017, ages 50-79