Description Usage Arguments Examples
This function calculates bad rates for any number of grouping variables.
1 | calculate_bad_rate(df, performance, top_level = "1", ...)
|
df |
A data drame |
performance |
Performance variable |
top_level |
Top level of the performance variable. Defaults to 1 |
... |
Additional grouping variables for bad rate calculation |
1 2 3 4 5 6 7 8 9 10 11 12 | data <- recipes::credit_data %>%
first_to_lower()
data %>%
calculate_bad_rate(status, top_level = "bad")
data %>%
mutate(status = ifelse(status == "bad", "Npl", "Pl")) %>%
calculate_bad_rate(status, "Npl")
data %>%
calculate_bad_rate(performance = status, top_level = "bad", marital)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.