Household table

Note: This document captures information that may have been updated. Please refer to the Summary and findings section instead.

Summary

  1. Pre/Post variables: A number of variables in the Household table seek to capture information about the difference in living conditions of the households, before and after the earthquake. These include:
    1. Residence (respreq, resposq)
    2. Source of Water (h2o_pre, h2o_pos)
    3. Source of cooking fuel (fir_pre, fir_pos)
    4. Source of light (lit_pre, lit_pos)
    5. Type of toilet (toilet_pre, toilet_pos)
    6. Type of fixed assets owned (ast_pre, ast_pos), this variable is also a multiselect variable (refer to 3.)

    One thing that we will need to pay attention to is regarding the way in which we aggregate this information at a building level, given that there may be more than one HHD per building.

  2. Variables with no definitions in the data dictionary: We weren’t able to locate information for certain variables in the data dictionary.
    1. Numeric: Some variables look like they may be of type Numeric. They include:
      • age: It is not so clear as to what this variable represents (age of the respondent vs. age of the building?)
      • hhd_size: It may contain information around the size of the household, but not sure
      • death_cn: Count of people who died post earthquake.
      • loss_cn: Count of people who were badly injured/missing post earthquake.
      • edrop_cn: Count of people who left their education post earthquake.
      • pdrop_cn: Count of pregnant women who stopped checkups earthquake.
      • vdrop_cn: Count of children who stopped getting vaccinated post earthquake.
      • oc_ch_cn: Count of people who had to change their occupation post earthquake.

      Further investigation is needed as to what these columns mean.

    2. There were two additional variables without any definitions. These columns only contained NAs for the subset of data that we analyzed. respreqd and resposqd

  3. Multiselect Variables: The pre/post variables ast_pre and ast_pos are multiselect variables and require treatment

  4. Special Case - Rahat: This column supposedly captures “the type of earthquake victim id card recieved” This also looks like a multiselect variable, but will need to confirm with the app developers as to why it was made a multiselect variable? And how values inside it are supposed to be interpreted.

Methodology

This section contains code used for the analysis, please jump to the next section for results

A small subset of 5000 rows were taken as an input for analysis. All variables in the table were converted to factors, and a summary was yielded from each table.

# Exploration of household table from pgSql database
library(RPostgreSQL)
library(dplyr)

root.dir <- "~/hrrp/openhrrp-src"

pg <- dbDriver("PostgreSQL")
con <- dbConnect(pg, user="postgres", password="postgres",
                 host="localhost", dbname="openhrrp")

##
# dbExistsTable(con, "household")

df_household <- dbGetQuery(con, "SELECT * from household limit 5000; ")
df_household <- as.data.frame(sapply(df_household, as.numeric))

write.csv(as.data.frame(colnames(df_household)), file=paste0(root.dir, "/outputs/householdColNames.csv"))

df_household_af <- as.data.frame(sapply(df_household, as.factor))


summarizeColumn <- function(column) {
  return (summary(column))
}

summarizeColumn(df_household_af$vdrop_cn)

Results

The table below outlines current status of the same:

Column Name Present in building data dictionary Name Type Is pre/post Range Is multiselect? Comments
dist              
vcode              
vdcmun              
ward              
EA              
howner_sn              
house_sn              
hhd_sn              
gender Yes Gender of household head Categorical   1-3    
age No   Numerical       Dont know what this means exactly, can it be the age of the person responding/ or the building?
Ishhd Yes Is rspondent household head Categorical   1-2    
rel_hres Yes Respondent’s relation to household head Categorical   1-10   Data will have NA’s because it is only filled for Ishhd=2
id_type Yes Household head’s ID card type Categorical   1-6    
cast Yes Cast/Ethnicity of Household Head Categorical   1-140, 990    
edu_levl Yes Education Level of Household Head Categorical   1-15, 90,91,92   Might need restructuring to simpler groups KG, Primary, Secondary, Intermediat, UG, Masters
bank_acc Yes Does household head have a bank account? Categorical   1-2    
poseq_shel Yes Household’s shelter condition after earthquake Categorical   1-5    
respreq Yes Household’s residence before earthquake Categorical yes 1-3    
resposq Yes Household’s residence after earthquake Categorical yes 1-3    
rahat1 Yes type of earthquake victim id card received Categorical   1-6 Looks like it/ have to confirm with PUJAN  
rahat2 Yes type of earthquake victim id card received Categorical   1-6 Looks like it/ have to confirm with PUJAN  
rahat3 Yes type of earthquake victim id card received Categorical   1-6 Looks like it/ have to confirm with PUJAN  
rahat4 Yes type of earthquake victim id card received Categorical   1-6 Looks like it/ have to confirm with PUJAN  
rahat5 Yes type of earthquake victim id card received Categorical   1-6 Looks like it/ have to confirm with PUJAN  
eqid_typ Yes Earthquake ID Type Categorical   1-4    
income Yes Household’s average monthly income Categorical   1-5    
hhd_size No   Numerical     Looks like the size of the household  
death Yes Has anybody died after earthquake Categorical   1-2    
death_cn No   ?   1,2 Looks like thr count of people who died post earthquake  
loss Yes Has anybody been badly injured/missing after the earthquage Categorical   1,2    
loss_cn No   ?     Looks like thr count of people who wen missing post earthquake  
edrop_tf Yes Has anyone left school PE? Categorical   1,2,3 Data has only twos and threes, no 1s  
edrop_cn No   ?     Looks like thr count of people who dropped educ. post earthquake  
pdrop_tf Yes Has anyone left pregnancy checkup PE? Categorical   1,2,3    
pdrop_cn No   ?     Looks like thr count of people who dropped pregnancy checkups. post earthquake  
vdrop_tf Yes Has family stopped getting children vaccnated PE? Categorical   1,2,3    
vdrop_cn No   ?     Looks like thr count of children who stopped getting vaccination checkups. post earthquake  
oc_ch_tf Yes Has anyone had to change their occupation PE? Categorical   1,2,3    
oc_ch_cn No   ?     Looks like thr numper of people who changed occupation post earthquake  
h2o_pre Yes Main Source of Water before earthquake Categorical yes 1-7    
h2o_pos Yes Main Source of Water post earthquake Categorical yes 1-7    
fir_pre Yes Main source of fuel before earthquake Categorical yes 1-6    
fir_pos Yes Main Source of fuel post earthquake Categorical yes 1-6    
lit_pre Yes Main source of light before earthquake Categorical yes 1-6    
lit_pos Yes Main Source of light post earthquake Categorical yes 1-6    
toilet_pre Yes Type of toilet (pre) Categorical yes 1-4    
toilet_pos Yes Type of toilet (post Categorical yes 1-4    
ast_pre1 Yes Fixed assets (pre) Categorical yes 1-12 yes  
ast_pre2 Yes Fixed assets (pre) Categorical yes 1-12 yes  
ast_pre3 Yes Fixed assets (pre) Categorical yes 1-12 yes  
ast_pre4 Yes Fixed assets (pre) Categorical yes 1-12 yes  
ast_pre5 Yes Fixed assets (pre) Categorical yes 1-12 yes  
ast_pre6 Yes Fixed assets (pre) Categorical yes 1-12 yes  
ast_pre7 Yes Fixed assets (pre) Categorical yes 1-12 yes  
ast_pre8 Yes Fixed assets (pre) Categorical yes 1-12 yes  
ast_pre9 Yes Fixed assets (pre) Categorical yes 1-12 yes  
ast_pre10 Yes Fixed assets (pre) Categorical yes 1-12 yes  
ast_pre11 Yes Fixed assets (pre) Categorical yes 1-12 yes  
ast_pre12 Yes Fixed assets (pre) Categorical yes 1-12 yes  
ast_pos1 Yes Fixed assets (post) Categorical yes 1-12 yes  
ast_pos2 Yes Fixed assets (post) Categorical yes 1-12 yes  
ast_pos3 Yes Fixed assets (post) Categorical yes 1-12 yes  
ast_pos4 Yes Fixed assets (post) Categorical yes 1-12 yes  
ast_pos5 Yes Fixed assets (post) Categorical yes 1-12 yes  
ast_pos6 Yes Fixed assets (post) Categorical yes 1-12 yes  
ast_pos7 Yes Fixed assets (post) Categorical yes 1-12 yes  
ast_pos8 Yes Fixed assets (post) Categorical yes 1-12 yes  
ast_pos9 Yes Fixed assets (post) Categorical yes 1-12 yes  
ast_pos10 Yes Fixed assets (post) Categorical yes 1-12 yes  
ast_pos11 Yes Fixed assets (post) Categorical yes 1-12 yes  
ast_pos12 Yes Fixed assets (post) Categorical yes 1-12 yes  
respreqd No           All values are Nas
resposqd No