-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathREADME.Rmd
More file actions
81 lines (62 loc) · 3.35 KB
/
README.Rmd
File metadata and controls
81 lines (62 loc) · 3.35 KB
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
---
output:
github_document:
df_print: kable
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# Automated, Reproducible Generation of Results Tables: Bridging the Rift Between Epidemiologists and Their Data
<!-- badges: start -->
[](https://github.com/stopsack/rifttable/actions/workflows/R-CMD-check.yaml)
[](https://app.codecov.io/gh/stopsack/rifttable)
[](https://CRAN.R-project.org/package=rifttable)
<!-- badges: end -->
Tables are the key format in which epidemiologists present their results. Many results tables in applied studies merely show point estimates and confidence intervals, or even p-values, from regression models: a “growing rift between epidemiologists and their data” ([Rothman 2017](https://doi.org/10.1007/s10654-017-0314-3)). “Actual,” descriptive data, such as counts stratified by exposure and a main confounder or effect modifier, are often lacking.
**rifttable** creates presentation-ready results tables for epidemiologists in an automated, reproducible fashion. The user provides the final analytical dataset and specifies the design of the table, with rows and/or columns defined by exposure(s), effect modifier(s), and estimands as desired, allowing to show descriptors and inferential estimates in one table -- bridging the rift between epidemiologists and their data, one table at a time.
## Installation
The rifttable package can be installed from CRAN:
```{r, eval = FALSE}
install.packages("rifttable")
```
Development versions can be installed from
[GitHub](https://stopsack.github.io/rifttable/) using:
```{r, eval = FALSE}
remotes::install_github("stopsack/rifttable")
```
The latter installation procedure requires the remotes package, obtainable via `install.packages("remotes")`.
## Example
```{r example}
library(rifttable)
example_design <- tibble::tribble(
~label, ~type, ~stratum,
"Overall", "", "",
"– Deaths/N", "outcomes/total", c("Low", "High"),
"– Risk", "risk", c("Low", "High"),
"– Risk ratio (95% CI)", "rr", c("Low", "High"),
"– Risk difference (95% CI)", "rd", c("Low", "High"),
"", "", "",
"Low hormone receptor", "", "",
"– Deaths/N (Risk)", "outcomes/total (risk)", "Low",
"– Risk difference (95% CI)", "rd", "Low",
"High hormone receptor", "", "",
"– Deaths/N (Risk)", "outcomes/total (risk)", "High",
"– Risk difference (95% CI)", "rd", "High"
) |>
dplyr::mutate(
exposure = "stage",
outcome = "death",
effect_modifier = "receptor"
)
rifttable(
design = example_design,
data = risks::breastcancer
)
```
For more examples, see the [Get Started vignette](https://stopsack.github.io/rifttable/articles/rifttable.html).