Skip to content

multilevel logistic model with MCMCglmm

5 messages · Jarrod Hadfield, ronggui

#
Hi Wincent,

The model you ran is meaningless, because with categorical data or  
ordinal data the residual variance cannot be estimated from the data.  
The best option is to fix the residual variance at some value (I use 1):
   
MC1<-MCMCglmm(use~urban+age+livch,random=~district,data=Contraception,family="categorical",prior=list(R=list(V=1, fix=1), G=list(G1=list(V=1, nu=0))),  
slice=T)

I have left the prior on the district variance flat and improper, and  
I have used slice sampling (slice=T) instead of Metropolis-Hastings  
updates because the chain mixes faster:

summary(MC1)

  Iterations = 3001:12991
  Thinning interval  = 10
  Sample size  = 1000

  DIC: 2391.208

  G-structure:  ~district

          post.mean l-95% CI u-95% CI eff.samp
district    0.3333   0.1407   0.5777    459.9

  R-structure:  ~units

       post.mean l-95% CI u-95% CI eff.samp
units         1        1        1        0

  Location effects: use ~ urban + age + livch

             post.mean l-95% CI u-95% CI eff.samp  pMCMC
(Intercept)  -2.02718 -2.38427 -1.69340    559.7 <0.001 ***
urbanY        0.87874  0.61785  1.16036    640.9 <0.001 ***
age          -0.03233 -0.05013 -0.01523    531.4 <0.001 ***
livch1        1.32248  0.96341  1.66027    578.6 <0.001 ***
livch2        1.63986  1.24274  2.05330    542.6 <0.001 ***
livch3+       1.61311  1.18382  2.00119    512.2 <0.001 ***

Note that you can rescale the estimates to approximate what they would  
be if the residual variance was zero (i.e. the glmer default):

c2<-((16*sqrt(3))/(15*pi))^2

posterior.mode(MC1$Sol/sqrt(1+c2))
(Intercept)      urbanY         age      livch1      livch2     livch3+
-1.69345255  0.72259159 -0.03015856  1.14554895  1.38585993  1.34449154

which are closer to the ML estimates.

Cheers,

Jarrod


  Quoting Wincent <ronggui.huang at gmail.com> on Sun, 3 Apr 2011 20:32:27 +0800:

  
    
#
Hi Ronggui,

Fixing the variance at 1 ADDS 1 to the level-1 error rather than  
replacing pi^2/3.

Cheers,

Jarrod


Quoting Wincent <ronggui.huang at gmail.com> on Sun, 3 Apr 2011 23:59:26 +0800: