Skip to content
Prev 8343 / 20628 Next

HPD intervals for fixed parameters in model

Log transforming the Age variable prior to putting it in the model solved the problem of a random slope in glmmADMB. 

Thanks also to Ben for the note about the different covariance matrices in use. I did a bit more reading on this, especially for MCMCglmm, and came up with the following model structures. Are the following lmer, MCMCglmm and glmmADMB roughly comparable?

*Variation in fish intercepts, variation in Age slopes, correlation between intercept and slope:

M1lmer<-lmer(log(Increment)~logAge+temp+(logAge|FishID)+(1|fYear),data,REML=T)
M1mcmc<-MCMCglmm(log(Increment)~logAge+temp,random=~us(1+logAge):FishID + fYear,rcov= ~units, data=data, prior=prior)##us allows for intercept and slope covariance
##not possible with glmmADMB??

* Variation in fish intercepts and age slopes, but no correlation between intercept and slope:

M2lmer<-lmer(log(Increment)~logAge+temp+(1+FishID)+(0+logAge|FishID)+(1|Year),data,REML=F)##REML= FALSE is equivalent to glmmADMB?
M2mcmc<-MCMCglmm(log(Increment)~logAge+temp,random=~idh(1+logAge):FishID + fYear,rcov= ~units, data=data, prior=prior)##idh sets covariance between intercept and slope to zero (also could use idh(logAge):FishID+FishID)
M2glmmADMB<-glmmadmb(log(Increment)~logAge+temp+(logAge|FishID)+(1|fYear),NSWtiger,family='gaussian')

Cheers

John

-----Original Message-----
From: Ben Bolker [mailto:bbolker at gmail.com] 
Sent: Monday, 4 June 2012 5:12 PM
To: Morrongiello, John (CMAR, Hobart)
Cc: r-sig-mixed-models at r-project.org
Subject: Re: [R-sig-ME] HPD intervals for fixed parameters in model
On 12-06-04 03:03 AM, John.Morrongiello at csiro.au wrote:
As a quick possible workaround, try defining data$logAge <-
log(data$Age) and using (logAge|FishID) in your model formula; I'm not
sure that glmmADMB can handle defining variable transformations on the
fly in that context.

  Also be aware that the default for lme4 is to use the full correlation
matrix while glmmADMB uses a diagonal matrix, so (e.g.) (logAge|FishID)
would estimate three parameters (variation in intercept across fish,
variation in slope across fish, covariance between intercept and slope)
while glmmADMB would only estimate the first two.  (I think you have to
specify this choice explicitly in MCMCglmm.)