Hi Oscar,

The syntax and prior look fine. How many levels of group are there and what do 
you mean by crazy?

Cheers,

Jarrod


> On 12 Oct 2019, at 04:54, Oscar Inostroza <oskinostr...@gmail.com> wrote:
>
> I'm trying to run a mixed phylogenetic model using the function in the
> MCMCglmm R package of the same name. In this model, I want to estimate
> slopes and intercepts for each level of a given variable (modeled as a
> random effect). I tried to run the model with the following code. However,
> the estimates of slopes and intercepts for the random effect are crazy!
> (i.e. when running separate models for each level, the results are
> reasonable) There is something wrong with my code? (in the syntax of the
> model, or likely in the prior specification)
>
> prior<- list(G=list(G1=list(V=1, nu=0.002), G2=list(V=diag(2), nu=2,
> alpha.mu= rep(0,2), alpha.V=diag(1000,2,2))), R=list(V=1, nu=0.002))
>
> model<-MCMCglmm(y~x, random=~phylo +
> us(1+x):group,family="gaussian",ginverse=list(phylo=inv.phylo$Ainv),prior=prior,data=data,nitt=nitt,burnin=burn,thin=thin,
> pr=TRUE)
>
> Cheers
>
> p.s the same model, but in the syntax used by brms has the form:
>
> model <- brm(y ~ x +(1|phylo)+(1+x|group), cov_ranef = list(phylo = A)...
>
> (But it's too slow for my amount of data)
>
> --
> Oscar
>
> [[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/

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

_______________________________________________
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