Derive formal 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 formal care along a particular dimension:
CR1_PRO_PR: Personal careCR1_PRO_MD: Medical careCR1_PRO_MG: Care managementCR1_PRO_AC: Home maintenance and outdoor workCR1_PRO_TR: TransportationCR1_PRO_ML: Meal preparationCR1_PRO_NONE: No help receivedCR1_PRO_OT: Other helpCR1_PRO_DK_NA: Don't knowCR1_PRO_REFUSED: RefusedCR1_PRO_PT: Physical therapyCR1_PRO_TA: Training and adaptation assistance
Value
A data frame with the same number of rows as df plus a new column
CR1_FRHC indicating whether the respondent received formal care.
Details
Intended for use with Follow-up 2 data, for which this variable was not
derived by the data provider. Two variables that appear in the original
algorithm (CR1_PRO_MC and CR1_PRO_MISSING) are excluded from the function
because they are unavailable at Follow-up 2.
Examples
df <- data.frame(
CR1_PRO_PR = 0,
CR1_PRO_MD = 0,
CR1_PRO_MG = 0,
CR1_PRO_AC = 0,
CR1_PRO_TR = 0,
CR1_PRO_ML = 1,
CR1_PRO_NONE = 0,
CR1_PRO_OT = 0,
CR1_PRO_DK_NA = 0,
CR1_PRO_REFUSED = 0,
CR1_PRO_PT = 0,
CR1_PRO_TA = 0
)
derive_cr1_frhc(df)
#> CR1_PRO_PR CR1_PRO_MD CR1_PRO_MG CR1_PRO_AC CR1_PRO_TR CR1_PRO_ML
#> 1 0 0 0 0 0 1
#> CR1_PRO_NONE CR1_PRO_OT CR1_PRO_DK_NA CR1_PRO_REFUSED CR1_PRO_PT CR1_PRO_TA
#> 1 0 0 0 0 0 0
#> CR1_FRHC
#> 1 1
