Lab 7. Thinking statistically and thinking spatially: an illustration
Lab 8. Introduction to WinBUGS
Lecture 9. Fitting Bayesian hierarchical models for continuous valued response data in WinBUGS
Lab 9. Fitting Bayesian hierarchical models for continuous valued response data in WinBUGS
Lecture 10. Fitting Bayesian hierarchical models for discrete valued response data in WinBUGS
Lab 10. Fitting Bayesian hierarchical models for discrete valued response data in WinBUGS
The Peterborough data in Lab 10 in Excel format for data formatting demo
Lab 11. Ecological modelling of small area health data using Bayesian spatial models
Lecture 12. Modelling small area spatial-temporal data: an introduction
Lab 12. Modelling (small area) time series data in WinBUGS
Lecture 13. Developing Bayesian hierarchical models for small area space-time data
Lab 13. Model development for analysing space-time data (Part 1): fitting a separable spatial-temporal model in WinBUGS
Lab 14. Model development for analysing space-time data (Part 2): fitting an advanced spatial-temporal model in WinBUGS
#### R code to read a dataset in Excel format and
#### export it to a file in the WinBUGS list format
#### block 1 requires the excel data to be exported to a csv file
#### block 2 reads in the Excel file directly without the need to export
#### (use block 2!)
#### block 1
in.file <- "c:/demo_WinBUGS_data_formatting.csv"
out.file <- "c:/ForWinBUGS.csv"
data <- read.csv(in.file,header=TRUE)
data <- lapply(data,function(x){as.numeric(x)})
dput(data,out.file)
#### block 2
# if you can install packages in R,
# you do not need to convert an Excel file to csv manually
install.packages("readxl")
library(readxl)
in.file <- "c:/demo_WinBUGS_data_formatting.xlsx"
out.file <- "c:/ForWinBUGS.csv"
data <- read_excel(in.file)
data <- lapply(data,function(x){as.numeric(x)})
dput(data,out.file)