I ran a phylogenetic analysis following these examples for repeated measures:
https://cran.r-project.org/web/packages/brms/vignettes/brms_phylogenetics.html
Nevertheless, this error always pops up, no matter if species names are the same for both data set and
the phylo tree
“Levels of the within-group covariance matrix for ‘phylo’ do not match names of the grouping levels.”
Checking species names with ‘geiger’:
name.check(data, phylo)
[1] “OK”
Code:
model_repeat1 ← brm(
v ~ bio1 + (1|gr(phylo, cov = A)) + (1|species),
data = data,
family = gaussian(),
data2 = list(A = A),
prior = c(
prior(normal(0,10), “b”),
prior(normal(0,50), “Intercept”),
prior(student_t(3,0,20), “sd”),
prior(student_t(3,0,20), “sigma”)
),
sample_prior = TRUE, chains = 2, cores = 2,
iter = 4000, warmup = 1000
)
- Operating System: Windows 10
- brms Version: 2.13.5
Any idea of what I am missing here?
Thanks in advance,
Rhainer