RISE_ID/T4_annual_survey/O3_T4_ID-corrections.R

# ####################################################
# ##            CORRECTIONS                         ##
# ## This file contains running corrections         ##
# ## to the data before any analysis was conducted. ##
# ####################################################
#

#GENERAL CORRECTIONS

# if is.na(respondent_name), then  respondent_name_text should be NA
hhd <- hhd %>% 
  mutate(respondent_name_text = ifelse(is.na(respondent_name), NA, respondent_name_text))


# RECODE person_pull_gender_final - to make all the same male and female - recode 0/1
table(hhd_person_details$person_pull_gender_final)

hhd_person_details <- hhd_person_details %>% 
  mutate(person_pull_gender_final = ifelse(person_pull_gender_final==1, "male", 
                                           ifelse(person_pull_gender_final==0, "female", 
                                                  person_pull_gender_final)))

#remove respondent when child refused for survey? respondent_child
table(hhd_child_loop$child_no_survey, is.na(hhd_child_loop$respondent_child))
#all 4 have a calculated respondent!

hhd_child_loop<- hhd_child_loop %>% 
  mutate(respondent_child = ifelse(child_no_survey==1, NA, respondent_child))




# # FIXES and their descriptions can be found here:
# # https://docs.google.com/spreadsheets/d/1O31YAYQ8ZeC0_myg2JiLvZrGyhTZdKh4k6nk6eSJvOU/edit#gid=884184821
#
# #TRY GROUPING FIXES BY SETTLEMENT
#
# ####################################################
# #
#
# #######################
#BORONG RAYA BARU;  Jl Borong Raya Baru 

# Jl Borong Raya Baru	#14
# remove Nurmi child (old child consent form) - this is incorrect; 
# Nurmi is mother; new people in household were added in surey - good!

# x <- departed %>% 
#   filter (settlement_barcode == "Jl Borong Raya Baru") %>% 
#   filter (extract_house_no == 14) 
# rm(x)

# Fix spelling of names for Borong Raya #5****************
#where else do I need to fix spelling?????????????????????????????????

# $nam[$ == "" & $extract_house_no == 5 & ]}<-""
# Tajuddin A. Baso (head of hhd; now became hhd id)
# Marti (correct)
# Marwati Tajuddin 
# Marliyanti (before: Marianti)
# Muhammad Arif Rahman
# Muhammad Arya Saputra (before: Muhammad Aril)
# Nur Alyah (correct)
# Salsabila Putri
# Muhammad Al-Furqon (before: Alpurton)
# Abdul Salam (before: Agus Salam)

# Raya Baru #42 - also a rent house, pak Ismail moved out of #42, now new tenant lives there (Pak Ahmad)
#CHECKED - NEW HHD IN; OLD HHD MOVED OUT


#####################
#KG BARU, ANTANG

#Kg Baru #6 - fix VERIFY; should be = 1 (typo in survey)
hhd$verify1[hhd$settlement_barcode=="Kg Baru, Antang" & hhd$extract_house_no==6 & hhd$today == "2019-11-18"]<-1

#Kg Baru Antang #36 - duplicate surveys (12 and 19 Nov 2019) - keep the first survey (remove 19 nov 2019)
hhd <- hhd %>% 
  filter (!(settlement_barcode == "Kg Baru, Antang" & extract_house_no == 36 & hhd_id_final == "Muhammad Imran" 
            & today == "2019-11-19"))
hhd_child_loop <- hhd_child_loop %>% 
  filter (!(PARENT_KEY == "uuid:d1f3cc85-6dbb-4ec4-a612-b8bfe54defe3"))
hhd_child_feces_kit <- hhd_child_feces_kit %>% 
  filter (!(PARENT_KEY == "uuid:d1f3cc85-6dbb-4ec4-a612-b8bfe54defe3"))
hhd_person_details <- hhd_person_details %>% 
  filter (!(PARENT_KEY == "uuid:d1f3cc85-6dbb-4ec4-a612-b8bfe54defe3"))
hhd_child_feces_kit <- hhd_child_feces_kit %>% 
  filter (!(PARENT_KEY == "uuid:d1f3cc85-6dbb-4ec4-a612-b8bfe54defe3"))
hhd.depart <- hhd.depart %>% 
  filter (!(PARENT_KEY == "uuid:d1f3cc85-6dbb-4ec4-a612-b8bfe54defe3"))
hhd.members.filter <- hhd.members.filter  %>% 
  filter (!(PARENT_KEY == "uuid:d1f3cc85-6dbb-4ec4-a612-b8bfe54defe3"))  
hhd.members.reason <- hhd.members.reason %>% 
  filter (!(PARENT_KEY == "uuid:d1f3cc85-6dbb-4ec4-a612-b8bfe54defe3"))
new.people.3 <-   new.people.3 %>% 
  filter (!(PARENT_KEY == "uuid:d1f3cc85-6dbb-4ec4-a612-b8bfe54defe3"))
new.people.2 <- new.people.2 %>% 
  filter (!(PARENT_KEY == "uuid:d1f3cc85-6dbb-4ec4-a612-b8bfe54defe3"))
new.people.names <- new.people.names %>% 
  filter (!(PARENT_KEY == "uuid:d1f3cc85-6dbb-4ec4-a612-b8bfe54defe3"))
new.people.info <- new.people.info  %>% 
  filter (!(PARENT_KEY == "uuid:d1f3cc85-6dbb-4ec4-a612-b8bfe54defe3"))
  





#need to check each of these *************
# Antang #59 - yes, the household moved out of #59
# Antang #99 - yes, the household moved out of #99 to #13 in the same settlement
# Antang #112 - there were 2 hhd listed, but when CFW checked they are the same family (husband listed as one hhd, wife and children listed as another). So CFW removed the wife hhd, and added the wife and children into the husband hhd. Correcting it from 2 hhd to 1 hhd accordingly.
# Antang #146 - moved in from house #71; CFW said they moved in in 2013 - again, this can't be right??? can you check? this is related to surveyCTO of house #147; there was miscommunication and the house was given 2 new numbers (146 and 147). Data of #147 should be #146 (same house). They moved in to #146 from #70 (not #71). And they moved in in 2018, not 2013.
# Antang #70 - the one that has departed is the hhd in #146 (Pak Marzuki). the other hhd that still lives in #70 was surveyed.
# Antang #79 - yes, this is a refusal (survey was completed, as in the respondent refused and no revisits required)


#####################
#PAMPANG   Jl Barawaja 2, Pampang

# Pampang #21 - this is a rent house, the previous tenant already moved out, 
# now other hhd lives in #21 (they are the son of hhd #22)
#CHECKED - NEW HHD MOVED IN - YES; HHD MOVED OUT - YES


#####################
#ALLA-ALLA

# Alla-Alla #12 - 
#the CFW recorded that they left in Oct 2017; This can't be right because we did baseline in 2018; Can you please check? 
#This house is owned by Bu Martha. The hhd that was removed by CWF (Paulus and his family), moved out of that house Oct 2017. 
#During baseline it was Bu Martha that was interviewed, but somehow her name is not listed in that house. 
#So CFW now added Bu Martha in that house, and removed Paulus. 
#Possibly Paulus was added during baseline based on the government household identity (in which he is still listed); 
#even though he does not live there anymore.

#what was done in the survey:
#1) changed name of hhd_id to Martha
#2) removed hhd_id=Paulus (#2)
#3) ???did they remove everyone from the house? ********************CHECK???
#FIX: CHANGE HHD_ID FOR ID#10187	Marta Ratu to Hera

# Kg Alla-Alla



#####################
#KAWASAN UNTIA

#UNTIA #8 - ******************
# We received a sample with N-F0-000933, that when entered to LIMS, 
# there was already a sample with that barcode on September 2019. 
# There was a note in the comment "assigned new barcode"; and I remember the occasion as well.
# Therefore, today we assigned a new barcode to the sample. New barcode is N-F0-000625. 
# And we edited the barcode on the feces surveycto as well (Untia house #8). 
# So now, the LIMS and the feces surveycto barcode is fine.
#FIONA - already fixed in feces_collect;  also been fixed in kit hand-out (hhd_child_feces_kit)    - no fix required

#UNTIA #22 - Person who moved out of #22, Muhammad Yahya, moved to #106, not to #104. *********************
hhd.members.reason$move_house_no[hhd.members.reason$move_house_no==104 &
                                   hhd.members.reason$KEY == "uuid:64f4b8ca-c1e7-4946-8d26-a46c9e38a2a0/hhd_members-reason_departed[1]" &
                                   hhd.members.reason$name_departed2 == "Muhammad Yahya (age = 2.8)"]<-106

#UNTIA #54 
# A person passed away in house #54 (the mother, Dg. Ngiji) during the last 6-monthly survey. 
# CFW removed Dg. Ngiji from hhd #54 last round. Now, the whole #54 household is no longer on our list. 
# Therefore, yesterday CFW input the household as new household (re-do consent as well). 
#??????????what to do with this one?




#UNTIA #110 - moved in from house #11, but wasn't on the list??????????????????????????
#waiting for answer from Ruzka

# They were in the 2019O3 list - 6-monthly survey
# Junaedi	#11276; Meri	#11425; 
# The 3 people added to house #110 are:
# Junaedi Junaedi (age 27.7) - matches a name in 6-monthly survey,
# Meri Handayani (age 24.3)- matches a name in 6-monthly survey,
# Umaira Nur Afifa (age 4.5) born in 2015 - does not match, 
# but there is a Khumairah born in 2016; Do we think this is the same child?




#####################
#####################
#DATA CHECKS
# From Ruzka - email 21 NOV 2019:********************************
# household is no longer living in that house - double check




# 
Monash-RISE/riseR documentation built on Dec. 11, 2019, 9:49 a.m.