Chapter 4 Supplementary Figures (Model)
4.1 Packages, data, and helpers
library(tidyverse); library(useful);library(epiDisplay);library(lubridate)
library(spdep); library(sf); library(sp); library(devtools); library(pkgload)
<-readRDS("./_data/models_pv_jm.rds")
test_pv_2<-readRDS("./_data/models_pf_jm.rds") test_pf_2
4.2 Supplementary Figure 7 [COMPLETE] Relative risk nonlinear effects of deforestation, prcp,Tmax,month and year for A)P.vivax and B)Falciparum
# Extra requirements
library(cowplot)
# P. Vivax
<- test_pv_2[[5]] %>%
sv8a plot_random2(lab1 = c("Cum deforest x 100 km2","Avg. Daily Precipitation (mm)","Tmax (ºC)", "Month", "Year"),
scaled = T,
scaled_var = "inla.group(prcp)",
scaled_mean = mean(dt_final$prcp/30, na.rm=T),
scaled_sd = sd(dt_final$prcp/30, na.rm=T)
)
# P. Falciparum
<- test_pf_2[[11]] %>% #esta bien solo estaba mal el subindice y la bd ademas
sf8b plot_random2(lab1 = c("Cum deforest x 100 km2","Avg. Daily Precipitation (mm)","Tmax (ºC)", "Month", "Year"),
scaled = T,
scaled_var = "inla.group(prcp)",
scaled_mean = mean(dt_final$prcp/30, na.rm=T),
scaled_sd = sd(dt_final$prcp/30, na.rm=T)
)
# Final figure
<- plot_grid(sv8a, sf8b, labels = c("A","B"), ncol = 1)) (sf8
4.3 Supplementary Figure 8 [COMPLETE]Contributions of spatial random effects to P.vivax and P.falciparum risk
# Preprocessing requirements
library(cowplot)
# ---------------
# Version 2
# ---------------
# P. Vivax
<-test_pv_2[[5]] %>%
rm_pv_2 plot_random_map2(map = area.sf, name= "")
#P. Falciparum
<-test_pf_2[[2]] %>%
rm_pf_2 plot_random_map2(map = area.sf, name= "")
<-plot_grid(rm_pv_2,rm_pf_2, ncol=2, labels = c("A) P. vivax", "B) P. falciparum"))
rm_seasonal rm_seasonal