Add indicator for reduced Household CSI Score(rcsi)
add_eg_rcsi.Rd
Add indicator for reduced Household CSI Score(rcsi)
Usage
add_eg_rcsi(
data,
rCSILessQlty = "rCSILessQlty",
rCSIBorrow = "rCSIBorrow",
rCSIMealSize = "rCSIMealSize",
rCSIMealAdult = "rCSIMealAdult",
rCSIMealNb = "rCSIMealNb",
new_colname = "rcsi"
)
Arguments
- data
dataset
- rCSILessQlty
Column representing question- During the last 7 days, were there days (and, if so, how many) when your household had to rely on less preferred and less expensive food to cope with a lack of food or money to buy it?
- rCSIBorrow
Column representing question- During the last 7 days, were there days (and, if so, how many) when your household had to borrow food or rely on help from a relative or friend to cope with a lack of food or money to buy it?
- rCSIMealSize
Column representing question- During the last 7 days, were there days (and, if so, how many) when your household had to limit portion size of meals at meal times to cope with a lack of food or money to buy it?
- rCSIMealAdult
Column representing question- During the last 7 days, were there days (and, if so, how many) when your household had to restrict consumption by adults in order for small children to eat to cope with a lack of food or money to buy it?
- rCSIMealNb
Column representing question - During the last 7 days, were there days (and, if so, how many) when your household had to reduce number of meals eaten in a day to cope with a lack of food or money to buy it?
- new_colname
The prefix for the new columns. It has to be a string.
Examples
test_data <- data.frame(
rCSILessQlty = c(1, 2, 3, 1),
rCSIBorrow = c(0, 0, 3, 0),
rCSIMealSize = c(4, 2, 6, 1),
rCSIMealAdult = c(4, 3, 5, 0),
rCSIMealNb = c(2, 5, NA_integer_, 1)
)
add_eg_rcsi(test_data)
#> Variable name for rcsi score is rcsi_score
#> Variable name for rcsi category is rcsi_cat
#> rCSILessQlty rCSIBorrow rCSIMealSize rCSIMealAdult rCSIMealNb rcsi_score
#> 1 1 0 4 4 2 19
#> 2 2 0 2 3 5 18
#> 3 3 3 6 5 NA NA
#> 4 1 0 1 0 1 3
#> rcsi_cat
#> 1 High
#> 2 Medium
#> 3 <NA>
#> 4 No to Low