Project

General

Profile

Support #1905 ยป hhresp_helpbuy.R

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

 
1
# Code for checking the helpbuy questions on W12 hhresp file
2

    
3

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

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

    
9
rm(packages)
10

    
11

    
12

    
13

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

    
18

    
19

    
20

    
21
# Retain the variables we need for checking the issue
22
UKHLS_test <- select(UKHLS_W12_hhresp,
23
                     l_hidp, l_ivfho, l_origadd,
24
                     l_intdatem, l_intdatey,
25
                     l_hholdmodedv,
26
                     l_hsownd,
27
                     starts_with("l_helpbuy"))
28

    
29

    
30

    
31

    
32

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

    
36

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

    
42

    
43

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

    
48

    
49

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

    
57

    
58

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

    
64

    
65

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

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

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

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

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

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

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

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

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

    
92

    
93

    
    (1-1/1)