plot_special | R Documentation |
These functions create additional experience study plots that are not
available or difficult to produce using the autoplot.exp_df()
function.
plot_termination_rates(object, ..., include_cred_adj = FALSE)
plot_actual_to_expected(object, ..., add_hline = TRUE)
object |
An object of class |
... |
Additional arguments passed to |
include_cred_adj |
If |
add_hline |
If |
plot_termination_rates()
- Create a plot of observed termination rates
and any expected termination rates attached to an exp_df
object.
plot_actual_to_expected()
- Create a plot of actual-to-expected termination
rates attached to an exp_df
object.
a ggplot
object
autoplot.exp_df()
study_py <- expose_py(census_dat, "2019-12-31", target_status = "Surrender")
expected_table <- c(seq(0.005, 0.03, length.out = 10), 0.2, 0.15, rep(0.05, 3))
study_py <- study_py |>
mutate(expected_1 = expected_table[pol_yr],
expected_2 = ifelse(inc_guar, 0.015, 0.03))
exp_res <- study_py |> group_by(pol_yr) |>
exp_stats(expected = c("expected_1", "expected_2"))
plot_termination_rates(exp_res)
plot_actual_to_expected(exp_res)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.