-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpharma_wrangle3.R
68 lines (34 loc) · 1.65 KB
/
pharma_wrangle3.R
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
#pharma_wrangle3
library(tidyverse)
library(here)
load(here::here("data", "tidy_data", "Age_Range_Sex_Tidy.rda"))
load(here::here("data", "tidy_data", "age_range_data_both.rda"))
load(here::here("data", "tidy_data", "pharma_tidy.rda"))
names(pharma_tidy)
names(Age_Range_Sex_Tidy)
names(Age_Range_Tidy)
Age_Range_Tidy <- Age_Range_Tidy %>%
mutate(CL_low = Pop_Percent - (Std_Err * 1.96),
CL_high = Pop_Percent + (Std_Err * 1.96) ) %>%
mutate(across(where(is.numeric), round, 2))
pharma_tidy <- pharma_tidy %>%
mutate(CL_low = Pop_Percent - (Std_Err * 1.96),
CL_high = Pop_Percent + (Std_Err * 1.96) ) %>%
mutate(across(where(is.numeric), round, 2))
names(pharma_tidy)
names(Age_Range_Sex_Tidy)
names(Age_Range_Tidy)
pharma_tidy$drug_use <- factor(pharma_tidy$drug_use ,
levels = c("At least one",
"At least three",
"At least five"))
Age_Range_Tidy$drug_use <- factor(Age_Range_Tidy$drug_use ,
levels = c("At least one",
"At least three",
"At least five"))
Age_Range_Sex_Tidy$drug_use <- factor(Age_Range_Sex_Tidy$drug_use ,
levels = c("At least one",
"At least three",
"At least five"))
jump_range <- c("1988–1994", "2015–2018")
jump_range2 <- c("1999–2002", "2015–2018")