Please I have a two fold questions and I am not sure how to phrase the title of my post to capture both.

I am trying to fit a regression model in jags, and I am new Bayesian modeling.

In my model I have two variables x1 and x2 that are proportions with values between 0 and 1. In addition x2 has some missing values.

Below is my code and questions:

         for(i in 1:N){
         y[i] ~ dpois(mu[i])
         mu[i]  <- lambda[i]*z[i] + 0.0001
        log(lambda[i]) <- beta[1] + beta[2]*x1[i] + beta[3]*x2[i] + log(offset[i])
        x2[i] ~ dbeta(1,1)
       z[i] ~ dbern(phi)
  for(j in 1:3) {
    beta[j] ~ dbeta(1,1)} 
    phi ~ dunif(0,10)

My questions are:

is it proper to use beta priors as stated above in this context?

is it okay to have a normal prior for beta[1] and beta priors for beta[2] and beta[3]?

If I have a variable say x4 with two categories what prior distribution should I use normal or uniform?

Thanks for your responses.

Edit: The x2[i] ~ dbeta(1,1) is to imput missing values. Edit2: The response variable contains quite a number of zeros which was the reason I opted for the Zero inflated approach.

  • $\begingroup$ We don't set priors for data, but for parameters. What are you trying to achieve with this code? $\endgroup$
    – Tim
    Jun 3 '20 at 6:44
  • $\begingroup$ @Tim I missed a part in my text I will edit. for X2 there are some missing values that was why I set a prior for it. What I intend to achieve is to find the relationship between the covariates X1, X2 and the response variable Y which is number of visit to a center and the offset is the population for each region. $\endgroup$ Jun 3 '20 at 9:33

The question if some prior is "ok", or not, cannot be answered without in-depth knowledge of your data, the model, and the questions you are trying to answer with it. So if it is reasonable to assume that beta[2] and beta[3] can only take values between zero and one, then the prior may make sense. Notice however that beta distribution has closed support, any value below zero, or above one, is impossible according to such distribution. It will return zero densities for such values, and whatever you multiply by zero, becomes zero, so by making such choice you make it impossible for your model to find values for those parameters that fall outside unit interval. Maybe this makes sense in case of your model, maybe not, however in many cases making such hard restrictions on parameters is not the best idea.

More specifically, if x1 and x2 are proportions, then they presumably are also values between zero and one, if additionally beta[2] and beta[3] are values in unit integral, then 0 $\le$ beta[2]*x1[i] $\le$ 1, and 0 $\le$ beta[3]*x2[i] $\le$ 1, so 0 $\le$ beta[2]*x1[i] + beta[3]*x2[i] $\le$ 2. This means that if log(lambda[i]) needs to be greater then two, the only way for the model to achieve this is by increasing the intercept. If lambda is large, your model would predict the intercept and some "leftovers" calculated from the parameters, that would not have any significant impact on the predictions.

  • $\begingroup$ thanks for the insightful comments. The idea of the model is to estimate the effect of the proportion of respondent with a certain level of education in a cluster (X1) and the proportion of respondent in each cluster that receive certain promotional items (X2) with the number of respondent in each cluster that visit the certain for recreational activities (Y). The Y is recorded as count variable while X1 and X2 are recorded as proportion in the data set. After reading your comment I am beginning to rethink my model in a different light. $\endgroup$ Jun 3 '20 at 10:49
  • $\begingroup$ @ Tim rethinking my model, I decided to allow beta[2] and beta[3] take any values and I assigned normal priors to beta[2] and beta[3], I observed that the effects are no longer significant unlike when I assigned beta priors to beta[2] and beta[3] and normal prior to beta[1]. Any idea what could be responsible for this? $\endgroup$ Jun 3 '20 at 10:56
  • $\begingroup$ @new_student how do you judge their significance? $\endgroup$
    – Tim
    Jun 3 '20 at 10:59
  • $\begingroup$ I looked at their HDI interval if it overlaps with zero or not. $\endgroup$ Jun 3 '20 at 14:28
  • $\begingroup$ @new_student with beta prior the parameter can be only in (0, 1) so you force the parameter to be greater then zero. It will never overlap because this is how you defined it. Another reason why making such decisions may be a bad idea: you could force the parameters to have values that are otherwise bad in terms of the data. $\endgroup$
    – Tim
    Jun 3 '20 at 14:34

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.