##########################################################################
## Access simulated data set #############################################
##########################################################################
data(sim_SA)
##########################################################################
## Set priors ############################################################
##########################################################################
priors <- list(a = 1, r = 1, theta = c(0.01, 0.00001))
##########################################################################
## Run model #############################################################
##########################################################################
res <- saBayes(formula = Human~Source1+Source2+Source3+Source4+Source5,
time=~Time, location=~Location, type=~Type,
data=sim_SA$data, priors = priors,
alpha_conc = 1, prev = sim_SA$prev,
likelihood_dist = "pois", n_iter = 20)
##########################################################################
#### Plot heatmap ########################################################
##########################################################################
heatmap_types(object = res, hm_colors = c("purple", "white"))
Run the code above in your browser using DataLab