-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.qmd
57 lines (45 loc) · 1.52 KB
/
README.qmd
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
---
title: "MOVER dataset: EPIC complications"
format: gfm
editor: visual
execute:
echo: true
warning: false
---
```{r}
library(tidyverse)
theme_set(theme_bw())
source("01_read_clean.R")
```
The post-operative complications dataset includes `r n_distinct(complications_orig$MRN)` patients who had `r n_distinct(complications_orig$LOG_ID)` surgeries.
The whole dataset includes 39685 patients who had 64354 surgeries, a discrepancy of 140 surgeries. Which is small considering the overall size. I wonder if these patients could have died without a recorded complication?
# Number of surgeries that resulted in any complication
```{r}
complications %>%
count(any_complication, name = "n_patients") %>%
knitr::kable()
```
# Number of complications per surgery
```{r}
complications %>%
count(n_complications, name = "n_patients") %>%
knitr::kable()
```
# Types of complications
```{r}
complications_all %>%
filter(comp_abbr != "None") %>%
#filter(comp_abbr != "Post-op AN") %>%
ggplot(aes(y = fct_rev(fct_infreq(comp_abbr)))) +
geom_bar() +
facet_wrap(~if_else(comp_abbr == "Post-op AN", "Big x axis scale", "Small x axis scale"),
scales = "free", ncol = 1)
```
By far the most common complication is "AN Post-op Complications", which I've shortened to "Post-op AN" for plotting/brevity purposes. It seems to cover everything from "None" to "Death":
```{r}
complications_all %>%
filter(comp_abbr == "Post-op AN") %>%
count(comp_abbr, complication, sort = TRUE) %>%
slice(1:20) %>%
knitr::kable()
```