Commit 5caec546 authored by Carl Corder's avatar Carl Corder
Browse files

keep positive paid claims, reserves etc.. restrict TLR values to [0,1]

parent 3d601a85
......@@ -18,6 +18,13 @@ tax <- read_excel(input, sheet = "Tax")
# drop reserves not related to STD (IBNR)
data <- data %>% select(-c(ICOS, WAIVER_IBNR, GAAP_RESV, WAIVER_RESERVE))
# keep positive max lives, est premium, gross premium, paid claims and reserves
data <- data %>% filter(MAX_LIVES > 0,
EST_ANNUALIZED_NET_PREM > 0,
PREM > 0,
PAID_CLAIMS > 0,
IBNR > 0)
# left outer-join on industry code
data <- merge(x = data, y = sic, by.x = "SIC", by.y = "SIC_CODE", all.x = TRUE)
......@@ -33,8 +40,8 @@ data <- merge(x = data,
by = c("GROUP_ID" = "GROUP_ID", "POLICY_DURATION" = "POLICY_DURATION"),
all.x = TRUE)
# remove rows where percent comission is NA due to chargebacks
data <- data %>% filter(!is.na(PERCENT_COMMISSION))
# remove rows where percent comission is NA or negative due to chargebacks
data <- data %>% filter(0 <= PERCENT_COMMISSION & PERCENT_COMMISSION <= 1)
# append state premium tax
data <- merge(x = data, y = tax, by.x = "STATE", by.y = "STATE", all.x = TRUE)
......@@ -67,9 +74,15 @@ data <- data %>% mutate(INTERNAL_EXPENSES = get_internal_expense(EST_ANNUALIZED_
# assume pepm rate = 0.5 for all est annualized premiums
data <- data %>% mutate(PERCENT_PEPM = MAX_LIVES * 0.5 / PREM)
# PEPM in [0,1]
data <- data %>% filter(0 <= PERCENT_PEPM & PERCENT_PEPM <= 1)
# create tolerable loss ratio
data <- data %>% mutate(TLR = 1 - (PERCENT_COMMISSION + PREMIUM_TAX + PERCENT_PEPM + INTERNAL_EXPENSES))
# TLR in [0,1]
data <- data %>% filter(0 <= TLR & TLR <= 1)
# rtn lookup from policy lives, duration & voluntary indicator
data <- data %>%
mutate(RTN = case_when(MAX_LIVES < 100 & TRUE_GROUP_VOL == "T" & POLICY_DURATION < 2 ~ 0.8833,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment