Skip to content
Snippets Groups Projects
Commit bce83d69 authored by Carl Corder's avatar Carl Corder
Browse files

formatting

parent 5caec546
No related branches found
No related tags found
No related merge requests found
...@@ -8,12 +8,12 @@ output <- "C:/Users/its-student/Desktop/Phase2Out.xlsx" ...@@ -8,12 +8,12 @@ output <- "C:/Users/its-student/Desktop/Phase2Out.xlsx"
# read in sheets # read in sheets
data <- read_excel(input, sheet = "Data") data <- read_excel(input, sheet = "Data")
commission <- read_excel(input, sheet = "Commission") # by group and policy duration commission <- read_excel(input, sheet = "Commission") # join by group id & policy duration
demographic <- read_excel(input, sheet = "Demographic") demographic <- read_excel(input, sheet = "Demographic") # join by group id
expense <- read_excel(input, sheet = "Expense") # bin by annualized net premium expense <- read_excel(input, sheet = "Expense") # join by annualized net premium
rtn <- read_excel(input, sheet = "RTN") rtn <- read_excel(input, sheet = "RTN") # join by max lives, voluntary & policy duration
sic <- read_excel(input, sheet = "SIC") sic <- read_excel(input, sheet = "SIC") # join by sic code
tax <- read_excel(input, sheet = "Tax") tax <- read_excel(input, sheet = "Tax") # join by state
# drop reserves not related to STD (IBNR) # drop reserves not related to STD (IBNR)
data <- data %>% select(-c(ICOS, WAIVER_IBNR, GAAP_RESV, WAIVER_RESERVE)) data <- data %>% select(-c(ICOS, WAIVER_IBNR, GAAP_RESV, WAIVER_RESERVE))
...@@ -31,7 +31,7 @@ data <- merge(x = data, y = sic, by.x = "SIC", by.y = "SIC_CODE", all.x = TRUE) ...@@ -31,7 +31,7 @@ data <- merge(x = data, y = sic, by.x = "SIC", by.y = "SIC_CODE", all.x = TRUE)
# remove rows where the sic has no industry (e.g. SIC = 1790) # remove rows where the sic has no industry (e.g. SIC = 1790)
data <- data %>% filter(!is.na(INDUSTRY)) data <- data %>% filter(!is.na(INDUSTRY))
# left outer-join on demographics (age, gender, salary) # left outer-join on demographics (age, gender & salary)
data <- merge(x = data, y = demographic, by.x = "GROUP_ID", by.y = "GROUP_ID", all.x = TRUE) data <- merge(x = data, y = demographic, by.x = "GROUP_ID", by.y = "GROUP_ID", all.x = TRUE)
# append percent commission # append percent commission
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment