-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path03_weighted_data.R
More file actions
27 lines (19 loc) · 903 Bytes
/
03_weighted_data.R
File metadata and controls
27 lines (19 loc) · 903 Bytes
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
#Create weighted lists according to age ranges
#Children 12-59m
w_data_1259_dtp1 <- lapply(ir, function(x){ x <- x %>%
filter(youngest_1259m == 1) %>%
as_survey_design(id = v001, strata =NULL, weights = v005, nest=T); return(x)})
#Children 12-23m
w_data_1223_dtp1 <- lapply(ir, function(x){ x <- x %>%
filter(youngest_1223m == 1) %>%
as_survey_design(id = v001, strata =NULL, weights = v005, nest=T); return(x)})
#Children 6-59m
w_data_0659_vas6 <- lapply(ir, function(x){ x <- x %>%
filter(!is.na(vas6)) %>%
filter(youngest_0659m == 1) %>%
as_survey_design(id = v001, strata =NULL, weights = v005, nest=T); return(x)})
#Children 12-59m
w_data_1259_dewormed <- lapply(ir, function(x){ x <- x %>%
filter(youngest_1259m == 1) %>%
filter(!is.na(dwormed)) %>%
as_survey_design(id = v001, strata =NULL, weights = v005, nest=T); return(x)})