-
Notifications
You must be signed in to change notification settings - Fork 2
/
index_old.Rmd
300 lines (208 loc) · 6.97 KB
/
index_old.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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
---
title: "biostatR v1.0 Release"
author: "Memorial Sloan Kettering Cancer Center<br/><br/>"
date: "February 26, 2020"
output:
xaringan::moon_reader:
css: [ninjutsu, default, metropolis, metropolis-fonts, "my-theme.css"]
lib_dir: libs
nature:
ratio: 16:9
highlightStyle: github
highlightLines: true
countIncrementalSlides: false
---
```{r setup, include=FALSE}
# xaringan::inf_mr()
options(htmltools.dir.version = FALSE)
knitr::opts_chunk$set(echo = TRUE, eval = TRUE)
library(tidyverse)
library(rlang)
library(knitr)
library(gtsummary)
library(gt)
set.seed(78987)
```
class: center
background-image: url(images/biostatr_logo.png)
background-size: contain
# {biostatR} package
???
- the same biostatR we all love, but with improvements
---
background-image: url("https://media.giphy.com/media/uELDhoOZdSnUk/giphy.gif")
background-size: contain
# {biostatR} v1.0
???
- v1.0 has some exciting updates
- other departments loved bits of what we had done
- and they stole them
- we exported many of our functions to mskR
- color palette
- symbolic links
- working with MSK github
- we wanted the change the structure to share resources across the hospital
---
# {biostatR} v1.0
<p align="center"><img src="images/README-biostatR_umbrella2.PNG" width=60%></p>
???
- the new look of biostatR, similar to the tidyverse
- when you load biostatR, three packages are loaded
- the **mskR** packages are used throughout the hospital
- more people get to use the functions we've written, and we get more functionality that others have written.
---
# {biostatR} v1.0 - Organization
.pull-left[
### gtsummary
- Bulk of the former biostatR lives here
- Data summary functions (e.g. for Table 1),
- Regression model summary functions
- Functions for reporting results inline
- Rounding/Formatting functions
- Kaplan-Meier summary functions
]
.pull-right[
### mskRvis
- MSK-themed ggplot color palette
- MSK-themed markdown template
- More coming soon...
### mskRutils
- Automated project setup functions
- Setting symbolic links
- Other functions for working with MSK Enterprise GitHub
]
---
# {biostatR} v1.0 - Package Website
.large[
* Package Website: http://biostatR.mskcc.org
* Installation instructions
* Thorough documentation on every function
* Detailed tutorials
* Install biostatR with the following code
]
``` {r, eval=FALSE}
install.packages("remotes")
remotes::install_git("https://github.mskcc.org/datadojo/biostatR.git")
library(biostatR)
-- Attaching packages ------------------------------ biostatR 1.0.0 --
v gtsummary 1.2.1 v mskRutils 0.2.0
v mskRvis 0.1.0
```
???
- visit the website and give quick tour
---
# {gtsummary} Overview
.large[
* Package will create your tabular summaries
* {gt} package is the default table printing engine
- customization ☄
- easy-to-learn ★
* `kable()` from {knitr} may still be used
- no footnotes ☒
- no spanning headers ☒
- fewer customization options ☒
]
---
# {gt} - an aside
.large[
.pull-left[
* New package from RStudio
* Package for printing highly customized tables
* Goal is to unify code for creating tables in HTML, Word (via RTF), and PDF
* Check it out! https://gt.rstudio.com/
]
.pull-right[
<img src="images/gt_logo.png" width=90%>
]
]
---
# {gt} - an aside
.pull-left[
"We can construct a wide variety of useful tables with a cohesive set of table parts. These include the *table header*, the *stub*, the *stub head*, the *column labels*, the *table body*, and the *table footer*."
<img src="images/gt_parts_of_a_table.png" width=110%>
]
.pull-right[
<img src="images/gt_functions.svg" width=90%>
]
???
the gt documentation is great!
all functions grouped by the part of a table they modify
---
# {gtsummary} Print Engines - gt or kable?
.large[
.pull-left[
## gt
♥ Highly Customizable
♥ All output includes informative footnotes
♥ HTML Output
♥ PDF Output
⚠ MS Word Output via RTF, requires re-sizing of tables by hand
]
.pull-right[
## kable
⚠ Less Customizable
⚠ Footnotes and spanning headers stripped from all output
♥ HTML Output
♥ PDF Output
♥ MS Word Output
]
]
.footnote[All examples shown use {gt} print engine]
---
# {gtsummary} - Function names
.large[
* {gt} package uses the `fmt_*` prefix for many of its functions
* Some of our {biostatR} functions names overlapped with their function names
* {gt} will be a much more famous than our department package
* We decided to change the prefixes we use `¯\_(ツ)_/¯`
```{r, eval=FALSE}
tbl_summary() <- fmt_table1()
tbl_regression() <- fmt_regression()
tbl_uvregression() <- fmt_uni_regression()
style_pvalue() <- fmt_pvalue()
style_percent() <- fmt_percent()
style_ratio()/style_sigfig() <- fmt_beta()
add_global_p() <- add_global()
add_p() <- add_comparison()
```
]
---
# New Features in {gtsummary}
.pull-left[
**`tbl_summary`**
- Use tidyselect and additional selector functions for arguments
- Sort variables by significance with `sort_p()`
- Accepts custom functions for calculating p-values in `add_p()`
- Table footnotes indicating statistics presented
- Calculate column, row, and cell percents in `tbl_summary()`
- Report p-values for selected variables with `add_p(exclude = ...)`
- Improved rounding options and ability to set global options for rounding p-values
]
.pull-right[
**`tbl_regression`**
- Merge and stack regression tables to create complex and custom tables
- Table footnotes defining abbreviations (e.g. OR and CI)
**`tbl_survival` NEW!**
- Summarize Kaplan-Meier analyses
- Summarize competing risk cumulative incidence curves (coming soon!)
]
???
- these are new features many added by request
---
```{r child='02-tbl_summary.Rmd'}
```
---
```{r child='03-tbl_regression.Rmd'}
```
---
class: center
# {biostatR}
.large[
• Every function is documented further in the help file •
• Check out the package website for vignettes including detailed examples and explanations •
<img src = "images/open-book-white.png" width="2.4%" height="2.4%"> {biostatR} documentation <a href="http://biostatR.mskcc.org/">biostatR.mskcc.org/</a>
<img src = "images/open-book-white.png" width="2.4%" height="2.4%"> {gtsummary} documentation <a href="http://www.danieldsjoberg.com/gtsummary/">danieldsjoberg.com/gtsummary/</a>
<img src = "images/open-book-white.png" width="2.4%" height="2.4%"> {gt} documentation <a href="https://gt.rstudio.com/">gt.rstudio.com/</a>
<img src = "images/open-book-white.png" width="2.4%" height="2.4%"> {mskRvis} documentation <a href="https://github.mskcc.org/pages/datadojo/mskRvis/index.html">github.mskcc.org/pages/datadojo/mskRvis/</a>
<img src = "images/open-book-white.png" width="2.4%" height="2.4%"> {mskRutils} documentation <a href="https://github.mskcc.org/pages/datadojo/mskRutils/index.html">github.mskcc.org/pages/datadojo/mskRutils/</a>
]