/
README.Rmd
51 lines (35 loc) · 2.06 KB
/
README.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
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE, message = FALSE, warning = FALSE)
library(ggplot2)
```
# PMerc
Pariculate Matter (PM) Exposure-Response Curves (ERCs)
This R provides a lean set of code for computing specific values from an exposure-response curve developed using the [`bercs`](http://www.github.com/jpkeller/bercs) R package. This package contains two elements:
* **Data** objects containing the minimal set of information needed to calculate the full ERC or any desired values from it. Data files are provided for published ERC curves (see examples below).
* **Functions**. Currently, there are four R functions included (including `compute_OR2()`), which are derived from functions of similar name from the `bercs` package (e.g. `compute_OR`). They are included here in `PMerc` to facilitate calculating ERC values without requiring the full `bercs` package, which requires compiled C code for the STAN model objects. This package is recommended only for calculating specific risk measures from the accompanying data files. If developing your own models, it is recommended to use the functions in the `bercs` package and not these. It is possible that these functions may be removed at a future date.
To install `PMerc`, use the following commands:
```
devtools::install_github("jpkeller/PMerc")
```
## Example: PM-ALRI Curve Values
```{r}
library(PMerc)
library(splines2)
data(nepal_pm_alri)
compute_OR2(
expsequence = c(35, 37.5, 50, 75, 100, 150, 200, 400),
ref_exposure=50,
ciband=0.95,
beta_post=nepal_pm_alri$posterior_params$beta,
bs_post=nepal_pm_alri$posterior_params$bS,
xdf=nepal_pm_alri$model_data$xdf,
nS=nepal_pm_alri$model_data$S,
Mx=nepal_pm_alri$model_data$Mx,
Mx_attributes = nepal_pm_alri$model_data$Mx_attributes)
```
## Community guidelines
If you have a bug to report, are having technical issues, or want to recommend features, please open a [Github Issue](https://github.com/jpkeller/bercs/issues).