Add Infrequent Expenditure Type Proportions
Source:R/add_expenditure_type_prop_infreq.R
add_expenditure_type_prop_infreq.Rd
This function calculates the proportion of each infrequent expenditure type relative to the total infrequent expenditure. It adds new columns to the input data frame representing these proportions.
Prerequisite function:
add_expenditure_type_zero_infreq.R
Usage
add_expenditure_type_prop_infreq(
df,
cm_expenditure_infrequent_shelter = "cm_expenditure_infrequent_shelter",
cm_expenditure_infrequent_nfi = "cm_expenditure_infrequent_nfi",
cm_expenditure_infrequent_health = "cm_expenditure_infrequent_health",
cm_expenditure_infrequent_education = "cm_expenditure_infrequent_education",
cm_expenditure_infrequent_debt = "cm_expenditure_infrequent_debt",
cm_expenditure_infrequent_other = "cm_expenditure_infrequent_other"
)
Arguments
- df
A data frame containing infrequent expenditure data.
- cm_expenditure_infrequent_shelter
Column name for shelter maintenance or repair expenditure amount.
- cm_expenditure_infrequent_nfi
Column containing expenditure amount for non-food household items for infrequent purchase, such as blankets, cooking pots, clothing, etc.
- cm_expenditure_infrequent_health
Column name for health-related expenditures, such as healthcare, medicine, etc.
- cm_expenditure_infrequent_education
Column name for education-related expenditures, such school fees, supplies, uniforms, etc.
- cm_expenditure_infrequent_debt
Column containing expenditure amount for debt repayment.
- cm_expenditure_infrequent_other
Column name for all other infrequent expenditures.
Value
A data frame with additional columns:
cm_expenditure_infrequent_total: The total infrequent expenditure amount.
cm_expenditure_infrequent_shelter_prop: Proportion of shelter maintenance or repair expenditure.
cm_expenditure_infrequent_nfi_prop: Proportion of non-food household items expenditure.
cm_expenditure_infrequent_health_prop: Proportion of health-related expenditures.
cm_expenditure_infrequent_education_prop: Proportion of education-related expenditures.
cm_expenditure_infrequent_debt_prop: Proportion of debt repayment expenditure.
cm_expenditure_infrequent_other_prop: Proportion of other infrequent expenditures.