rm(list=ls(all=t))
filename <- "Section_5" # !!!Update filename
functions_vers <- "functions_1.8.R" # !!!Update helper functions file
source (functions_vers)
Visually inspect variables in "dictionary.csv" and flag for risk, using the following flags:
# Direct PII: Respondent Names, Addresses, Identification Numbers, Phone Numbers
# Direct PII-team: Interviewer Names, other field team names
# Indirect PII-ordinal: Date of birth, Age, income, education, household composition.
# Indirect PII-categorical: Gender, education, ethnicity, nationality,
# occupation, employer, head of household, marital status
# GPS: Longitude, Latitude
# Small Location: Location (<100,000)
# Large Location (>100,000)
# Weight: weightVar
# Household ID: hhId,
# Open-ends: Review responses for any sensitive information, redact as necessary
# !!!Include any Direct PII variables
# !!!No Direct PII
# !!!No Direct PII - team
# !!!Include relevant variables, but check their population size first to confirm they are <100,000
# !!!No Small locations
# !!!No Indirect PII - Ordinal
# !!!No Indirect PII - Categorical
# Recode those with very specific values.
# !!!Insufficient demographic data
# !!! Identify open-end variables here:
open_ends <- c("c_s5q1noresponse", "c_mother_noresponse", "c_father_noresponse")
report_open (list_open_ends = open_ends)
# Review "verbatims.csv". Identify variables to be deleted or redacted and their row number
mydata$c_mother_noresponse[334] <- "[Tagalog]"
mydata$c_mother_noresponse[335] <- "[Tagalog]"
mydata$c_father_noresponse[334] <- "[Tagalog]"
mydata$c_father_noresponse[1556] <- "His father left them [date redacted] in 2012"
mydata$c_father_noresponse[2114] <- "[name redacted] His father was already died."
mydata$c_father_noresponse[2116] <- "[name redacted] His father was already died."
mydata$c_father_noresponse[4130] <- "The father is deceased [date redacted] in 2014"
# !!!No GPS data
haven::write_dta(mydata, paste0(filename, "_PU.dta"))
haven::write_sav(mydata, paste0(filename, "_PU.sav"))
# Add report title dynamically
title_var <- paste0("DOL-ILAB SDC - ", filename)