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

Sat Sep 1 21:06:22 CEST 2012

```Hi,

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:

tree<-rcoal(100)
x<-rnorm(100)
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,
alpha.V=1000)))

# residual variance fixed at 1.

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

plot(m1\$Sol)
# fixed effects should be zero and one

plot(m1\$VCV[,1]/(rowSums(m1\$VCV)+pi^2/3))

# 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.

Cheers,

Jarrod

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 signal.
>
> 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
>
>
> 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.

```