-
Notifications
You must be signed in to change notification settings - Fork 0
/
RBM-Indicators-V2
1046 lines (784 loc) · 34.7 KB
/
RBM-Indicators-V2
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
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
######################################################
#####Standard Scripts for RBM Indicators##############
######################################################
###Create function that turn character values into numeric if you imported from KoBO
labelled_chr2dbl <- function(x) {
varlab <- var_label(x)
vallab <- val_labels(x)
vallab <- setNames(as.numeric(vallab),
names(vallab))
x <- as.numeric(as.character(x))
var_label(x) <- varlab
val_labels(x) <- vallab
x
}
#Impact Indicators
###2.2 Proportion of PoCs residing in physically safe and secure settlements with access to basic facilities.
##Module : HEA01-HEA03 (health) + LIGHT01-LIGHT03 (electricity) + DWA01-DWA04 (drinking water) + DWE01-DWE05 (shelter)
###Step.1. Electricity
###This basic service is calculated from the main dataset
##If there is a source of electricity available
main <- main %>%
mutate(electricity=
case_when(LIGHT01=="1" & (LIGHT03!="1" | LIGHT03!="96" | LIGHT03!="98") ~ "1",
TRUE ~ "0" )
) %>%
mutate( electricity = labelled(electricity,
labels = c(
"Yes" = "1",
"No" = "0"
),
label = "Access to electricity"))
table(main$LIGHT01)
###Step2. Healthcare
###This basic service is calculated from the main dataset
###Access to healthcare if household has a facility available
#within one hour (walk or any type of transport)
main <- main %>%
mutate(healthcare=
case_when((HEA01!="96" | HEA01!="98") & HEA03 <= 60 ~ "1",
TRUE ~ "0")
) %>%
mutate( healthcare = labelled(healthcare,
labels = c(
"Yes" = "1",
"No" = "0"
),
label = "Access to healthcare facility"))
table(main$healthcare)
###Step3. Drinking water
###This basic service is calculated from the main dataset
###There are three conditions as below
##improved source, in dwelling/yard/plot and reachable under 30 minutes
main <- main %>%
mutate(time_DWA=case_when(
DWA03a=="1"~ "1", DWA03a=="2"~"60") #convert hour into minutes
)
main$time_DWA <- as.numeric(main$time_DWA)
main <- main %>%
mutate(time_tot=time_DWA*DWA03b
) %>%
mutate(dwa_cond1=case_when( time_tot > 30 ~ "0",
TRUE ~ "1") # reachable under 30 minutes
) %>%
mutate(dwa_cond2=case_when(DWA01!="7" |DWA01 !="9" |DWA01 != "13" | DWA01 != "96" |DWA01 !="98" ~ "1",
TRUE ~ "0") # improved source
) %>%
mutate(dwa_cond3=case_when(DWA02 == "3" ~ "0",
TRUE ~ "1") # in the dwelling/yard/plot
) %>%
mutate(drinkingwater=case_when(
(dwa_cond1=="1" & dwa_cond2=="1" & dwa_cond3=="1") ~ "1", TRUE ~ "0")
) %>%
mutate(drinkingwater = labelled(drinkingwater,
labels = c(
"Yes" = "1",
"No" = "0"
),
label = "Access to drinking water"))
table(main$drinkingwater)
###Step 4. Shelter
##Adequate shelter is calculated from the main dataset
##classify as habitable when improved/adequate shelter
main <- main %>%
mutate(dwe01_cat=case_when( #Only apartment and house
(DWE01=="1" | DWE01=="2") ~ "1", TRUE ~ "0" )
) %>%
mutate(dwe02_cat=case_when( #unimproved floor when earth,sand,clay,mud, dung or other
(DWE02=="1" | DWE02=="2" | DWE02=="96") ~ "0", TRUE ~ "1" )
) %>%
mutate(dwe03_cat=case_when( #unimproved roof all options except metal,wood,ceramic tiles, cement, roofing shingles/sheets
(DWE03=="8" |DWE03=="9" | DWE03=="10" | DWE03=="11" |
DWE03=="12" | DWE03=="13" ) ~ "1" , TRUE ~ "0")
) %>%
mutate(dwe04_cat=case_when( #improved wall: cement,stone,bricks,cement blocks, covered adobe, wood planks
(DWE04=="10"| DWE04=="11"| DWE04=="12"| DWE04=="13"| DWE04=="14"| DWE04=="15") ~ "1",
TRUE ~ "0")
)
####Calculate crowding index - overcrowded when more than 3 persons
main <- main %>%
mutate(crowding=HH01/DWE05
) %>%
mutate(dwe05_cat=case_when( ##if crowding <= 3, not overcrowded
crowding <= 3 ~ "1", TRUE ~ "0")
)
####Calculate if all 5 conditions are met for adequate shelter
##dwe01_cat / dwe02_cat / dwe03_cat / dwe04_cat / dwe05_cat
table(main$dwe01_cat)
table(main$dwe02_cat)
table(main$dwe03_cat)
table(main$dwe04_cat)
table(main$dwe05_cat)
main <- main %>%
mutate(shelter=case_when(
dwe01_cat=="0" | dwe02_cat=="0" | dwe03_cat=="0" | dwe04_cat=="0" | dwe05_cat=="0" ~ "0",
dwe01_cat=="1" & dwe02_cat=="1" & dwe03_cat=="1" & dwe04_cat=="1" & dwe05_cat=="1" ~ "1")
) %>%
mutate( shelter = labelled(shelter,
labels = c(
"Yes" = "1",
"No" = "0"
),
label = "Access to adequate shelter"))
table(main$shelter)
##Step 5. Combine all services
###Calculate impact indicator based on shelter, electricity, drinkingwater and healthcare
##Impact 2.2 is "1" if all services above are accessible
main <-main %>%
mutate(impact2_2=case_when(
shelter=="0" | electricity=="0" | drinkingwater=="0" | healthcare=="0" ~ "0",
shelter=="1" & electricity=="1" & drinkingwater=="1" & healthcare=="1" ~ "1")
) %>%
mutate(impact2_2=labelled(impact2_2,
labels =c(
"Yes"="1",
"No"="0"
),
label="Proportion of PoCs residing in physically safe and secure settlements with access to basic facilities"))
table(main$impact2_2)
###2.3 Proportion of PoC with access to health services.
##Module :HACC01 - HACC04
####This indicator comes from the individual dataset
##Calculate those who were not able to access due to reasons #unrelated to asked services (when HACC04 is 7 or 8 or 96)
ind <- ind %>% #Those who could not access
mutate(health_NOacc=case_when(
HACC03=="1" & (HACC04_7=="1" | HACC04_8=="1" | HACC04_96=="1" ) ~ "0",
HACC03=="1" & (HACC04_1=="1" | HACC04_2=="1" | HACC04_3=="1" | HACC04_4=="1" |HACC04_5=="1" |
HACC04_6=="1" | HACC04_9=="1" | HACC04_10=="1") ~ "1", TRUE ~ "0")
)
ind$health_NOacc <- as.numeric(ind$health_NOacc)
ind$HACC01 <- labelled_chr2dbl(ind$HACC01)
ind <- ind %>% ## Add up who needed services ( both who accessed and did not access)
mutate(HACC_need=HACC01 + health_NOacc
) %>%
mutate(impact2_3=HACC01/HACC_need
) %>%
mutate(impact2_3=case_when(
impact2_3==1 ~ 1, impact2_3==0.5 ~ 0,
impact2_3==0 ~ 0, TRUE ~ NA_real_ )
) %>%
mutate(impact2_3=labelled(impact2_3,
labels =c(
"Yes"=1,
"No"=0
),
label="Proportion of PoC with access to health services"))
#Turn those who did not need health services into NA to exclude
#from the calculation
table(ind$impact2_3)
mean(is.na(ind$impact2_3))
###3.2a: Proportion of PoC enrolled in primary education regardless of age
##Module :EDU01-EDU04
###This indicator comes from the individual dataset
ind$EDU01 <- labelled_chr2dbl(ind$EDU01)
ind$EDU02 <- labelled_chr2dbl(ind$EDU02)
ind$EDU03 <- labelled_chr2dbl(ind$EDU03)
ind<- ind %>%
mutate(edu_primary=case_when(
EDU01==1 & EDU02==1 & EDU03==2 ~ 1, EDU01==0 | EDU02==0 ~ 0, TRUE ~ 0)
) %>%
mutate(age_primary=case_when(
HH07 >= 6 & HH07 <=10 ~ 1, TRUE ~ NA_real_) #Adjust age group for primary school enrollment
) %>%
mutate(impact3_2a=sum(edu_primary)/sum(age_primary)
) %>%
mutate(impact3_2a=labelled(impact3_2a,
labels =c(
"Yes"=1,
"No"=0
),
label="Proportion of persons of concern enrolled in primary education"))
mean(ind$impact3_2a)
table(ind$impact3_2a)
###3.2b: Proportion of PoC enrolled in secondary education
##Module :EDU01-EDU04
#Turn character variables into vector
ind$EDU01 <- labelled_chr2dbl(ind$EDU01)
ind$EDU02 <- labelled_chr2dbl(ind$EDU02)
ind$EDU03 <- labelled_chr2dbl(ind$EDU03)
ind <- ind %>%
mutate(edu_secondary=case_when(
EDU01==1 & EDU02==1 & (EDU03==3 | EDU03==4) ~ 1, EDU01==0 | EDU02==0 ~ 0,
TRUE ~ 0)
) %>%
mutate(age_secondary=case_when(
HH07 >= 11 & HH07 <=18 ~ 1, TRUE ~ NA_real_)
#Adjust age group for secondary school enrollment
##calculated as 11 to 18 above
) %>%
mutate(impact3_2b=sum(edu_secondary)/sum(age_secondary)
) %>%
mutate(impact3_2b=labelled(impact3_2b,
labels =c(
"Yes"=1,
"No"=0
),
label="Proportion of persons of concern enrolled in secondary education"))
mean(ind$impact3_2b)
table(ind$impact3_2b)
###3.3 Proportion of PoC feeling safe walking alone in their neighborhood
##Module :SAF01
##This indicator comes from main dataset based on the respondent randomly selected for individual level
#if unsafe or very unsafe 0, 98 and 99 go into blank
##I never walk alone will also go into blank if any
main$SAF01 <- labelled_chr2dbl(main$SAF01)
main <- main %>%
mutate(impact3_3=case_when(
SAF01==1 | SAF01==2 ~ 1,
SAF01==3 | SAF01==4 ~ 0 ,
SAF01==98 | SAF01==99 ~ NA_real_)
) %>%
mutate(impact3_3=labelled(impact3_3,
labels =c(
"Yes"=1,
"No"=0
),
label="Proportion of population that feel safe walking alone in their neighbourhood"))
table(main$impact3_3)
###Outcome Indicators
###1.2 Proportion of children <5 years whose birth have been registered with a civil authority
##Module :REG03 - REG04
ind$REG03 <- labelled_chr2dbl(ind$REG03) # birth certificate
ind$REG04 <- labelled_chr2dbl(ind$REG04) # birth has been registered
##This indicator comes from the individual dataset
# ind$REG03 - birth certificate
# ind$REG04 - birth has been registered
##Calculate children who has a birth certificate
ind <- ind %>%
mutate(birthCertificate=case_when(
REG03==0 | REG03==98 ~ 0, REG03==1 ~ 1)
) %>%
mutate(birthCertificate=labelled(birthCertificate,
labels=c(
'Yes'=1,
'No'=0
),
label="Children under 5 with a birth certificate"))
##Calculate children who has been registered with civil authorities
ind <- ind %>%
mutate(birthRegistered=case_when(
REG04==0 | REG04==98 ~ 0, REG04==1 ~ 1, REG04==99 ~NA_real_)
) %>%
mutate(birthRegistered=labelled(birthRegistered,
labels=c(
'Yes'=1,
'No'=0
),
label="Children under 5 birth registered with civil authorities"))
##if the birth is registered or child has a birth certificate
ind <- ind %>%
mutate(outcome1_2=case_when(
(birthRegistered==1 | birthCertificate==1)
& HH07 <5 ~ 1,
(birthRegistered==0 & birthCertificate==0)
& HH07 <5 ~ 0)
) %>%
mutate(outcome1_2=labelled(outcome1_2,
labels=c(
'Yes'=1,
'No'=0
),
label="Proportion of children under 5 years of age whose births have been registered with a civil authority"))
table(ind$outcome1_2)
###1.3 Proportion of PoC with legally recognized identity documents or credentials
##Module :REG01 - REG02 - REG05 - REG06
##This indicator comes from the individual dataset
###Calculate valid identity documents for under 5 with REG05 and REG06 variables
ind$REG05a <- labelled_chr2dbl(ind$REG05a) # passport
ind$REG05b <- labelled_chr2dbl(ind$REG05b) # civil/government issued ID
ind$REG05c <- labelled_chr2dbl(ind$REG05c) # residency permit
ind$REG05d <- labelled_chr2dbl(ind$REG05d) # statelessness documentation
ind$REG05e <- labelled_chr2dbl(ind$REG05e) # household card of address/family book
ind$REG05f <- labelled_chr2dbl(ind$REG05f) # social security card
ind$REG06 <- labelled_chr2dbl(ind$REG06) # any other document establishes identity
#ind$REG05a - passport
#ind$REG05b - civil/government issued ID
#ind$REG05c - residency permit
#ind$REG05d - statelessness documentation
#ind$REG05e - household card of address/family book
#ind$REG05f - social security card
#ind$REG06 - any other document establishes identity
#add birth certificate as additional document from REG03
#Make sure to delete REG05e below from the script if you don't have any stateless
ind <- ind %>%
mutate(document_under5=case_when(
REG05a==1 | REG05b==1 | REG05c==1 | REG05d==1 | REG05e==1 | REG05f==1 |REG06==1 | REG03==1 ~ 1,
REG05a!=1 & REG05b!=1 & REG05c!=1 & REG05d!=1 & REG05e!=1 & REG05f!=1 & REG06!=1 & REG03!=1 ~ 0, TRUE ~ NA_real_
))
###Calculate valid identity documents for above 5 with REG01 and REG02 variables
ind$REG01a <- labelled_chr2dbl(ind$REG01a) # passport
ind$REG01b <- labelled_chr2dbl(ind$REG01b) # birth certificate
ind$REG01c <- labelled_chr2dbl(ind$REG01c) # civil/ government issued ID
ind$REG01d <- labelled_chr2dbl(ind$REG01d) # residency permit
ind$REG01e <- labelled_chr2dbl(ind$REG01e) # statelessness documentation
ind$REG01f <- labelled_chr2dbl(ind$REG01f) # household card of address/family book
ind$REG01g <- labelled_chr2dbl(ind$REG01g) # social security card
ind$REG02 <- labelled_chr2dbl(ind$REG02) # any other document establishes identity
#ind$REG01a # passport
#ind$REG01b # birth certificate
#ind$REG01c # civil/ government issued ID
#ind$REG01d # residency permit
#ind$REG01e # statelessness documentation
#ind$REG01f # household card of address/family book
#ind$REG01g # social security card
#ind$REG02 # any other document establishes identity
#Make sure to delete REG01e below from the script if you don't have any stateless
ind <- ind %>%
mutate(document_above5=case_when(
REG01a==1 | REG01b==1 | REG01c==1 | REG01d==1 | REG01e==1 | REG01f==1 | REG01g==1 |REG02==1 ~ 1,
REG01a!=1 & REG01b!=1 & REG01c!=1 & REG01d!=1 & REG01e!=1 & REG01f!=1 & REG01g!=1 & REG02!=1 ~ 0, TRUE ~ NA_real_)
##Combine both age groups
) %>%
mutate(outcome1_3=case_when(
(document_above5==1 | document_under5==1) ~ 1,
(document_above5==0 | document_under5==0) ~ 0)
) %>%
mutate(outcome1_3=labelled(outcome1_3,
labels=c(
'Yes'=1,
'No'=0
),
label="Proportion of Persons of Concern with legally recognized identity documents or credentials"))
table(ind$outcome1_3)
###4.1 Proportion of PoC who know where to access available GBV services
##Module :GBV01
##Turn into numeric variables for services
main$GBV01a <- labelled_chr2dbl(main$GBV01a) # health services
main$GBV01b <- labelled_chr2dbl(main$GBV01b) # psycho-social services
main$GBV01c <- labelled_chr2dbl(main$GBV01c) # safety and security services
main$GBV01d <- labelled_chr2dbl(main$GBV01d) # legal assistance
main <- main %>%
mutate(outcome4_1=case_when(
GBV01a==1 | GBV01b==1 | GBV01c==1 | GBV01d==1 ~ 1,
TRUE ~ 0)
) %>%
mutate(outcome4_1=labelled(outcome4_1,
labels=c(
'Yes'=1,
"No"=0
),
label="Proportion of PoC who know where to access available GBV services"
))
table(main$outcome4_1)
###4.2 Proportion of PoC who do not accept violence against women
##Module :VAW01
#Turn into numeric variables
main$VAW01a <- labelled_chr2dbl(main$VAW01a)
main$VAW01b <- labelled_chr2dbl(main$VAW01b)
main$VAW01c <- labelled_chr2dbl(main$VAW01c)
main$VAW01d <- labelled_chr2dbl(main$VAW01d)
main$VAW01e <- labelled_chr2dbl(main$VAW01e)
##This indicator comes from main dataset based on the respondent randomly selected for individual level
#If randomly selected adult who believes that a husband is justified in beating his wife in various circumstances
##If yes selected for any of the circumstances
###Prefer not to respond will be put into missing
main <- main %>%
mutate(outcome4_2=case_when(
VAW01a==1 | VAW01b==1 | VAW01c==1 | VAW01d==1 | VAW01e==1 ~ 0,
VAW01a==0 & VAW01b==0 & VAW01c==0 & VAW01d==0 & VAW01e==0 ~ 1,
TRUE ~ NA_real_)
) %>%
mutate(outcome4_2=labelled(outcome4_2,
labels=c(
'Yes'=1,
"No"=0
),
label="Proportion of PoC who do not accept violence against women"
))
table(main$outcome4_2)
###5.2 Proportion of children who participate in community-based child protection programmes
##Module :COMM01-COMM04
#Turn into numeric variables
ind$COMM01 <- labelled_chr2dbl(ind$COMM01)
ind$COMM02 <- labelled_chr2dbl(ind$COMM02)
ind$COMM03 <- labelled_chr2dbl(ind$COMM03)
ind$COMM04 <- labelled_chr2dbl(ind$COMM04)
###This indicator comes from the individual level dataset
#Children who participate in community-based programmes at least 2 times, under adult supervision in a physically safe area
ind <- ind %>%
mutate(outcome5_2=case_when(
(COMM01==1 & COMM02 >=2 & COMM03==1 & COMM04==1) ~ 1,
(COMM01==0 |
(COMM02 < 2 | COMM02==98) |
(COMM03==0 | COMM03==98) |
(COMM04==0 | COMM04==98)) ~ 0, TRUE ~ NA_real_)
) %>%
mutate(outcome5_2=labelled(outcome5_2,
labels=c(
'Yes'=1,
"No"=0
),
label="Proportion of children who participate in community-based child protection programmes"
))
table(ind$outcome5_2)
###8.2 Proportion of PoC with primary reliance on clean (cooking) fuels and technology
##Module :COOK01-COOK03
main$COOK01 <- labelled_chr2dbl(main$COOK01)
main$COOK02 <- labelled_chr2dbl(main$COOK02)
main$COOK03 <- labelled_chr2dbl(main$COOK03)
###Based on MICS calculation : TC4.1
main <- main %>%
mutate(
outcome8_2 = case_when(
(COOK01 == 1 & (COOK02 %in% c("1", "2", "3", "4", "5")) | (COOK02 %in% c("6") & COOK03 %in% c("1", "3"))
) ~ 1,
(COOK01 == 1 & (COOK02 %in% c("7", "8", "9", "10", "96")) | ((COOK02 %in% c("6") & !(COOK03 %in% c("1", "3")
)))) ~ 0 ,
TRUE ~ NA_real_
)
) %>%
mutate(
outcome8_2 = labelled(outcome8_2,
labels = c(
"No" = 0,
"Yes" = 1
),
label = "Proportion of Persons of Concern with primary reliance on clean (cooking) fuels and technology"
)
)
table(main$outcome8_2)
###9.1 Proportion of PoC living in habitable and affordable housing
##Module :DWE01-DWE05 & DWE08-DWE09
main$DWE01 <- labelled_chr2dbl(main$DWE01)
main$DWE02 <- labelled_chr2dbl(main$DWE02)
main$DWE03 <- labelled_chr2dbl(main$DWE03)
main$DWE04 <- labelled_chr2dbl(main$DWE04)
main$DWE08 <- labelled_chr2dbl(main$DWE08)
main$DWE09 <- labelled_chr2dbl(main$DWE09)
##This indicator is calculated from the main dataset
##classify as habitable when improved/adequate shelter
main <- main %>%
mutate(dwe01_cat=case_when( #Only apartment and house
(DWE01==1 | DWE01==2) ~ 1, TRUE ~ 0 )
) %>%
mutate(dwe02_cat=case_when( #unimproved floor when earth,sand,clay,mud, dung or other
(DWE02==1 | DWE02==2 | DWE02==96) ~ 0, TRUE ~ 1 )
) %>%
mutate(dwe03_cat=case_when( #unimproved roof all options except metal,wood,ceramic tiles, cement, roofing shingles/sheets
(DWE03==8 |DWE03==9 | DWE03==10 | DWE03==11 |
DWE03==12 | DWE03==13 ) ~ 1 , TRUE ~ 0)
) %>%
mutate(dwe04_cat=case_when( #improved wall: cement,stone,bricks,cement blocks, covered adobe, wood planks
(DWE04==10| DWE04==11| DWE04==12| DWE04==13| DWE04==14| DWE04==15) ~ 1,
TRUE ~ 0)
)
####Calculate crowding index - overcrowded when more than 3 persons
main <- main %>%
mutate(crowding=HH01/DWE05
) %>%
mutate(dwe05_cat=case_when( ##if crowding <= 3, not overcrowded
crowding <= 3 ~ 1, TRUE ~ 0)
)
## Add DWE08 and DWE09 to calculations - if household is paying rent, they should be able to afford to pay rent without any financial distress
main <- main %>%
mutate(dwe09_cat=case_when( #affordable if HH pays rent and often and always without financial distress
(DWE08==1 & (DWE09==1 | DWE09==2)) ~ 1,
(DWE08==1 & (DWE09==3 | DWE09==4)) ~ 0,
DWE08==0 ~ 1)
)
####Combine all shelter indicators
##dwe01_cat / dwe02_cat / dwe03_cat / dwe04_cat / dwe05_cat / dwe09_cat
main <- main %>%
mutate(outcome9_1=case_when(
dwe01_cat==0 | dwe02_cat==0 | dwe03_cat==0 | dwe04_cat==0 | dwe05_cat==0 | dwe09_cat==0 ~ 0,
dwe01_cat==1 & dwe02_cat==1 & dwe03_cat==1 & dwe04_cat==1 & dwe05_cat==1 & dwe09_cat==1 ~ 1)
) %>%
mutate( outcome9_1 = labelled(outcome9_1,
labels = c(
"Yes" = 1,
"No" = 0
),
label = "Proportion of PoCs living in habitable and affordable housing"))
table(main$outcome9_1)
###9.2 Proportion of PoC that have energy to ensure lighting
##Module :LIGHT01-LIGHT03
main$LIGHT01 <- labelled_chr2dbl(main$LIGHT01)
main$LIGHT02 <- labelled_chr2dbl(main$LIGHT02)
main$LIGHT03 <- labelled_chr2dbl(main$LIGHT03)
###This basic service is calculated from the main dataset
### The below Calculates percentage of PoC having access to clean fuel for lighting and / or basic connectivity (9.1 Outcome Indicator)
main <- main %>%
mutate(outcome9_2=
case_when(LIGHT01==1 & (LIGHT02==1 |LIGHT02==3 | LIGHT02==4 | LIGHT02==5 | LIGHT02==6 | LIGHT02==7 |LIGHT02==8)
~ 1, TRUE ~ 0)
) %>%
mutate( outcome9_2 = labelled(outcome9_2,
labels = c(
"Yes" = 1,
"No" = 0
),
label = "Proportion of PoC that have energy to ensure lighting"))
###10.1 Proportion of children 9mo-5years who have received measles vaccination
##Module :MMR01-MMR04 ## MICS TC.1.1 UNICEF calculates on the first dose received##
#Turn into numeric
ind$MMR03 <- labelled_chr2dbl(ind$MMR03)
ind <- ind %>%
mutate(outcome10_1=case_when(
MMR03==1 ~ 1, MMR03==0 | MMR03==98 ~ 0)
) %>%
mutate( outcome10_1 = labelled(outcome10_1,
labels = c(
"Yes" = 1,
"No" = 0
),
label = "Proportion of children aged 9 months to five years who have received measles vaccination"))
table(ind$outcome10_1)
###10.2 Proportion of births attended by skilled health personnel
##Module :BIR01-BIR04
##If there are live births in the last 2 years
main$BIR03 <- labelled_chr2dbl(main$BIR03)
main$BIR01 <- labelled_chr2dbl(main$BIR01)
main$BIR02 <- labelled_chr2dbl(main$BIR02)
## MICS TM.5.a UNICEF MICS calculation if there was a trained health personnel ##
##If there are live births in the last 2 years
### Traditional birth attendant and community health worker
###can be included if they are trained
main <- main %>%
mutate(outcome10_2=case_when(
(BIR01==1 | BIR02==1) & (BIR03==1 |BIR03==2 | BIR03==3 )
~ 1,
(BIR01==1 | BIR02==1) & (BIR03==4 |BIR03==5 | BIR03==6
| BIR03==96| BIR03==98)
~ 0,
TRUE ~ NA_real_)
) %>%
mutate( outcome10_2 = labelled(outcome10_2,
labels = c(
"Yes" = 1,
"No" = 0
),
label = "Proportion of births attended by skilled health personnel"))
table(main$outcome10_2)
###12.1 Proportion of PoC using at least basic drinking water services
##Module :DWA01-DWA04
###There are three conditions as below
##improved source, in dwelling/yard/plot and reachable under 30 minutes
###This comes from the main dataset
###There are three conditions as below
##improved source, in dwelling/yard/plot and reachable under 30 minutes
main <- main %>%
mutate(time_DWA=case_when(
DWA03a==1~1, DWA03a==2~60) #convert hour into minutes
) %>%
mutate(time_tot=time_DWA*DWA03b
) %>%
mutate(dwa_cond1=case_when( time_tot > 30 ~ 0,
TRUE ~ 1) # reachable under 30 minutes
) %>%
mutate(dwa_cond2=case_when(DWA01!=7 |DWA01 !=9 |DWA01 != 13 | DWA01 != 96 |DWA01 !=98 ~ 1,
TRUE ~ 0) # improved source
) %>%
mutate(dwa_cond3=case_when(DWA02 == 3 ~ 0,
TRUE ~ 1) # in the dwelling/yard/plot
) %>%
mutate(outcome12_1=case_when(
(dwa_cond1==1 & dwa_cond2==1 & dwa_cond3==1) ~ 1, TRUE ~ 0)
) %>%
mutate(outcome12_1 = labelled(drinkingwater,
labels = c(
"Yes" = 1,
"No" = 0
),
label = "Proportion of PoC using at least basic drinking water services"))
###12.2 Proportion of PoC with access to a safe household toilet
##Module :TOI01-TOI05 ##MICS calculation WS3.1/WS3.4
###This basic service is calculated from the main dataset
##MICS calculation WS3.1/WS3.4
main$TOI01 <- labelled_chr2dbl(main$TOI01)
main$TOI02 <- labelled_chr2dbl(main$TOI02)
main$TOI03 <- labelled_chr2dbl(main$TOI03)
main$TOI04 <- labelled_chr2dbl(main$TOI04)
main$TOI05 <- labelled_chr2dbl(main$TOI05)
main <- main %>%
mutate(toi_cond1=case_when(TOI01==1 |TOI01==2 | TOI01==3 | TOI01==4 |TOI01==5 |TOI01==6 | TOI01==7 | TOI01==9 ~ 1,
TOI01==8 | TOI01==10 | TOI01==11 | TOI01==12 | TOI01==96 ~ 0,
TRUE ~ NA_real_)
) %>%
mutate(toi_cond2=case_when(
TOI02==1 & (TOI03==5 |TOI03==96 | TOI03==98) ~ 0, #Unsafe disposal
TOI02==1 & (TOI03==1 |TOI03==2 |TOI03==3 |TOI03==4 ) ~ 1, #safe
TOI02==2 ~ 0, TOI02==98 ~ 0, TRUE ~ NA_real_)
) %>%
mutate(toi_cond3=case_when(
TOI05==1 ~ 0, TOI05==0 ~ 1) # toilet not shared with other households
) %>%
###Combine all three conditions below
### improved sanitation facility / Safe disposal in situ of excreta from on-site sanitation facilities / not shared with other HHs
mutate(outcome12_2=case_when(
toi_cond1==1| toi_cond2==1 |toi_cond3==1 ~ 1,
TRUE ~ 0)
) %>%
mutate(outcome12_2 = labelled(outcome12_2,
labels = c(
"Yes" = 1,
"No" = 0
),
label = "Proportion of Persons of Concern with acess to a safe household toilet"))
table(main$outcome12_2)
###13.1 Proportion of PoC with an account at a bank or other financial institution or with a mobile-money service provider
##Module :BANK01-BANK05
main$BANK01 <- labelled_chr2dbl(main$BANK01)
main$BANK02 <- labelled_chr2dbl(main$BANK02)
main$BANK03 <- labelled_chr2dbl(main$BANK03)
main$BANK04 <- labelled_chr2dbl(main$BANK04)
main$BANK05 <- labelled_chr2dbl(main$BANK05)
main <- main %>%
mutate(
outcome13_1 = case_when(
BANK01==1 | BANK02== 1 | BANK03==1 |BANK05==1 ~ 1,
BANK01==0 & BANK02==0 & BANK03==0 & BANK05==0 ~ 0,
TRUE ~ 0)
) %>%
mutate(outcome13_1 = labelled(outcome13_1,
labels = c(
"Yes" = 1,
"No" = 0
),
label = "PoC with an account at a bank or other financial institution or with a mobile-money service provider"))
table(main$outcome13_1)
###13.2 Proportion of PoC who self-report positive changes in their income compared to previous year
##Module :INC01
### Only calculate as positive if they responded 'more'
main$INC01 <- labelled_chr2dbl(main$INC01)
main <- main %>%
mutate(outcome13_2=case_when(
INC01==1 ~ 1,
INC01==2 |INC01==3 |INC01==98 ~ 0 )
) %>%
mutate(outcome13_2 = labelled(outcome13_2,
labels = c(
"Yes" = 1,
"No" = 0
),
label = "Proportion of PoC who self-report positive changes in their income compared to previous year"))
table(main$outcome13_2)
###13.3 Proportion of PoC (working age) who are unemployed
####Numerator: Those of working age who were not in employment, looked for employment in the past 30 days and were available to take up employment
####Denominator: Those of working age in labour force
###Turn into numeric variables
main$UNEM01 <- labelled_chr2dbl(main$UNEM01)
main$UNEM02 <- labelled_chr2dbl(main$UNEM02)
main$UNEM03 <- labelled_chr2dbl(main$UNEM03)
main$UNEM04 <- labelled_chr2dbl(main$UNEM04)
main$UNEM05 <- labelled_chr2dbl(main$UNEM05)
main$UNEM06 <- labelled_chr2dbl(main$UNEM06)
main$UNEM07 <- labelled_chr2dbl(main$UNEM07)
main$UNEM08 <- labelled_chr2dbl(main$UNEM08)
main$UNEM09 <- labelled_chr2dbl(main$UNEM09)
main$UNEM10 <- labelled_chr2dbl(main$UNEM10)
####Numerator: Those of working age who were not in employment, looked for employment in the past 30 days and were available to take up employment
####Denominator: Those of working age in labour force
main <- main %>%
mutate(employed=case_when(
UNEM01==1 ~ 1,
UNEM02==1 & UNEM07==3 ~ 1,
UNEM04==1 ~ 1,
UNEM02==1 & UNEM07==1 & (UNEM08==1 | UNEM08==2) ~ 1,
UNEM05==1 & UNEM06==3 ~ 1,
UNEM05==1 & (UNEM06==1 | UNEM06==2) & (UNEM08==1 | UNEM08==2) ~ 1),
TRUE ~ 0
) %>%
mutate(unemployed=case_when(
employed==0 & UNEM09==1 & UNEM10==1 ~ 1,
TRUE ~ 0)
) %>%
mutate(labour_force=case_when(
employed==1 | unemployed==1 ~ 1)
) %>%
mutate(outcome13_3=unemployed/labour_force)
table(main$outcome13_3)
###14.1 Proportion of returnees with legally recognized identity documents or credentials to support the return
##Module :REG01 - REG02 - REG03 / REG05 - REG06
###DISAGGREGATE FOR RETURNEES ONLY
##This indicator comes from the individual dataset
###Calculate valid identity documents for under 5 with REG05 and REG06 variables
#ind$REG05a - passport
#ind$REG05b - civil/government issued ID
#ind$REG05c - residency permit
#ind$REG05d - statelessness documentation
#ind$REG05e - household card of address/family book
#ind$REG05f - social security card
#ind$REG06 - any other document establishes identity
#add birth certificate as additional document from REG03
ind <- ind %>%
mutate(document_under5=case_when(
REG05a==1 | REG05b==1 | REG05c==1 | REG05d==1 | REG05e==1 | REG05f==1 |REG06==1 | REG03==1 ~ 1,
REG05a==0 & REG05b==0 & REG05c==0 & REG05d==0 & REG05e==0 & REG05f==0 & REG06==0 & REG03==0 ~ 0, TRUE ~ NA_real_
))
###Calculate valid identity documents for above 5 with REG01 and REG02 variables
#ind$REG01a # passport
#ind$REG01b # birth certificate
#ind$REG01c # civil/ government issued ID
#ind$REG01d # residency permit
#ind$REG01e # statelessness documentation
#ind$REG01f # household card of address/family book
#ind$REG01g # social security card
#ind$REG02 # any other document establishes identity
ind <- ind %>%
mutate(document_above5=case_when(
REG01a==1 | REG01b==1 | REG01c==1 | REG01d==1 | REG01e==1 | REG01f==1 | REG01g==1 |REG02==1 ~ 1,
REG01a==0 & REG01b==0 & REG01c==0 & REG01d==0 & REG01e==0 & REG01f==0 & REG01g==0 & REG02==0 ~ 0, TRUE ~ NA_real_)
##Combine both age groups
) %>%
mutate(outcome14_1=case_when(
(document_above5==1 | document_under5==1) ~ 1,
(document_above5==0 | document_under5==0) ~ 0)
) %>%
mutate(outcome14_1=labelled(outcome14_1,
labels=c(
'Yes'=1,
'No'=0
),
label="Proportion of returnees with legally recognized identity documents or credentials"))
###16.1 Proportion of PoC with secure tenure rights and/or property rights to housing and/or land
##Module :DWE06-DWE07 & DWE10-DWE11
main$DWE06 <- labelled_chr2dbl(main$DWE06)
main$DWE07 <- labelled_chr2dbl(main$DWE07)
main$DWE10 <- labelled_chr2dbl(main$DWE10)
main$DWE11 <- labelled_chr2dbl(main$DWE11)
main <- main %>%
mutate(housing_cond1=case_when(
(DWE11==1 | DWE11==2 ) ~ 1, # likelihood of losing right for housing is unlikely
TRUE ~ 0)
) %>%
mutate(housing_cond2=case_when(