# Simple numeric vectors
PREM <- c(1000, 1000, 1000, 1000, 1000, 1000)
CLAIM <- c(600, 1800, 600, 600, 600, 600)
duration <- 1:6
calc_pc(PREM, CLAIM, pc_rate = 0.9, me = 0.05, loss_carry = "Y", duration = duration)
# Using example_simulation dataset
example_simulation_with_PC <- example_simulation %>%
dplyr::group_by(split, sim_n) %>%
dplyr::mutate(
PC = calc_pc(PREM,
CLAIM,
pc_rate = 0.9,
me = 0.05,
loss_carry = "N",
duration = DURATION)) %>%
dplyr::ungroup()
Run the code above in your browser using DataLab