Skip to content
Prev 12366 / 20628 Next

Random effects in clmm() of package ordinal

Hi Christian,

I think clmm is dealing with the random 'slopes' correctly (or at  
least it gives the same estimates as MCMCglmm) when temp is  
categorical (see below). Without knowing much about clmm I can imagine  
it might fail when temp is truly continuous because the variance of  
each latent variable varies as a function of the covariate and so (in  
the probit case) the cdf of the normal (i.e. the probit link) would  
need to be evaluated using different standard deviations.

Cheers,

Jarrod

fm2 <- clmm(rating ~ temp + contact + (temp-1 | judge),
? ? ? ? ? ? data = wine, link="probit",
? ? ? ? ? ? Hess = TRUE)

# note that I have changed temp|judge to temp-1|judge because I think  
it makes more sense with categorical variables.  Also I have used  
probit link in order to compare it to MCMCglmm's "threshold".

prior2=list(R=list(V=1, fix=1), G=list(G1=list(V=diag(2), nu=2,  
alpha.V=diag(2)*100, alpha.mu=c(0,0))))

fm2.mcmc <- MCMCglmm(rating ~ temp + contact, random=~us(temp):judge,  
data = wine,family="threshold", prior=prior2, nitt=13000*10,  
thin=10*5, burnin=3000*10, verbose=FALSE)


par(mfrow=c(2,2))
hist(fm2.mcmc$Sol[,2], breaks=50)
abline(v=coef(fm2)[5], col="red")
hist(fm2.mcmc$Sol[,3], breaks=50)
abline(v=coef(fm2)[6], col="red")
hist(fm2.mcmc$VCV[,1], breaks=50)
abline(v=VarCorr(fm2)$judge[1], col="red")
hist(fm2.mcmc$VCV[,4], breaks=50)
abline(v=VarCorr(fm2)$judge[4], col="red")




Quoting Christian Brauner <christianvanbrauner at gmail.com> on Fri, 29  
Aug 2014 19:20:42 +0200: