0
$\begingroup$

In JAGS, I am working with data that have missing observations of a count. I know two things about each missing observation: (1) All missing counts were observed by the CDC but numbered from 0 to 9. (2) On a given year, all of the missing counts total-up to some nationwide number.

In my code below, observations 1-419 are fully observed. Observations 420-456 are missing observations where I know they sum to 113. I used a multinomial distribution to do this. Observations 457-969 are also missing, but I use a truncated Poisson to force 0 to 9 counts.

Is there any way I can do both of these at once. A few ideas:

*Is there something like the T(,) function for dmulti()?

*Can I set a condition that would reject an iteration if it fails? E.g., if the maximum value of Deaths[420:456]>9, throw out that draw and try again?

*Can I use my truncated Poissons and impose that certain sums have to total up to a number, or else reject the draw?

*Is there another distributional setup that might work better.

Option #2 seems the post plausible to me, but I'm not sure. Ideas are welcome. Here's my code:

model {
for (i in 1:419){
    log(lambda[i])<-(constant+beta*log(Population[i]))
    Deaths[i]~dpois(lambda[i])
}

for (i in 420:456){
    log(lambda[i])<-(constant+beta*log(Population[i]))
}
Deaths[420:456]~dmulti(lambda[420:456],113)

for (i in 457:969){
    log(lambda[i])<-(constant+beta*log(Population[i]))
    Deaths[i]~dpois(lambda[i])T(,9)
}

#Priors
beta~dnorm(0,0.01)
constant~dnorm(0,.01)
}
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.