-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathtables-and-figures.Rmd
162 lines (117 loc) · 3.91 KB
/
tables-and-figures.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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
---
title: "Lifetime lung, breast, and skin cancer \n| brain metastases incidence:\n A
reproducible SEER-Medicare study\n"
author: ''
date: "`r format(Sys.time(), '%B %d, %Y')`"
output:
html_document: default
pdf_document: default
word_document: default
header-includes:
- \usepackage[fontsize=12pt]{scrextend}
- \linespread{1.75}
- \usepackage{lineno}
- \renewcommand\linenumberfont{\normalfont\mdseries\scriptsize}
geometry: margin=1in
---
```{r setup, message = FALSE, warning = FALSE, echo = FALSE}
knitr::opts_chunk$set(echo = FALSE, warning = FALSE, message = FALSE)
knitr::knit_hooks$set(inline = function(x) {
the_x <- trimws(x,"both")
if (all(grepl("[0-9]", unlist(strsplit(the_x, split = ""))))) {
prettyNum(round(as.numeric(the_x),2), big.mark = ",")
} else {
x
}
})
library(pander)
panderOptions('table.split.table', Inf)
panderOptions('table.emphasize.rownames', TRUE)
panderOptions("big.mark", ",")
panderOptions("table.alignment.default", "left")
set.caption(NULL)
source("analysis/manuscript.R")
source("analysis/figures.R")
source("analysis/abbreviations.R")
```
\linespread{1.5}
\fontsize{11pt}{11pt}
\selectfont
Mustafa S Ascha^1^, Quinn T Ostrom^2^, James Wright^3^, Jeremy Bordeaux^4^, Andrew Sloan^3^, Frederick Schumacher^5^, Carol Kruchko^6^, Jill S Barnholtz-Sloan^5^
1. Center for Clinical Investigation, Department of Population and Quantitative Health Sciences, Case Western Reserve University School of Medicine, Cleveland, Ohio
2. Baylor College of Medicine, Houston, Texas
3. University Hospitals Cleveland Medical Center, Department of Neurosurgery, Cleveland, Ohio
4. University Hospitals Cleveland Medical Center, Department of Dermatology, Cleveland, Ohio
5. Department of Population and Quantitative Health Sciences, Case Western Reserve University School of Medicine, Cleveland, Ohio
6. Central Brain Tumor Registry of the United States, Hinsdale, Illinois
\pagebreak
## Abbreviations
```{r}
pander(abbreviations, split.table = Inf)
```
# Tables
## Table 1: Medicare claims brain metastasis classification accuracy
```{r classification metrics}
pander(classification_table_to_show)
```
\pagebreak
## Table 2: Incidence of primary cancer associated with brain metastases
```{r condensed incidence table}
old_names <- names(ip_aair)
names(ip_aair) <- make.names(old_names, unique = T)
condensed_ip <- map_df(ip_aair, function(x) gsub("\\ \\(.*", "", x))
condensed_ip[["Site"]] <- perma_dupes(condensed_ip[["Site"]])
names(condensed_ip) <- old_names
pander(condensed_ip)
```
\pagebreak
# Figures
## Figure 1: Data sources and definitions
```{r}
#library(DiagrammeR)
#mermaid("analysis/data-diagram.mmd")
```
\pagebreak
## Figure 2: Lung and breast cancer incidence proportions of brain metastases by race
```{r, fig.height = 3.5, fig.width = 6.5}
with(the_plots, arrange_plots(lung_race, breast_race))
```
\pagebreak
## Figure 3: Lung and skin cancer incidence proportions by sex
```{r, fig.height = 3.5, fig.width = 6.5}
with(the_plots, arrange_plots(lung_sex, skin_sex))
```
\pagebreak
\linespread{1.2}
\fontsize{10pt}{10pt}
\selectfont
# Supplementary tables
## Supplementary Table 1: Lung cancer demographics and clinical characteristics
```{r lung tableone}
pander_to(table_ones[["lung"]])
```
\pagebreak
## Supplementary Table 2: Breast cancer demographics and clinical characteristics
```{r breast tableone}
pander_to(table_ones[["breast"]])
```
\pagebreak
## Supplementary Table 3: Skin cancer demographics and clinical characteristics
```{r skin tableone}
pander_to(table_ones[["skin"]])
```
\pagebreak
## Supplementary Table 4: Diagnosis code-only algorithms performance
```{r}
pander(supplementary_classification)
```
\pagebreak
## Supplementary Table 5: Stage-specific incidence proportions
```{r}
ss_aair %>%
select(which_cancer, d_ssg00, inc_p) %>%
spread(which_cancer, inc_p) %>%
rename(Stage = d_ssg00) %>%
pander(split.table = Inf)
```
\pagebreak