This file contains code and inputs for projections of temperature related moratlity based on historical data for 209 cities. The original modeling was performed by Joel Schwartz and Alina Vodonos Zilberg using data obtained directly from counties, and historical temperatures calculated by Abt.
lpath <- "/home/ad.abt.local/sokolinskis/R/library" # assign library for user w/o admin priveleges on ACE3
.libPaths(lpath)
#library(chron)
library(tictoc) # for system time
library(readxl) # for reading in excel
library(readr) # for csv
library(survival) # from original vodonos code. Loaded for compatibility
library(splines) # for splines
library(MASS) # for mvmeta, likely
#library(nlme)
library(mgcv) # from original vodonos code. Loaded for compatibility
library(dlnm) # from original vodonos code. Loaded for compatibility
library(tsModel) # from original vodonos code. Loaded for compatibility
library(mvmeta) # from original vodonos code. Loaded for compatibility
library(here) # convenience for filepaths dynamic
here <- here::here # to avoid overwrite
library(data.table) # fread for faster read (read.table takes >15 min)
library(tidyverse)
select <- dplyr::select # to re-assign select to specify dplyr as is more commonly used than raster and MASS functions in script below.
# Temporary fix due to changes in nest/unnest syntax (deprecated arguments)
nest <- nest_legacy
unnest <- unnest_legacy
#library(RcppRoll) # rolling averages from vodonos? Likey not needed
library(purrr) # for iterative processing.
library(gridExtra) # for grid.arrange
Identify degrees change by GCM and year (for RCP8.5): data/GCM_Period_dT_LUT.xlsx Identify cluster and county identy for each city: data/city_county_LUT.xlsx
Climate projections in: //boufile01.corp.abtassoc.com/data1/Common/ENR/Project/Climecon4/COOLIT13_RiskComm/Mortality/Output/Trim/ and Data/Trim Day of week deaths averaged over the last period (2003-2013) for cities: output/vodonos_out/historical.deaths/mean.deaths.dow.csv Day of year deaths averaged over the last period (2003-2013) for cities: output/vodonos_out/historical.deaths/mean.deaths.doy.csv Contains graphical results output and a matrix to link FIPS assigned by Schwartz lab to city: output/vodonos_out/Results-5-28-19.xlsx
Use 5 years on each side of model period year to start (11 years in total for each gcm). Use RCP 85 only. Create 2 rows if the period spans 2050 and 2090 GCM periods, as these will need to have two separate tmean projection files read in.
gcm_dt_lut <- read_xlsx(here("data/GCM_Period_dT_LUT.xlsx"), sheet = "GCM_Period_dT_LUT")
gcm_dt_lut <- gcm_dt_lut %>%
rename (dt_year = model.period) %>%
mutate(min_dt_yr = dt_year - 5,
max_dt_yr = dt_year + 5,
)
First load the county and city linkages, and the population values.
options("object.size" = 2000000000000) # for bigger data limit
# nca_county_LUT <- fread(here("data/cira3/nca_county_LUT.csv"))
# nca_county_LUT <- nca_county_LUT %>% mutate(`FIPS_text` = FIPS)
mort_city_county_LUT <- read_xlsx(here("data/city_county_LUT.xlsx"))
head(mort_city_county_LUT)
mort_city_county_LUT <- mort_city_county_LUT %>% mutate(`FIPS_text` = paste("'", `FIPS-text`, "'", sep = ""))
cluster_LUT <- mort_city_county_LUT%>%
mutate (CITYNAME = casefold(CITYNAME)) %>%
select (Cluster, City, CITYNAME, STATENAM , FIPS_txt = `FIPS-text`) #VALUE, COUNT, FIPS_txt = `FIPS-text`, fips_sm, FIPS,
Use the city-county-LUT to get the correct city/county values for the climate files Ron made in 2016. Those files are present on the J drive on ACE3, but require additional documentation for use. They need a description of the code used to produce them and the aggregation method. The climate model output aggregated for degrees celsius above baseline is available here on ACE3.
pop2010 <- read_xls(here::here("data/City-County-Cluster-2014-06-24_POP2010.xls"), "CitySum")
pop2010 <- pop2010 %>%
mutate (CITYNAME = casefold(CITYNAME)) %>%
select (CITYNAME , n_counties = FREQUENCY, pop2010 = SUM_USA_Counties.POP2010)
cluster_LUT <- cluster_LUT %>%
inner_join(pop2010)
Joining, by = "CITYNAME"
For first projections, use observed deaths from death certificate (sum of counties included in Schwartz city boundary). These are directly tied to total populations of the counties included. Use the sum of populations from counties included in Schwartz city delimitation as basis for RR to actual deaths conversion. Later, apply the base RR and attributable RR to the overall population for cost calculations.
dow <- read_csv(here::here("output/vodonos_out/historical.deaths/mean.deaths.dow.csv")) # Day of week mortality average for last period
Parsed with column specification:
cols(
dow = [32mcol_double()[39m,
dow.names = [31mcol_character()[39m,
CITYNAME = [31mcol_character()[39m,
tot.mean = [32mcol_double()[39m
)
glimpse (dow)
Observations: 1,456
Variables: 4
$ dow [3m[38;5;246m<dbl>[39m[23m 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, …
$ dow.names [3m[38;5;246m<chr>[39m[23m "Sunday", "Sunday", "Sunday", "Sunday", "Sunday", "Sunday", "Sunday", "Sunday", "Sunday", "Sunday", "Sunday", "Sunday", …
$ CITYNAME [3m[38;5;246m<chr>[39m[23m "akron", "albany", "albuquerque", "allentown", "anaheim", "annandale", "annarbor", "atlanta", "atlantic city", "atzec", …
$ tot.mean [3m[38;5;246m<dbl>[39m[23m 13.7, 6.7, 11.0, 12.4, 42.7, 10.6, 4.9, 42.9, 6.1, 1.9, 4.6, 11.0, 12.7, 35.6, 3.5, 6.9, 2.3, 9.2, 26.9, 23.7, 5.6, 53.5…
doy <- read_csv(here::here("output/vodonos_out/historical.deaths/mean.deaths.doy.csv")) # Day of year mortality average for last period
Parsed with column specification:
cols(
doy = [32mcol_double()[39m,
CITYNAME = [31mcol_character()[39m,
tot.mean = [32mcol_double()[39m
)
glimpse (doy)
Observations: 76,128
Variables: 3
$ doy [3m[38;5;246m<dbl>[39m[23m 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1…
$ CITYNAME [3m[38;5;246m<chr>[39m[23m "akron", "albany", "albuquerque", "allentown", "anaheim", "annandale", "annarbor", "atlanta", "atlantic city", "atzec", "…
$ tot.mean [3m[38;5;246m<dbl>[39m[23m 15.0, 6.7, 12.6, 13.8, 48.5, 12.6, 5.1, 52.2, 6.4, 2.1, 5.6, 12.3, 13.0, 45.9, 3.6, 6.2, 3.2, 10.0, 33.1, 24.5, 4.7, 63.6…
#County mean tmean (weighted by number of grid points included in each county) was used for temperature relationship. Do the same going forward
tmean_fips <- read_xlsx(here::here("output/vodonos_out/Results-5-28-19.xlsx"), "data.matrix")
tmean_fips <- tmean_fips %>%
select(CITYNAME, citycode) %>%
mutate (FIPS_txt = stringr::str_pad(as.character (citycode), 5, "left", "0"),
# Due to county selection within cities, some towns have no value in the original city-cluster-LUT table.
# This is only a problem for Youngstown, OH, which has no matching fips code. Due to an error in the data.matrix lut from Schwartz
FIPS_txt = gsub("39029", "39099", FIPS_txt)) # replace Schwartz data matrix for youngstown with a youngstown FIPS
tmean_fips %>% anti_join(cluster_LUT , by = "FIPS_txt")
doy<- doy %>% left_join(tmean_fips) %>%
mutate(month = lubridate::month (as.Date(doy , origin = "2015-12-31")) ,
day = lubridate::day (as.Date(doy , origin = "2015-12-31")) ) %>%
left_join(cluster_LUT[, c("Cluster", "FIPS_txt", "pop2010")], by = "FIPS_txt") %>%
select (cluster = Cluster, FIPS_txt, CITYNAME, doy, month, day, pop2010, total_mort = tot.mean)
Joining, by = "CITYNAME"
doy %>% glimpse()
Observations: 76,128
Variables: 8
$ cluster [3m[38;5;246m<dbl>[39m[23m 2, 2, 9, 1, 5, 1, 2, 4, 1, 9, 4, 6, 8, 1, 2, 1, 2, 6, 1, 4, 9, 1, 2, 7, 2, 2, 2, 1, 2, 4, 3, 4, 4, 2, 3, 3, 2, 4, 3, 7,…
$ FIPS_txt [3m[38;5;246m<chr>[39m[23m "39153", "36001", "35001", "42077", "06059", "51059", "26161", "13067", "34001", "35045", "13245", "48453", "06029", "2…
$ CITYNAME [3m[38;5;246m<chr>[39m[23m "akron", "albany", "albuquerque", "allentown", "anaheim", "annandale", "annarbor", "atlanta", "atlantic city", "atzec",…
$ doy [3m[38;5;246m<dbl>[39m[23m 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,…
$ month [3m[38;5;246m<dbl>[39m[23m 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,…
$ day [3m[38;5;246m<int>[39m[23m 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,…
$ pop2010 [3m[38;5;246m<dbl>[39m[23m 541781, 304204, 662564, 647232, 3010232, 1081726, 344791, 3365297, 274549, 130044, 200549, 1024266, 839631, 1425990, 15…
$ total_mort [3m[38;5;246m<dbl>[39m[23m 15.0, 6.7, 12.6, 13.8, 48.5, 12.6, 5.1, 52.2, 6.4, 2.1, 5.6, 12.3, 13.0, 45.9, 3.6, 6.2, 3.2, 10.0, 33.1, 24.5, 4.7, 63…
The information regarding much of this processing is stored on J drive under J:_Indicators(on ACE3). It may be more reproducible to pull current data directly from the USGS site, but initial tests suggested that would be quite slow, and using these previoulsy developed datasets will be faster.
Providence is present in tmax trimmed file, but not in doy. Santa Barbara is just missing a space. Update santa barbara in doy during processing.
doy <- doy %>%
mutate (CITYNAME = gsub("santabarbara", "santa barbara", CITYNAME)) %>%
select (-month, - day) # month and day cause leap year problems
dow <- dow %>%
mutate (CITYNAME = gsub("santabarbara", "santa barbara", CITYNAME))
The following spline parameters are the same across all places:
fun = "bs" ; degree = 2; cen_1 = 15.6
This finds the cluster results, and saves to a nested tibble for further use.
‘cluster_load’ function pulls in all model objects for cluster, but only keeps the coefficients, vcov, boundaries, and knots. It organizes these into two list columns (for daily and moving average arguments).
source(here::here("/code/functions/01_cluster_load_cp.r"))# load cluster functions
[1] 1
rm("cluster_load_cp"); rm("cluster_load_mv") # remove extra functions used for meta analysis
COMMENT I had to fix clusterload function. It did not point to cp_out within cluster_f when creating daily_arg and ma15_arg. I tried to just point with the %>% but that didn’t work as we were listing things from different levels of nested lists. Ended up just pointing directly for each value, like: cluster_f$cp_out[[1]][[“cp_0”]][[“predvar”]]. There is probably a cleaner looking way to do this.
COMMENT Still getting errors on clusters 6, 7 & 9. When load_parms looks up the Rdata, it is named cp_15 instead of cp_05. It is named cp_05 for clusters 1:5 and 8. I inserted an if null statement to get it to run.
cluster_fits <- seq(1,9) %>%
map_dfr(cluster_load,
out_folder = "output/vodonos_out/2019-06-13_mvcl_4_time/")
[1] 1
[1] 2
[1] 3
[1] 4
[1] 5
[1] 6
[1] 7
[1] 8
[1] 9
cluster_fits %>% glimpse()
Observations: 18
Variables: 6
$ cluster [3m[38;5;246m<int>[39m[23m 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9
$ time_period [3m[38;5;246m<dbl>[39m[23m 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4
$ mv_fname [3m[38;5;246m<chr>[39m[23m "/media/projects/Projects/Climecon_EPA/cira3-sokolinski/output/vodonos_out/2019-06-13_mvcl_4_time//mv_cl1/mv_cl1/mv_cl…
$ mv_out [3m[38;5;246m<list>[39m[23m [[[<matrix[5 x 5]>, <matrix[5 x 5]>, <matrix[5 x 5]>, <matrix[5 x 5]>, <matrix[5 x 5]>, <matrix[5 x 5]>, <matrix[5 x …
$ daily_arg [3m[38;5;246m<list>[39m[23m [[<-16.8, 30.9>, <-1.302139, 11.913495, 23.875105>, <-0.035368732, -0.009306338, 0.055683069, 0.113287601, 0.20867393…
$ ma15_arg [3m[38;5;246m<list>[39m[23m [[<-12.1, 29.2>, <-1.302139, 11.913495, 23.875105>, <0.006888038, -0.077317231, -0.103824569, -0.205304169, -0.243654…
The previously processed data can be joined on city name
cluster_fits_doy <- doy %>%
group_by(cluster, FIPS_txt, CITYNAME) %>%
nest(.key = "doy_av_mort") %>%
left_join(cluster_fits)
Joining, by = "cluster"
cluster_fits_doy %>% glimpse()
Observations: 416
Variables: 9
$ cluster [3m[38;5;246m<dbl>[39m[23m 2, 2, 2, 2, 9, 9, 1, 1, 5, 5, 1, 1, 2, 2, 4, 4, 1, 1, 9, 9, 4, 4, 6, 6, 8, 8, 1, 1, 2, 2, 1, 1, 2, 2, 6, 6, 1, 1, 4, 4…
$ FIPS_txt [3m[38;5;246m<chr>[39m[23m "39153", "39153", "36001", "36001", "35001", "35001", "42077", "42077", "06059", "06059", "51059", "51059", "26161", "…
$ CITYNAME [3m[38;5;246m<chr>[39m[23m "akron", "akron", "albany", "albany", "albuquerque", "albuquerque", "allentown", "allentown", "anaheim", "anaheim", "a…
$ doy_av_mort [3m[38;5;246m<list>[39m[23m [<tbl_df[366 x 3]>, <tbl_df[366 x 3]>, <tbl_df[366 x 3]>, <tbl_df[366 x 3]>, <tbl_df[366 x 3]>, <tbl_df[366 x 3]>, <t…
$ time_period [3m[38;5;246m<dbl>[39m[23m 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4…
$ mv_fname [3m[38;5;246m<chr>[39m[23m "/media/projects/Projects/Climecon_EPA/cira3-sokolinski/output/vodonos_out/2019-06-13_mvcl_4_time//mv_cl2/mv_cl2/mv_cl…
$ mv_out [3m[38;5;246m<list>[39m[23m [[[<matrix[4 x 4]>, <matrix[4 x 4]>, <matrix[4 x 4]>, <matrix[4 x 4]>, <matrix[4 x 4]>, <matrix[4 x 4]>, <matrix[4 x …
$ daily_arg [3m[38;5;246m<list>[39m[23m [[<-23.7, 29.9>, <1.656303, 17.759536>, <-0.041926459, 0.003119007, 0.061828473, 0.195052562>, <matrix[4 x 4]>, <matr…
$ ma15_arg [3m[38;5;246m<list>[39m[23m [[<-19.6, 27.8>, <1.656303, 17.759536>, <-0.002694066, -0.081118124, -0.139629961, -0.235070277, -0.170838890>, <matr…
This function gets the full Tmax0 and Tmin0 files for all gridded data using previously processed climate projections [processed with code included where?], averages to get tmean, then subsets it to free up memory. It also assignes the reduced data to the global environment for further use. Note that this may need to be updated, but it appears to be correct linkage to cities as shown above (with exception of ‘Providence RI’), and is from 2016 download of LOCA data. Not clear whether there have been updates since then. These modeled data were used for the last mortality manuscript.
For each climate model and year for which an average change in temperature occurs, pull in the data with tmean_daily. Calculate lagged maximum temperature (moving average 5-day) Join to cluster fits, and create a bounded variable that replaces maximum temperature exceeding bounds with the upper and lower bounds as needed. Use cluster-specific spline values and city-specific day of year death to calcuate daily and tmean mortality values.
source(here::here("code/functions/02_get_tmean.R"))
source(here::here("code/functions/03_lag_calc.R")) # Function to calculate lagged (5-dy moving average)
source(here::here("code/functions/04_join_doy_proj.R")) # Function to join to cluster fits, bounds, and other parameters to day of year mortality
source(here::here("code/functions/05_bound_tmean.R")) # Function to truncate tmean distribution at bounds.
###Functions for by-city calculations within a cluster
source(here::here("code/functions/06_rr_calc.R")) # Function for relative risk calculation
#dlnm::crosspred produces just predictions for the range of the input basis. It does not produce predictions for each row. Therefore, must reproduce with onebasis and relative risk calculation.
source(here::here("code/functions/07_project_spline.R")) # Function to loop through the projected temperatures, apply cluster coefficients, and calculate relative risk (no CI yet due to processing speed).
source(here::here("code/functions/08_sum_result_funs.R"))
# Define master function that is called for each degree change in each climate model and 11 year period.
dT_func <- function (gcm_sel ="CCSM4" ,
dT_c_sel = 1,
rcp_sel = "RCP85" ,
dt_yr_sel = 2011,
cluster_fits = cluster_fits_doy,
cira_folder = "J:/projects/COOLIT13_RiskComm/Mortality/Output/Trim/",#data size constraints; remove here::here("data/Trim/"),
output_folder = here::here ("output", format(Sys.Date(), "%F"))
) {
print (gcm_sel) ; print (dT_c_sel) ; print(rcp_sel); print(dt_yr_sel)
# get data
tic(msg = "get_tmean")
tmean_daily <- get_tmean (cira_folder = cira_folder,
gcm = gcm_sel , rcp = rcp_sel , dt_yr = dt_yr_sel )
toc()
# Lag calc
tic(msg = "calculate lagged tmean")
tmean_daily <- tmean_daily %>%
mutate(dT_c = dT_c_sel ,
doy_tmean = map( doy_tmean0, lag_calc )) %>%
select (-doy_tmean0)
toc()
#join to cluster fits, apply bounds, and other calculations
tic(msg = "join_doy_proj")
tmean_daily <- join_doy_proj (tmean_daily = tmean_daily , cluster_param = cluster_fits)
toc()
tic(msg = "day_tm operation")
## add projected mortality and RR to tmean_daily (trouble with list position means this may be more complicated than needed)
tmean_daily <- tmean_daily %>%
mutate(day_tm = pmap(list(day_tm, daily_arg, ma15_arg),
~project_spline( ..1, ..2, ..3)))
toc()
return(tmean_daily)
}
COMMENT getting stuck on join_doy_proj. “Error in t0_args$bound : $ operator is invalid for atomic vectors” Can’t seem to fix. Can’t find anywhere where we even use $bound We are still using “here(”/data/Trim/“)” but when I switch to “J:/projects/COOLIT13_RiskComm/Mortality/Output/Trim/” tmean stops working giving the “Error: Result 1 must be a single string, not a character vector of length 0”
COMMENT: Now getting errors with column nesting. “Error: All nested columns must have the same number of elements.”
gcm_dt_lut_proj <- gcm_dt_lut %>%# head() %>%
mutate (gcm = gsub("_", "-", gcm) ) %>%
filter (gcm != "baseline") %>% # remove as is stored elsewhere
mutate (rcp = "RCP85")
output_folder_path <- here::here("output", format(Sys.Date(), "%F") )
if(!dir.exists(output_folder_path)) {dir.create(output_folder_path, recursive = TRUE)}
compiled_city_mean_out <- pmap_dfr (.l = list (gcm_dt_lut_proj$gcm , gcm_dt_lut_proj$dT ,
gcm_dt_lut_proj$rcp , gcm_dt_lut_proj$dt_year),
.f = dT_func,
cira_folder =here("/data/Trim/"),
output_folder = output_folder_path )
[1] "CanESM2"
[1] 1
[1] "RCP85"
[1] 2011
Joining, by = c("date", "city")Joining, by = c("date", "city")Joining, by = c("date", "city")Joining, by = c("date", "city")Joining, by = c("date", "city")Joining, by = c("date", "city")Joining, by = c("date", "city")Joining, by = c("date", "city")Joining, by = c("date", "city")Joining, by = c("date", "city")Joining, by = c("date", "city")
get_tmean: 6.864 sec elapsed
calculate lagged tmean: 3.524 sec elapsed
Error: All nested columns must have the same number of elements.
Get CI using the same simulated matrix for all cities in each cluster
```r
```r
tic()
compiled_city <- compiled_city_mean_out %>% select(-contains(\_arg\)) %>%
filter(dT_c == 3 ) %>%
unnest(day_tm ) %>% # unnest(day_tm, .preserve = contains(\_arg\))
select(-contains(\rr_\), -contains(\an_\))%>%
group_by(dT_c, cluster, FIPS_txt, city, CITYNAME) %>%
nest(.key = \day_dtc\) %>%
inner_join(cluster_fits)
toc()
Run after compiling full city dataframe, so can average over dT
Average over included GCM
Do two ways. For cities, aggregate AN over full 11 year period by day of year. Get a mean AN for each day for each city in the 11 year period. For clusters, first aggregate by year to get total increase in death each year.
Tabulate by city and day of year over the whole period. This function calculates the mean number of attributable deaths over the 11 year period for a particular city and climate model.
Tabulate cluster day of year attributable deaths. This function calculates a sum AN of all cities in a cluster for each year of the 11 year period for a gcm. The mean and sd temperatures are currently unweighted.
Tabulate cluster period attributable deaths. This function calculates an average AN for the whole period, using the previously calculated total AN of all cities in a cluster for each year of the 11 year period for a gcm. The mean temperatures are not currently population or area weighted.
dt_C_mean_year<- compiled_city_mean_out %>% select(-contains("_arg")) %>%
unnest() %>% ungroup() %>%
group_by(cluster, city, CITYNAME, FIPS_txt, dT_c, year, date, dt_yr, doy) %>%
summarise (tot_an_2010_100k=mean(tot_an_2010_100k),
tot_an_2010_100k_bnd=mean(tot_an_2010_100k_bnd)) %>%
ungroup() %>%
group_by(cluster, city, CITYNAME, FIPS_txt, dT_c, year)%>%
summarise (tot_an_2010_100k= sum(tot_an_2010_100k),
tot_an_2010_100k_bnd=sum(tot_an_2010_100k_bnd)) %>%
ungroup() %>%
group_by(cluster, city, CITYNAME, FIPS_txt, dT_c )%>%
summarise (tot_an_2010_100k= mean(tot_an_2010_100k),
tot_an_2010_100k_bnd=mean(tot_an_2010_100k_bnd))
dt_C_mean_year %>%
write_csv( file.path(output_folder_path, paste(format(Sys.Date(), "%F_"),
"city_dT_death_100k2010.csv", sep = "") ))
mean_c_dt_city_doy <- dTc_compiled_gcm_city %>%
summarise_temp_c( cluster, city, CITYNAME, FIPS_txt, dT_c, gcm, doy)
mean_rr_dt_city_doy <- dTc_compiled_gcm_city %>%
summarise_mean_rr(rr_vars = c(rr_tmean0 = "rr_tmean0", rr_tmean15 = "rr_tmean15", rr_tmean0_bnd= "rr_tmean0_bnd", rr_tmean15_bnd = "rr_tmean15_bnd"),
cluster, city, CITYNAME, FIPS_txt, dT_c, gcm, doy)
mean_an_dt_city_doy <- dTc_compiled_gcm_city %>%
summarise_mean_an( an_vars = c(an_tmean0 = "an_tmean0", an_tmean15 ="an_tmean15", an_tmean0_bnd = "an_tmean0_bnd", an_tmean15_bnd ="an_tmean15_bnd") ,
cluster, city, CITYNAME, FIPS_txt, dT_c, gcm, doy)
mean_an_2010_100k_dt_city_doy <- dTc_compiled_gcm_city %>%
summarise_mean_an( an_vars = c(an_tmean0 = "tmean0_an_2010_100k", an_tmean15 ="tmean15_an_2010_100k", an_tmean0_bnd = "tmean0_an_2010_100k_bnd",
an_tmean15_bnd ="tmean15_an_2010_100k_bnd") ,
cluster, city, CITYNAME, FIPS_txt, dT_c, gcm, doy)
city_tab_doy <- mean_c_dt_city_doy %>% inner_join(mean_rr_dt_city_doy) %>%
inner_join(mean_an_2010_100k_dt_city_doy) %>%
inner_join(mean_an_dt_city_doy)
city_tab_doy%>% head()
```r
```r
if (!require(\devtools\,
character.only = TRUE)) { devtools::session_info()} else
{sessionInfo()}
For notes on the baseline data, see the readme for the baseline mortality used in temperature mortbidity Previous mortality baselines for other (Climecon 4 Task 004) mortality work relied on calculations from BEN Map.
Information developed by Neal Fann o f U.S. EPA taking shape file of the citities and
using it to export baseline mortality informataion for the 209 US cities coverd in that analysis. Subset of these cities were addressed in the original Medina-Ramon and Schwartz paper.
Source file saved independently as
\boufile0114_8_CIRA2-mortality-mortality-rates-baseline_mortality_w_city.xlsx
original email with files sent to d. Mills on 7/2/14 from Neal Fann in Heat-Pops email directory: Population-health-baseline-data folder
if (!require("devtools",
character.only = TRUE)) { devtools::session_info()} else
{sessionInfo()}