Derive care provided variable
Arguments
- df
A data frame containing cleaned data for a survey cycle. Must contain the following columns, each indicating whether the respondent provided care along a particular dimension:
CAG_HLT_PR: Personal careCAG_HLT_MD: Medical careCAG_HLT_MG: Care managementCAG_HLT_AC: Home maintenance and outdoor workCAG_HLT_TR: TransportationCAG_HLT_ML: Meal preparationCAG_HLT_NONE: No help providedCAG_HLT_OT: Other helpCAG_HLT_DK_NA: Don't knowCAG_HLT_REFUSED: RefusedCAG_HLT_MB: Mobility assistanceCAG_HLT_CS: Social and emotional supportCAG_HLT_MO: Monetary assistance or financial management
Value
A data frame with the same number of rows as df plus a new column
CAG_FPAS indicating whether the respondent provided care.
Details
Intended for use with Follow-up 2 data, for which this variable was not
derived by the data provider. Five variables that appear in the original
algorithm (CAG_HLT_MISSING, CAG_HLT_FM, CAG_HLT_MC, CAG_HLT_TA, and
CAG_HLT_HC) are excluded from the function because they are unavailable at
Follow-up 2.
Examples
df <- data.frame(
CAG_HLT_PR = 1,
CAG_HLT_MD = 1,
CAG_HLT_MG = 0,
CAG_HLT_AC = 0,
CAG_HLT_TR = 0,
CAG_HLT_ML = 0,
CAG_HLT_NONE = 0,
CAG_HLT_OT = 0,
CAG_HLT_DK_NA = 0,
CAG_HLT_REFUSED = 0,
CAG_HLT_MB = 0,
CAG_HLT_CS = 0,
CAG_HLT_MO = 0
)
derive_cag_fpas(df)
#> CAG_HLT_PR CAG_HLT_MD CAG_HLT_MG CAG_HLT_AC CAG_HLT_TR CAG_HLT_ML
#> 1 1 1 0 0 0 0
#> CAG_HLT_NONE CAG_HLT_OT CAG_HLT_DK_NA CAG_HLT_REFUSED CAG_HLT_MB CAG_HLT_CS
#> 1 0 0 0 0 0 0
#> CAG_HLT_MO CAG_FPAS
#> 1 0 1
