Dear List

I'm having a bit of trouble with a mixed model I'm coding in JAGS, interfaced with R using the runjags package.

My model is of the form Y~A+B+(1|Group)

Where Y is a binary outcome, A is an individual-level predictor, and B a group-level one. When running this model in either LME4 or MCMCglmm both predictors are 'significant'. However, when I code the model myself in JAGS, the credible intervals for predictor B cross zero. Only this morning did I figure out that the reason for this is the 'uninformative' prior I use for the SD of the random intercept. When I give it a broad range on the uniform interval (0,10) or (0,100), as per the guidelines in Kery (2010), the posterior estimate of the SD becomes suspiciously large (eg. 95% CI 3-9), whereas LMER will tell me that there's probably not enough information in the data to accurately estimate the shape of the random effects distribution, and returns a value of <1.

However if I restrict the SD to be drawn from a distribution on the interval (0,1) or (0,2) (essentially using the LMER/MCMCglmm estimates to inform the SD), then the output from the JAGS model converges on the same estimates as the other models. All JAGS models report adequate convergence irrespective of SD prior distribution, which is confusing. 

I have run these models with simulated data fro my own peace of mind, and only when the SD prior is restricted to (0,1) does the model recover the correct estimates. This problem also seems to be insensitive to sample size, as I have run the models with fake data equivalent to my sample (238 obs in 4 groups) and with a more ideal sample size (1000 obs in 4 groups). So I guess I was wondering:

1) Is it ok to restrict the distribution for the SD to 'sensible' values, without wandering into the dangerous realm of using subjective priors?

2) Are there better prior distributions to use for SDs that might not suffer from this problem?


Model code is attached below. For clarity, in this model I have moved the group-level predictor into a group-level model following the guidelines of Gelman & Hill (2006)

Many thanks

Xavier

femmod2<-"model{
	
	#Group Model
	for (k in 1:4){
		a[k]~dnorm(mu.year[k],tau.year)
		mu.year[k]<-alpha.year + b.naoj*naoj[k]
		}
		
		#Group Priors
		sigma.year~dunif(0,2)	##SD for Random intercept, taken from a uniform distribution
		tau.year<-1/(sigma.year*sigma.year)
		alpha.year~dnorm(0,0.001)
		b.naoj~dnorm(0,0.001)
				
	# Individual Priors
	b.bci~dnorm(0,0.001)
	
	
	# Individual Model
	for (n in 1:nsample){
		breed[n]~dbin(p[n],1)
		logit.p[n]<-a[yearcode[n]] + b.bci*bci[n] 
		p[n]<-exp(logit.p[n])/(1+exp(logit.p[n]))
			}
		
		}"
	




---------------------------------------------------------
Dr Xavier Harrison
BBSRC Postdoctoral Research Associate
Centre for Ecology and Conservation
University of Exeter
Tremough Campus
Penryn
Cornwall
TR10 9EZ
Tel: (01326) 371872
xav.harrison@gmail.com










	[[alternative HTML version deleted]]


