[R-sig-ME] Prior for phylogenetic multi-response model MCMCglmm

Diego Beltran d|egobe|ttr@n@ @end|ng |rom gm@||@com
Tue May 21 22:41:54 CEST 2019


Dear List Members,

I'm trying to do a Phylogenetic multi-response model using MCMCglmm and
keep having trouble adjusting the priors.

Suppose I have a dataset composed of three continuous response variables
(H1,H2,H3) and a set of predictor variables composed of seven continuous
variables and two categorical variables (patch and sex), with five and two
levels, respectively. My random effects are phylogeny and individual (ID),
with a phylogeny of 150 species. Each name in 'animal' matches a tip in the
phylogeny (tree). All continuous variables are log transformed for
normality and standardised. Each row in the data frame is a patch of an
individual of a given species and I want to know if the predictor variables
have an effect on the response variables, given the phylogeny and the fact
that there is more than one individual per species, which belong to
different sexes.

Here is the code to an example of how my dataset looks like:

example <- data.frame(ID=rep(seq(1,4),each=5),
animal=rep(rep(seq(1,2),each=5),2),
Sex=factor(rep(c('Females','Males'),each=10)),
Patch=factor(rep(c('1','2','3','4','5'),4)), H1=rnorm(20,0,1),
H2=rnorm(20,0,1), H3=rnorm(20,0,1), A1=rnorm(20,0,1), A2=rnorm(20,0,1),
A3=rnorm(20,0,1), Di_chrom=rnorm(20,0,1), Di_achrom=rnorm(20,0,1),
Chrom_com=rnorm(20,0,1), Achrom_com=rnorm(20,0,1))


My priors:

prior1 <- list(R = list(V = diag(1), nu = 0.002),
              G = list(G1 = list(V = 1, nu = 0.002),
                       G2 = list(V = diag(2) * 0.02, nu = 4)))

My full model:

mod <- MCMCglmm(fixed= cbind(H1,H2,H3) ~
A1 + A2 + A3 + Di_chrom + Di_achrom + Chrom_com + Achrom_com + Sex + Patch
-1,
random= ~ us(trait):animal + us(Sex):ID,
rcov = ~ us(Sex):units,
family=rep('gaussian',3),
nitt = 60000, thin=200, burnin = 10000,
prior=prior1,
data=example, pedigree=tree,
DIC=TRUE, verbose=FALSE)


My attempts at running the model result in the following error:

Error in priorformat(if (NOpriorG) { :
  V is the wrong dimension for some prior$G/prior$R elements

Any help would be greatly appreciated. Thank you very much in advance!

Best,
Diego
-- 
---
Diego Beltrán
Grupo Ecología y Evolución de Vertebrados
Universidad de Antioquia
Colombia

	[[alternative HTML version deleted]]



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