Dear Grace,

the problem may derive from your specification of the priors. Usually you don’t 
specify the prior for B in MCMCglmm. The problem may also be related to the 
size of your dataset. Estimation of effects can be difficult with binary data, 
when the dataset is small. Below is a small example from Jarrod Hadfield for 
binary regression that accounts for phylogeny.


tree <- rcoal(200)
x <- rnorm(200)
l <- rbv(tree, 1, nodes="TIPS") + x + rnorm(200)
y <- rbinom(200, 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)
# fixed effects should be around zero and one (+/- monte carlo error)
summary(m1$Sol)
# phylogenetic ICC should be 1/(2 + pi^2/3) = 0.189 (+/- monte carlo error)
summary(m1$VCV[, 1] / (rowSums(m1$VCV) + pi^2/3))

Hope this helps,

Jörg

—
Jörg Albrecht, PhD
Postdoctoral researcher
Institute of Nature Conservation
Polish Academy of Sciences
Mickiewicza 33
31-120 Krakow, Poland
www.carpathianbear.pl <http://www.carpathianbear.pl/>
www.globeproject.pl <http://www.globeproject.pl/>
www.iop.krakow.pl <http://www.iop.krakow.pl/>
> Am 10.02.2016 um 00:55 schrieb Grace Pold <grace.p...@gmail.com>:
> 
> Hello,
> 
> I have characterized a few hundred bacteria from two environments and want to 
> know if the bacteria from one environment is more likely to show a trait than 
> the bacteria isolated from the other environment. So my data is binary in 
> both the independent and in the dependent variable: "environment 1?" yes/no, 
> and "degrades carbon source?" yes/no. If I wasn’t accounting for phylogeny, I 
> think I would use a Chi-Squared test. But I would like to account for 
> phylogeny in my analysis, since some of the bacteria form clusters on my 
> phylogenetic tree with members only from one environment. 
> 
> I thought maybe I could use MCMCglmm to test this, and have been following 
> the examples previously posted on r-sig-phylo and in the MCMCglmm course 
> notes. However, my model either fails to converge even after millions of 
> iterations, or the autocorrelation plot shows strong positive correlations at 
> a range of lags. So I think either I cannot use MCMCglmm for this, or I am 
> specifying my model wrong. Any pointers in the right direction would be 
> greatly appreciated. 
> 
> Here is my model:
> 
> prior.m2c.5 = list(B = list(mu = c(0, 0), V = diag(2) *(1 + pi^2/3)), R = 
> list(V = 1, fix = 1), G = list(G1 = list(V = 1, nu = 1, alpha.mu = 0, alpha.V 
> = 1000)))
> 
> simplemcmcCMCv2_5<-MCMCglmm(carbon01~environment01, random=~animal, 
> pedigree=ctree, data=wcboth, family="categorical”, nitt=10000000, 
> burnin=100000,thin=2000, prior=prior.m2c.5)   
> 
> Thank you in advance for any help,
> 
> Grace Pold
> 
> Graduate Program in Organismic and Evolutionary Biology
> University of Massachusetts, Amherst
>       [[alternative HTML version deleted]]
> 
> _______________________________________________
> R-sig-phylo mailing list - R-sig-phylo@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
> Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/
> 


        [[alternative HTML version deleted]]

_______________________________________________
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/

Reply via email to