-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path03c_Cox_Model_Results.Rmd
128 lines (114 loc) · 4.68 KB
/
03c_Cox_Model_Results.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
---
title: "Cox Model Results"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE, warning=FALSE, error=FALSE)
library(knitr)
library(kableExtra)
```
## Results from Cox Models for Hospital Admissions
### All Respiratory Admissions
```{r}
z_mod = model_all_coefs %>% select(coef_name, n, HR, LCL, UCL) %>%
mutate(HR = round(HR, 2),
LCL = round(LCL, 2),
UCL = round(UCL, 2)) %>%
mutate(HR = sprintf("%.2f (%.2f, %.2f)", HR, LCL, UCL)) %>%
select(coef_name, n, HR)
kableExtra::kbl(z_mod,
caption = "Model coefficients", digits=c(NA, 1, NA),
col.names = c("Coefficient", "n", "HR"),
format = "pipe") %>%
kableExtra::kable_classic(full_width = F, html_font = "Cambria", position = "left") %>%
kableExtra::column_spec(1:6, width="5em")
```
## All respiratory admissions
### Adults
```{r}
z_model_adults_all = model_adults_coefs %>% select(coef_name, n, HR, LCL, UCL) %>%
select(coef_name, n, HR, LCL, UCL) %>%
mutate(HR = round(HR, 2),
LCL = round(LCL, 2),
UCL = round(UCL, 2),
n_all = n) %>%
mutate(HR_all = sprintf("%.2f (%.2f, %.2f)", HR, LCL, UCL)) %>%
select(coef_name, n_all, HR_all)
z_model_adults_flu = model_flu_adults_coefs %>% select(coef_name, n, HR, LCL, UCL) %>%
select(coef_name, n, HR, LCL, UCL) %>%
mutate(HR = round(HR, 2),
LCL = round(LCL, 2),
UCL = round(UCL, 2),
n_flu = n) %>%
mutate(HR_flu = sprintf("%.2f (%.2f, %.2f)", HR, LCL, UCL)) %>%
select(coef_name, n_flu, HR_flu)
z_model_adults_covid = model_covid_adults_coefs %>% select(coef_name, n, HR, LCL, UCL) %>%
select(coef_name, n, HR, LCL, UCL) %>%
mutate(HR = round(HR, 2),
LCL = round(LCL, 2),
UCL = round(UCL, 2),
n_covid = n) %>%
mutate(HR_covid = sprintf("%.2f (%.2f, %.2f)", HR, LCL, UCL)) %>%
select(coef_name, n_covid, HR_covid)
z_model_adults = z_model_adults_all %>%
left_join(z_model_adults_flu, by="coef_name") %>%
left_join(z_model_adults_covid, by="coef_name")
kableExtra::kbl(z_model_adults,
caption = "Model coefficients", digits=c(NA, 1, NA,1,NA, 1, NA),
col.names = c("Coefficient", "n All", "HR All", "n Flu", "HR Flu", "n COVID-19", "HR COVID-19"),
format = "pipe") %>%
kableExtra::kable_classic(full_width = F, html_font = "Cambria", position = "left") %>%
kableExtra::column_spec(1:9, width="5em")
```
### CYP
```{r}
z_model_cyp_all = model_cyp_coefs %>% select(coef_name, n, HR, LCL, UCL) %>%
select(coef_name, n, HR, LCL, UCL) %>%
mutate(HR = round(HR, 2),
LCL = round(LCL, 2),
UCL = round(UCL, 2),
n_all = n) %>%
mutate(HR_all = sprintf("%.2f (%.2f, %.2f)", HR, LCL, UCL)) %>%
select(coef_name, n_all, HR_all)
kableExtra::kbl(z_model_cyp_all,
caption = "Model coefficients", digits=c(NA, 1, NA),
col.names = c("Coefficient", "n All", "HR All"),
format = "pipe") %>%
kableExtra::kable_classic(full_width = F, html_font = "Cambria", position = "left") %>%
kableExtra::column_spec(1:3, width="5em")
```
## Pathogen specific models for vaccinations
### Flu
```{r}
z_model_adults_flu = model_flu_adults_coefs %>% select(coef_name, n, HR, LCL, UCL) %>%
select(coef_name, n, HR, LCL, UCL) %>%
mutate(HR = round(HR, 2),
LCL = round(LCL, 2),
UCL = round(UCL, 2),
n_flu = n) %>%
mutate(HR_flu = sprintf("%.2f (%.2f, %.2f)", HR, LCL, UCL)) %>%
select(coef_name, n_flu, HR_flu)
kableExtra::kbl(z_model_adults_flu,
caption = "Model coefficients", digits=c(NA, 1, NA),
col.names = c("Coefficient", "n Flu", "HR n Flu"),
format = "pipe") %>%
kableExtra::kable_classic(full_width = F, html_font = "Cambria", position = "left") %>%
kableExtra::column_spec(1:3, width="5em")
```
### COVID-19
```{r}
z_model_adults_covid = model_covid_adults_coefs %>% select(coef_name, n, HR, LCL, UCL) %>%
select(coef_name, n, HR, LCL, UCL) %>%
mutate(HR = round(HR, 2),
LCL = round(LCL, 2),
UCL = round(UCL, 2),
n_covid = n) %>%
mutate(HR_covid = sprintf("%.2f (%.2f, %.2f)", HR, LCL, UCL)) %>%
select(coef_name, n_covid, HR_covid)
kableExtra::kbl(z_model_adults_covid,
caption = "Model coefficients", digits=c(NA, 1, NA),
col.names = c("Coefficient", "n COVID-19", "HR COVID-19"),
format = "pipe") %>%
kableExtra::kable_classic(full_width = F, html_font = "Cambria", position = "left") %>%
kableExtra::column_spec(1:3, width="5em")
```