[R-sig-ME] HPDinterval MCMCglmm and using transformed variables in MCMCglmm (Rebecca Ross)

Nicholas Lewin-Koh nikko at hailmail.net
Mon Jul 12 18:05:31 CEST 2010


Hi Rebecca,
Just a thought, when you "logged back in" did you reload all the
libraries?
try 
library(MCMCglmm)
HPDinterval(AMstem3$VCV)

Nicholas

> Date: Mon, 12 Jul 2010 10:31:50 +0100
> From: Rebecca Ross <rebecca.ross at plants.ox.ac.uk>
> To: "r-sig-mixed-models at r-project.org"
> 	<r-sig-mixed-models at r-project.org>
> Subject: [R-sig-ME] HPDinterval MCMCglmm and using transformed
> 	variables in	MCMCglmm
> Message-ID:
> 	<756B64E07365AF43BE945A734A85E44544616944B9 at EXMBX03.ad.oak.ox.ac.uk>
> Content-Type: text/plain
> 
> Dear ME users,
> 
> Apologies if this is a naive question, I am new to using MCMC glmm. I
> have been working through the tutorial, using some of my own data, and I
> thought I had followed the steps correctly. The model I have been fitting
> is:
> 
> AMstem3<-MCMCglmm(log(stem)~Dist_fr_A,random=~Block+animal,pedigree=Ped,data=SapRO,prior=prior1.3,
> family="gaussian")
> Briefly, I want to see how the Distance variable (continuous) affects
> stem weight, which I have log transformed as the raw data is
> heteroscedastic. Block is field block, and I am fitting the animal random
> effect to take into account different relatedness between individuals
> (I'm not at the moment trying to estimate Va).
> 
> When I tried this model last night, I could get the 95% CIs using this
> function
> HPDinterval(AMstem3$Sol[,"Dist_fr_A"])
> HPDinterval(AMstem3$VCV)
> 
> When I tried this morning, I get the following error message
> Error in function (classes, fdef, mtable)  :
>   unable to find an inherited method for function "HPDinterval", for
>   signature "mcmc"
> Can anyone explain what  has gone wrong? I've tried changing the terms in
> the model, but that doesn't help, so I think I must have changed
> something in R elsewhere? Or else missing something completely obvious.
> 
> Question 2: I dont think MCMCglmm is actually logging my stem variable
> because the fixed effect parameter estimate from the model above
> (AMstem3) are about a factor of 10 out from the fixed effect estimate
> from
> a similar model, fit in lme4, without the animal effect and very similar
> to the same model using the raw stem weight (see below). Do I need to
> specify the log transform differently?
> 
> AMstem3c Dist_fr_A  posterior mode: -0.004236659
> versus:
> stem5a<-lme(log(stem)~Dist_fr_A,random=~1|Block,data=SapRO,na.action=na.omit)
> Fixed effect Estimate: Dist_fr_A   -0.0004442 (SE=0.00006136)
> and:
> stem5b<-lme(stem~Dist_fr_A,random=~1|Block,data=SapRO,na.action=na.omit)
> Fixed effect Estimate: Dist_fr_A   -0.004342 (SE=0.0006714)
> 
> Thank you very much for your help,
> 
> Rebecca Ross
> DPhil Candidate,
> University of Oxford.
> 
> 
> 
> 
> 	[[alternative HTML version deleted]]
> 
> 
> 
> ------------------------------
> 
> _______________________________________________
> R-sig-mixed-models mailing list
> R-sig-mixed-models at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
> 
> 
> End of R-sig-mixed-models Digest, Vol 43, Issue 14
> **************************************************
>




More information about the R-sig-mixed-models mailing list