-
Notifications
You must be signed in to change notification settings - Fork 1
/
README.Rmd
96 lines (72 loc) · 3.34 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
---
output:
github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, echo = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "README-"
)
```
# episensr <img src="man/figures/logo.png" align="right" width=120 />
<!-- badges: start -->
[![R-CMD-check](https://github.com/dhaine/episensr/actions/workflows/check-standard.yaml/badge.svg)](https://github.com/dhaine/episensr/actions/workflows/check-standard.yaml)
[![CRAN_Status_Badge](http://www.r-pkg.org/badges/version/episensr)](https://cran.r-project.org/package=episensr)
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.8299430.svg)](https://doi.org/10.5281/zenodo.8299430)
[![Codecov test
coverage](https://codecov.io/gh/dhaine/episensr/branch/master/graph/badge.svg)](https://app.codecov.io/gh/dhaine/episensr/tree/master)
[![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)
[![Total CRAN downloads](https://cranlogs.r-pkg.org/badges/grand-total/episensr)](https://cran.r-project.org/package=episensr)
<!-- badges: end -->
The R package **episensr** allows to do basic sensitivity analysis of
epidemiological results as described in **Applying Quantitative Bias Analysis to
Epidemiological Data** by Timothy L. Lash, Matthew P. Fox, and Aliza K. Fink
(ISBN: 978-0-387-87960-4,
[bias.analysis](https://sites.google.com/site/biasanalysis/)).
## License
This package is free and open source software, licensed under GPL2.
## Citation
To cite **episensr**, please use:
```{r}
citation("episensr")
```
## Example
We will use a case-control study by
[Stang et al.](https://pubmed.ncbi.nlm.nih.gov/16523014/) on the relation
between mobile phone use and uveal melanoma.
The observed odds ratio for the association between regular mobile phone use vs.
no mobile phone use with uveal melanoma incidence is 0.71 [95% CI 0.51-0.97].
But there was a substantial difference in participation rates between cases and
controls (94% vs 55%, respectively) and so selection bias could have an impact
on the association estimate.
The 2X2 table for this study is the following:
| | regular use | no use |
|----------|-------------|--------|
| cases | 136 | 107 |
| controls | 297 | 165 |
We use the function `selection` as shown below.
```{r}
library(episensr)
selection(matrix(c(136, 107, 297, 165),
dimnames = list(c("UM+", "UM-"), c("Mobile+", "Mobile-")),
nrow = 2, byrow = TRUE),
bias_parms = c(.94, .85, .64, .25))
```
The 2X2 table is provided as a matrix and selection probabilities given with the
argument `bias_parms`, a vector with the 4 probabilities (guided by the participation
rates in cases and controls) in the following order: among cases exposed, among
cases unexposed, among noncases exposed, and among noncases unexposed.
The output shows the observed 2X2 table, the observed odds ratio (and relative
risk) followed by the corrected ones.
## Installation
You can get the latest release from **CRAN**:
```{r, eval=FALSE}
install.packages('episensr')
```
Or install the development version from **GitHub** with **devtools** package:
```{r, eval=FALSE}
#install.packages("remotes")
remotes::install_github('dhaine/episensr', ref = "develop")
```