breslow:clayton:93 consider a random-effects Poisson model allowing for over-dispersion and spatial correlation, using the conditional autoregressive (CAR) model of besag:74, which may be written
The graph for this model is shown in Figure 15. As with the exchangeable model, introducing the intrinsic prior
means that a level term
is not necessary in this model, although
breslow:clayton:93 retain this term due to their
imposition of the constraint that
. As in the seeds
and ice examples, the standard noninformative prior
for
cannot be used.
Specification of spatial model with intrinsic prior (lipsSig.bug).
model lipsSig;
const
regions = 56, neighbours = 264;
var
O[regions], b[regions], b.bar[regions], SMR[regions],
mu[regions], E[regions], off[regions+1],Nneighs[regions],
x[regions], SMRhat[regions],
map[neighbours], b.neigh[neighbours], alpha1, sigma;
data in "lips.dat";
inits in "lips.in";
{
for (i in 1:regions) {
O[i] ~ dpois(mu[i]);
log(mu[i]) <- log(E[i]) + alpha1*x[i]/10 + sigma * b[i];
b[i] ~ dnorm(b.bar[i],Nneighs[i]);
b.bar[i] <- mean(b.neigh[ off[i]+1 : off[i+1] ]);
SMRhat[i] <- 100*mu[i]/E[i];
Nneighs[i] <- off[i+1] - off[i];
}
for (i in 1:neighbours) {
b.neigh[i] <- b[map[i]];
}
alpha1 ~ dnorm(0.0,1.0E-5);
sigma ~ dgamma(1.00001,1.0)
}
This model shows how one can handle variable length attributes relating to each county. The data file needs to contain the ``map" of adjacent counties. The relevant part of lips.dat is as follows:
map = c( 5, 9,11,19,
7,10,
6,12,
.....
18,24,30,33,45,55),
off = c( 0, 4, 6, 8, ... ,258,264))
This shows the neighbouring counties in a single long list map, with an
additional list off of offset counts, indicating that the
list of neighbours of county i starts at entry off[i]+1
and ends at entry off[i+1]
in map. This enables the calculation of the number of neighbours
(Nneighs) within the .bug program, and also to identify
the current value of
(b.neigh) for each neighbour of i.
This in turn allows the calculation of the mean b.bar[i] of the neighbours
of county i.
Figure 15:
Graphical model for lips example, assuming spatial smoothing
of relative risks using an intrinsic prior.
The precedence condition in BUGS ensures that the sampling for each b does not use the same variables in the prior and the likelihood. 1000 iterations for this model took 47 seconds, and the results are shown at the end of this example.