diff --git a/START_HERE_Causes.r b/START_HERE_Causes.r index ae03549..81391cc 100644 --- a/START_HERE_Causes.r +++ b/START_HERE_Causes.r @@ -22,6 +22,7 @@ MAX_BOUND <- BOUNDS %>% pull(MAX_RATE) MIN_BOUND <- BOUNDS %>% pull(MIN_RATE) #Create a proxy data set to simulate with C_VAL <- REG_DATA %>% mutate(Year=Year+(2025-1999)) %>% select(Year,Sex,US_Adj_Death_Rate) +#################NOTE YOU NEED TO ADJUST THE SINGLE AGE DEATH RATE DOWN TO MATCH LINCOLN IN SOME WAY ###Mostly Working: Pass in a data frame, with year, sex, and US age adjusted mortality rate. The years should go from the simulation start 2025, to the end roughly 2045. WHAT IS MISSING is to pass the arima results of the US age adjusted mortality rates as applied in Lincoln to replace the age adjusted mortality term. Once that is done, a new simulation will give the age specific mortality rates based on the forecasted Lincoln average rates. RES <- do.call(rbind,lapply(1:86,function(x){return(predict(MOD[[x]],C_VAL))}))#For each data frame containing each year and sex combination of the forecast, predict the data for each age 0-85. Bind these by row to create a result with ages by row, and year by column RES <- ifelse(TEMP