Justin's suggestion: Unifying function that handles both continuous and categorical variables