I'm pretty new to JAGS - I'm sorry to clutter the board if there is an easy

answer to this question that I just haven't been able to find by perusing the

help boards.

I have a large dataset of individual level data that include zip codes. I

would like to assign individuals to congressional districts, unfortunately

there are a non-trivial number of zip codes that fall into more than one

congressional district. I would like to incorporate the uncertainty over which

districts individuals fall into in the analysis.

Basically, I have created two NxK matrices where N is the number of

respondents and K is the maximum number of districts that a respondent could

possibly be in (5 in this data). The first has the probability (proportion of

the population of the respondent's zip code that falls into Congressional

District k) that the respondent is in a particular district, the second has

the indices for the different districts.

I want to fit a multilevel model with respondents nested within congressional

districts also incorporating this uncertainty about location.

Here is the relevant bit of my code:

for (i in 1:N) {

d_ <- dist[i,D_+1]

P_ ~ dunif(0,1)

D_ ~ dinterval(P_, p)

mu_ <- b[d_]*lib_

mfq_ ~ dnorm(mu_, tau.y)

}

the 'dist' matrix has the index numbers for the congressional districts. The

'p' matrix has the cumulative probabilities of falling into each district (the

cut points for the interval distribution that I would like to reflect the

uncertainty about respondent location -- for individuals that might fall into

less than 5 districts, I've set the higher cut points to values greater than

1). In the beginning stages, I've been just trying to fit a really simple

model (one independent variable, 'lib', and no intercept) with a district-

varying coefficient.

I've done a lot of debugging, and it appears as if the interval distribution

is working correctly (the program will run if I replace 'd_ <- dist[i,D_+1]'

with 'd_ <- dist') and the values look right to me, but it doesn't seem to

like when I try to probabilistically change the index for the district.

Am I approaching this in the right way? Thanks!