Function to calculate palma ratio from deciles

compute_palma_ratio(
  df,
  group_cols = c("country", "year"),
  category_col = "Category",
  income_col = "pred_shares"
)

Arguments

df

dataframe with decile data

group_cols

variables to group by

category_col

column with categorical definitions for deciles

inc_col

column with income shares. Make sure these are normalized that is they range from 0-1