Derive informal care received variable
Arguments
- df
A data frame containing cleaned data for a survey cycle. Must contain the following columns, each indicating whether the respondent received informal care along a particular dimension:
CR2_FAM_PR: Personal careCR2_FAM_MD: Medical careCR2_FAM_MG: Care managementCR2_FAM_AC: Home maintenance and outdoor workCR2_FAM_TR: TransportationCR2_FAM_ML: Meal preparationCR2_FAM_NONE: No help receivedCR2_FAM_OT: Other helpCR2_FAM_DK_NA: Don't knowCR2_FAM_REFUSED: Refused
Value
A data frame with the same number of rows as df plus a new column
CR2_FRHC indicating whether the respondent received informal care.
Details
Intended for use with Follow-up 2 data, for which this variable was not
derived by the data provider. Four variables that appear in the original
algorithm (CR2_FAM_CS, CR2_FAM_MB, CR2_FAM_MISSING, and CR2_FAM_MN)
are excluded from the function because they are unavailable at Follow-up 2.
Examples
df <- data.frame(
CR2_FAM_PR = 0,
CR2_FAM_MD = 1,
CR2_FAM_MG = 0,
CR2_FAM_AC = 0,
CR2_FAM_TR = 1,
CR2_FAM_ML = 1,
CR2_FAM_NONE = 0,
CR2_FAM_OT = 0,
CR2_FAM_DK_NA = 0,
CR2_FAM_REFUSED = 0
)
derive_cr2_frhc(df)
#> CR2_FAM_PR CR2_FAM_MD CR2_FAM_MG CR2_FAM_AC CR2_FAM_TR CR2_FAM_ML
#> 1 0 1 0 0 1 1
#> CR2_FAM_NONE CR2_FAM_OT CR2_FAM_DK_NA CR2_FAM_REFUSED CR2_FRHC
#> 1 0 0 0 0 1
