-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPowerpoint slides.Rmd
167 lines (122 loc) · 3.68 KB
/
Powerpoint slides.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
---
title: "Idaho Antibiotic Use"
author:
- Jeremy Boyd
- Karl Madaras-Kelly
date: "`r format(Sys.Date(), '%B %d, %Y')`"
output:
powerpoint_presentation:
reference_doc: blank_template.pptx
---
```{r setup, include=FALSE}
# Problems with creating a powerpoint from Rmd
# Doesn't allow you to change column widths in two-column slide.
# Doesn't allow you to change table styling to automatically get something that's not the template default.
# Feel like I if I did the powerpoint with Rmd it's be more of a pain because Karl wouldn't be able to edit it, and every time we did we'd have to redo a bunch of stuff that gets undone by re-knitting.
knitr::opts_chunk$set(echo = FALSE)
```
```{r, echo = FALSE, error = FALSE, message = FALSE, warning = FALSE}
# Read in provider type bank
p_types <- read_feather("Idaho provider type bank.feather") %>%
select(Prscrbr_Type, Std_Provider_Type)
# Read in address-county info
address_county <- read_feather("Address-query-county bank.feather")
# By-provider dataset
p <- read_feather("Idaho prescribers by provider data.feather") %>%
mutate(Bene_Prop_Fem = Bene_Feml_Cnt / Tot_Benes,
Bene_Prop_White = Bene_Race_Wht_Cnt / Tot_Benes,
Prscrbr_RUCA = floor(Prscrbr_RUCA),
Prscrbr_RUCA_fct = factor(Prscrbr_RUCA),
dataset_address = str_squish(
paste(Prscrbr_St1,
Prscrbr_St2,
Prscrbr_City,
Prscrbr_State_Abrvtn,
Prscrbr_Zip5))) %>%
# Standardized prescriber types
left_join(p_types, by = c("Prscrbr_Type")) %>%
# County info
left_join(address_county %>%
select(dataset_address, county),
by = "dataset_address") %>%
select(Year = year,
Prscrbr_NPI,
Prscrbr_Type_Std = Std_Provider_Type,
Prscrbr_RUCA,
Prscrbr_RUCA_fct,
Prscrbr_Gndr,
Prscrbr_State_Abrvtn,
Prscrbr_County = county,
Antbtc_Tot_Clms,
Tot_Benes,
Bene_Avg_Age,
Bene_Avg_Risk_Scre,
Bene_Prop_Fem,
Bene_Prop_White,
dataset_address)
```
## Medicare Part D Datasets
- Both have 2013-2019 data.
- by-provider: one row per provider per year. Aggregate antibiotic claim counts.
- by provider & drug: one row per provider per drug per year.
:::::: {.columns}
::: {.column}
By provider
<br>
- Bullet 1
- Bullet 2
- Bullet 3
:::
::: {.column}
By provider & drug
<br>
- Bullet 1
- Bullet 2
- Bullet 3
:::
::::::
## Example by-provider
```{r, echo = FALSE, error = FALSE, message = FALSE, warning = FALSE}
set.seed(1)
p %>%
filter(Year == 2019,
!is.na(Antbtc_Tot_Clms),
Antbtc_Tot_Clms != 0) %>%
sample_n(2) %>%
select(`Prv NPI` = Prscrbr_NPI,
`Prv Type` = Prscrbr_Type_Std,
`Prv Rural` = Prscrbr_RUCA_fct,
`Prv Gen` = Prscrbr_Gndr,
`N Ant Clms` = Antbtc_Tot_Clms,
`N Bens` = Tot_Benes,
`Ben HCC` = Bene_Avg_Risk_Scre,
`Ben Age` = Bene_Avg_Age,
`Ben Fem %` = Bene_Prop_Fem,
`Ben White %` = Bene_Prop_White) %>%
mutate(across(matches("%"), ~ . * 100),
across(matches("Age|Fem|White"), ~ round(., digits = 0)),
`Ben HCC` = round(`Ben HCC`, digits = 2),
across(everything(), ~ as.character(.))) %>%
kable()
```
## Slide with R Output
```{r cars, echo = TRUE}
summary(cars)
```
## Slide with Plot
```{r pressure}
plot(pressure)
```
## Two Column Slide
:::::: {.columns}
::: {.column}
- Bullet 1
- Bullet 2
- Bullet 3
:::
::: {.column}
```{r pressure3}
plot(pressure)
```
:::
::::::