[R-sig-ME] Phylogenetic Logistic Regression + MCMCglmm

Joanna L Baker J.L.Baker at 2008.hull.ac.uk
Mon Sep 3 18:10:04 CEST 2012

Dear Jarrod,

Thank you very much for your response. Unfortunately I still have issues
with convergence even when the residual variance is fixed. Part of the
problem I was having was the specification for visualizing the posterior
distributions of the phylogenetic portion of the analysis. 

This may be a silly question, but what is the difference between:



The two produce very obviously different graphs, and I was wondering
what exactly the second part of the latter plot is related to?

Even looking at the correct graph for the phylogenetic part of the
analysis, it seems I am having trouble with 'animal' converging, and
have massive issues with the variance. I have attached the posterior
distributions for both your example (PhyLogRegSIM.pdf) and my own data
(PhyLogRegDAT.pdf) to illustrate the problem.  This occurs even when
running the models for a longer time.
I much appreciate your time and advice on this matter. 

Joanna Baker

Below is the code for my model specification:

prior1=list(R=list(V=1, fix=1), G=list(G1=list(V=1, nu=1, alpha.mu=0,

my2<-MCMCglmm(DV~IV, random=~animal, ginverse=list(animal=myAinv2), 
	family="categorical", prior=prior1, data=mydata,



-----Original Message-----
From: Jarrod Hadfield [mailto:j.hadfield at ed.ac.uk] 
Sent: 01 September 2012 20:06
To: Joanna L Baker
Cc: r-sig-mixed-models at r-project.org
Subject: Re: [R-sig-ME] Phylogenetic Logistic Regression + MCMCglmm


The most likely reason is that you have not fixed the non-identified
residual variance, although there are other possibilities. Here is an
example with a simulated tree and binary data:

l<-rbv(tree, 1, nodes="TIPS")+x+rnorm(100) y<-rbinom(100, 1, plogis(l))

dat<-data.frame(y=y, x=x, species=tree$tip.label)

prior1=list(R=list(V=1, fix=1), G=list(G1=list(V=1, nu=1, alpha.mu=0,

# residual variance fixed at 1.

m1<-MCMCglmm(y~x, random=~species, ginverse=list(species=Ainv),
family="categorical", prior=prior1, data=dat)

# fixed effects should be zero and one


# phylogenetic ICC should be 1/(2+pi^2/3)=0.189. Note wdie credible
intervals - you need v.large phylogenies to get precise estimates with
binary data.



Quoting Joanna L Baker <J.L.Baker at 2008.hull.ac.uk> on Fri, 31 Aug 2012
11:39:08 +0100:

> Hello all,
> I am currently trying to use MCMCglmm to carry out a phylogenetic 
> logistic regression, with a single binary response and one or more 
> continuous or categorical predictors. However, I am having issues with

> the phylogenetic component, 'animal', converging. This occurs when I 
> use different datasets, with high, moderate and low phylogenetic
> I have tried improper (with the expected issues), proper, and 
> alpha-expanded priors but these do not seem to have much effect on the

> results. I should note that I have no issues with convergence when my 
> response is a continuous variable.
> Does anybody have a worked example with data and tree that I could use

> to get started with phylogenetic logistic regression or could somebody

> point me in the direction of any published work that has used the 
> package for such an analysis successfully? I'll much appreciate any 
> help with this.
> Thanks again,
> Joanna Baker
> University of Hull
> Cottingham Road
> Hull
> East Yorkshire
> j.l.baker at 2008.hull.ac.uk

The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.

-------------- next part --------------
To view the terms under which this email is 
distributed, please go to 

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