WinBUGS is specialized program that can incorporate spatial variability in a variety of modeling procedures so the general framework of running a model will be described. While there are numerous concepts for spatial models and alternate ways to get models into WinBUGS (e.g., R2WinBUGS), we will go over the basics of running heirarchical Bayesian models in WinBUGS. Although we will not go over the concepts in detail, this short tutorial should enable a novice to load models and data into the WinBUGS environment. All pertinent data can be prepared in any platform but needs to be presented to WinBUGS in the proper format. If not R then Notepad works well for this as the data needs to be presented as comma-separated values to load the data. WinBUGS requires that each section be highlighted or called in order to perform the components. The code to follow will assist in setting up data for use in WinBUGS but an entire book would be needed to explain Bayesian Hierachical Models so we will not cover the theory here. For those interested, we would recommend attending a workshop and reading several books of varying levels of complexity such as Hierarchical Modeling and Analysis for Spatial Data (Banerjee et al. 2004), Bayesian Disease Mapping (Lawson 2009), and Applied Spatial Data Analysis with R (Bivand et al. 2008).

Sections 9.1 to 9.3 will detail the code necessary to create all necessary data within R. These sections will enable the user to load in covariate data, extract data from within a sampling gird, and send models to WinBUGS using R2WinBUGS. Sections 9.4 to 9.11 will detail the process of entering the appropriate data directly into WinBUGS provided the adjacency matrix and data is formatted properly.