Given health expenditure data by state (or district), compute correlations between every food group/item expenditure share and a specified disease category's hospitalization cost.
Usage
ics_correlate_food_disease(
con,
health_df,
disease = "mean_exp",
round = "HCES-2022-23",
level = c("both", "group", "item"),
min_states = 10L
)Arguments
- con
A DBI connection from
ics_connect().- health_df
A data frame with columns
state_nameand at least one numeric disease expenditure column. Typically fromindiahealthsurvey::ihs_state_summary().- disease
Column name in
health_dfcontaining the disease cost to correlate against. Default"mean_exp".- round
Consumption survey round. Default
"HCES-2022-23".- level
One of
"group"(13 food groups),"item"(individual items), or"both".- min_states
Minimum states with data for a correlation to be computed. Default 10.
Value
A tibble with columns: food, type ("group" or "item"),
correlation, n_states, sorted by absolute correlation.
Details
This answers: "Which foods are most associated with spending on cardiovascular disease / diabetes / cancer at the state level?"
Examples
if (FALSE) { # \dontrun{
library(indiahealthsurvey)
hcon <- ihs_connect("~/data/nss_health")
cvd <- ihs_state_summary(hcon, "hospitalization", by_disease = TRUE) |>
dplyr::filter(disease_category == "Cardiovascular")
ihs_disconnect(hcon)
con <- ics_connect("~/data/consumption_parquet")
ics_correlate_food_disease(con, cvd)
} # }