-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path1_Exploratory_analysis.Rmd
81 lines (60 loc) · 1.84 KB
/
1_Exploratory_analysis.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
---
title: "Exploratory analysis"
author: "Leon Di Stefano"
date: "`r Sys.Date()`"
output:
html_document:
keep_md: false
params:
outcome_min: 28
outcome_max: 35
---
```{r}
knitr::opts_chunk$set(echo = TRUE)
require(here)
here::i_am(file.path("hcq_pooling_analysis", "1_Exploratory_analysis.Rmd"))
source(here("hcq_pooling_analysis", "common.R"))
out_stub <- paste(params$outcome_min, params$outcome_max, sep = '-')
output_dir <- here("hcq_pooling_analysis", "output", out_stub)
```
```{r}
patients <- read_rds(file.path(output_dir, "patients.rds"))
outcomes <- read_rds(file.path(output_dir, "outcomes_all.rds"))
```
- A plot of outcome data by treatment, overall and by study
```{r fig.height=4, fig.width=15}
### Below I replaced data_tbl with patients
line_plot <-
left_join(outcomes, patients, by = "patient_id") %>%
filter(!is.na(treat)) %>%
mutate(cv_jit = jitter(as.numeric(covid_scale), amount = .4)) %>%
filter(days_post_enrollment <= 30) %>%
ggplot(aes(days_post_enrollment, cv_jit)) +
geom_line(aes(group = patient_id), alpha = .2) +
scale_y_continuous(breaks = 1:7, labels = niaid_levels)
line_plot +
facet_rep_grid(~treat)
```
```{r fig.height=5, fig.width=18}
line_plot +
facet_rep_grid(treat~siteid.x) +
scale_y_continuous(breaks = 1:7, labels = 1:7)
```
```{r fig.height=5, fig.width=18}
line_plot +
facet_rep_grid(treat~cut(age_5y, 5)) +
scale_y_continuous(breaks = 1:7, labels = 1:7)
```
```{r fig.height=5, fig.width=18}
line_plot +
facet_rep_grid(treat~cut(bmi, breaks = quantile(bmi, na.rm = TRUE))) +
scale_y_continuous(breaks = 1:7, labels = 1:7)
```
Pretty hard to discern anything from these. However, low BMI patients under HCQ look a bit different at baseline (worse ...?).
### Rectangle plots (cf. patient-time missingness plot)
```{r}
sessionInfo()
```
```{r}
Sys.time()
```