Add the household hunger scale to the dataset
add_eg_hhs.Rd
Add the household hunger scale to the dataset
Usage
add_eg_hhs(
.dataset,
hhs_nofoodhh_1 = "fs_hhs_nofood_yn",
hhs_nofoodhh_1a = "fs_hhs_nofood_freq",
hhs_sleephungry_2 = "fs_hhs_sleephungry_yn",
hhs_sleephungry_2a = "fs_hhs_sleephungry_freq",
hhs_alldaynight_3 = "fs_hhs_daynoteating_yn",
hhs_alldaynight_3a = "fs_hhs_daynoteating_freq",
yes_answer = "yes",
no_answer = "no",
rarely_answer = "rarely_1_2",
sometimes_answer = "sometimes_3_10",
often_answer = "often_10_times"
)
Arguments
- .dataset
Dataset
- hhs_nofoodhh_1
The name of the column "In the past 4 weeks (30 days), was there ever no food to eat of any kind in your house because of lack of resources to get food?". It has to be a string.
- hhs_nofoodhh_1a
The name of the column "How often did this happen in the past (4 weeks/30 days)?". It has to be a string.
- hhs_sleephungry_2
The name of the column "In the past 4 weeks (30 days), did you or any household member go to sleep at night hungry because there was not enough food?". It has to be a string.
- hhs_sleephungry_2a
The name of the column "How often did this happen in the past (4 weeks/30 days)?". It has to be a string.
- hhs_alldaynight_3
The name of the column "In the past 4 weeks (30 days), did you or any household member go a whole day and night without eating anything at all because there was not enough food?". It has to be a string.
- hhs_alldaynight_3a
The name of the column "How often did this happen in the past (4 weeks/30 days)?". It has to be a string.
- yes_answer
Value used for "Yes"
- no_answer
Value used for the "No"
- rarely_answer
Value used for "Rarely (1-2)"
- sometimes_answer
Value used for "Sometimes (3-10)"
- often_answer
Value used for "Often (10+ times)
Value
It returns the dataframe with 12 extras columns: recoded hhs questions, score for the 3 sets of questions (from 0 to 2), the HHS score (from 0 to 6), the HHS category and the HHS IPC category
Examples
{
input_data <- data.frame(
fs_hhs_nofood_yn = c("no", "yes", "no", "no", "no"),
fs_hhs_nofood_freq = c(NA_character_, "rarely_1_2",
NA_character_, NA_character_, NA_character_),
fs_hhs_sleephungry_yn = c("no", "no", "yes", "no", "no"),
fs_hhs_sleephungry_freq = c(NA_character_, NA_character_,
"often_10_times", NA_character_, NA_character_),
fs_hhs_daynoteating_yn = c("no", "no", "yes", "yes", "yes"),
fs_hhs_daynoteating_freq = c(NA_character_, NA_character_, "often_10_times",
"rarely_1_2", "sometimes_3_10")
)
add_eg_hhs(
.dataset = input_data,
hhs_nofoodhh_1 = "fs_hhs_nofood_yn",
hhs_nofoodhh_1a = "fs_hhs_nofood_freq",
hhs_sleephungry_2 = "fs_hhs_sleephungry_yn",
hhs_sleephungry_2a = "fs_hhs_sleephungry_freq",
hhs_alldaynight_3 = "fs_hhs_daynoteating_yn",
hhs_alldaynight_3a = "fs_hhs_daynoteating_freq",
yes_answer = "yes",
no_answer = "no",
rarely_answer = "rarely_1_2",
sometimes_answer = "sometimes_3_10",
often_answer = "often_10_times"
)
}
#> fs_hhs_nofood_yn fs_hhs_nofood_freq fs_hhs_sleephungry_yn
#> 1 no <NA> no
#> 2 yes rarely_1_2 no
#> 3 no <NA> yes
#> 4 no <NA> no
#> 5 no <NA> no
#> fs_hhs_sleephungry_freq fs_hhs_daynoteating_yn fs_hhs_daynoteating_freq
#> 1 <NA> no <NA>
#> 2 <NA> no <NA>
#> 3 often_10_times yes often_10_times
#> 4 <NA> yes rarely_1_2
#> 5 <NA> yes sometimes_3_10
#> fs_hhs_nofood_yn_recoded fs_hhs_nofood_freq_recoded
#> 1 0 0
#> 2 1 1
#> 3 0 0
#> 4 0 0
#> 5 0 0
#> fs_hhs_sleephungry_yn_recoded fs_hhs_sleephungry_freq_recoded
#> 1 0 0
#> 2 0 0
#> 3 1 2
#> 4 0 0
#> 5 0 0
#> fs_hhs_daynoteating_yn_recoded fs_hhs_daynoteating_freq_recoded hhs_comp1
#> 1 0 0 0
#> 2 0 0 1
#> 3 1 2 0
#> 4 1 1 0
#> 5 1 1 0
#> hhs_comp2 hhs_comp3 hhs_score hhs_cat_ipc hhs_cat
#> 1 0 0 0 None No or Little
#> 2 0 0 1 Little No or Little
#> 3 2 2 4 Severe Severe
#> 4 0 1 1 Little No or Little
#> 5 0 1 1 Little No or Little