-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.Rmd
63 lines (44 loc) · 2.19 KB
/
index.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
---
output:
md_document:
variant: markdown_github
editor_options:
chunk_output_type: console
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
## surveil: Public health surveillance
<img src="man/figures/logo.png" align="right" width="160" />
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](https://mc-stan.org), a state-of-the-art platform for Bayesian inference. For analysis of spatial health data see the [*geostan*](https://connordonegan.github.io/geostan/) R package.
### Installation
*surveil* is available on CRAN; install from R using:
```{r eval = FALSE}
install.packages("surveil")
```
### Vignettes
Review the package vignettes to get started:
- `vignette("surveil-demo")`: An introduction to public health modeling with *surveil*
- `vignette("age-standardization")`: How to age-standardize *surveil* model results
- `vignette("measuring-inequality")`: Assessing pairwise health differences with measures of inequality
- `vignette("surveil-mcmc")`: A brief introduction to Markov chain Monte Carlo (MCMC) with *surveil*
Also see the online [documentation](https://connordonegan.github.io/surveil/reference/index.html).
### 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.
```{r}
library(surveil)
library(knitr)
data(cancer)
kable(head(cancer),
booktabs = TRUE,
caption = "Table 1. A glimpse of cancer surveillance data")
```
Model trends in risk and easily view functions of risk estimates, such as cumulative percent change:
```{r eval = FALSE}
fit <- stan_rw(data = cancer,
time = Year,
group = Age)
fit_apc <- apc(fit)
plot(fit_apc, cumulative = TRUE)
```
<img src="man/figures/cpc-plot.png" align="center" width="800" />
*Cumulative percent change in US cancer incidence by age group*