Project

General

Profile

Support #1905 ยป hhresp_helpbuy.R

R code for issue replication - Rory Coulter, 05/19/2023 12:04 PM

 
# Code for checking the helpbuy questions on W12 hhresp file


# Libraries (install first as required)
packages <- c("tidyverse", "haven", "lubridate", "descr")

lapply(packages, library, character.only = T)

rm(packages)




# Load W12 hhresp from computer (adapt file path below first)
UKHLS_W12_hhresp <- read_dta(file = "./Datasets/SN6614/UKDA-6614-stata/stata/stata13_se/ukhls/l_hhresp.dta") %>%
mutate_if(haven::is.labelled, haven::as_factor)




# Retain the variables we need for checking the issue
UKHLS_test <- select(UKHLS_W12_hhresp,
l_hidp, l_ivfho, l_origadd,
l_intdatem, l_intdatey,
l_hholdmodedv,
l_hsownd,
starts_with("l_helpbuy"))





# Helpbuy questions are routed to owners only - so drop everyone else
table(UKHLS_test$l_hsownd, UKHLS_test$l_helpbuy1, useNA = "ifany")


UKHLS_test <- filter(UKHLS_test,
l_hsownd %in% c("Owned outright",
"Owned/being bought on mortgage",
"Shared ownership (part-owned part-rented"))



# No obvious tenure patterning in inapplicable codes on helpbuy variables
table(UKHLS_test$l_hsownd, UKHLS_test$l_helpbuy1, useNA = "ifany")
# Note - number of inapplicable/refusal/DK is constant across helpbuy variables



# Generate interview date indicator to explore whether dates are part of the
# missing data puzzle
UKHLS_test <- mutate(UKHLS_test,
intdate = my(paste(as.character(l_intdatem),
as.character(l_intdatey),
sep = " ")))



# Examine helpbuy pattern by interview time
crosstab(UKHLS_test$intdate, UKHLS_test$l_helpbuy1, plot = F, prop.r = T)
# Note - can see the big jump in 'inapplicable' codes at Jan 2021. Prior to Jan '21
# around 20% were inapplicable each month but from Jan this is 70+%



# Now examine whether interview mode has a bearing on this
table(UKHLS_test$l_hholdmodedv, useNA ="ifany")

crosstab(UKHLS_test$l_hholdmodedv, UKHLS_test$l_helpbuy1, prop.r = T,
plot = F) # Overall higher NA from CAWI, middle CATI, lowest CAPI

capi <- filter(UKHLS_test, l_hholdmodedv == "capi")

crosstab(capi$intdate, capi$l_helpbuy1, prop.r = T, plot = F)
# Low n CAPI in this wave due to COVID

cati <- filter(UKHLS_test, l_hholdmodedv == "cati")

crosstab(cati$intdate, cati$l_helpbuy1, prop.r = T, plot = F)
# Percentage of CATI respondents with inapplicable values is low until Feb 21
# then increases hugely

cawi <- filter(UKHLS_test, l_hholdmodedv == "cawi")

crosstab(cawi$intdate, cawi$l_helpbuy1, prop.r = T, plot = F)
# Sudden jump in inapplicables from ~20% in 2020 to >80% in January 2021.

# Overall conclusion - through 2020 most owner respondents did report values
# on helpbuy. However, from 2021, across CATI and CAWI we see a switch to
# much higher % inapplicable. The reason for this is unclear.



    (1-1/1)