I am experimenting with a phylogenetic regression using brms with a categorical response. For now I have no covariates, just the phylogeny.
A <- ape::vcv.phylo(phylo)
options(mc.cores = parallel::detectCores())
model <- brm(System ~ 1 + (1|gr(phylo, cov = A)), data = data, data2 = list(A = A),
family = categorical(),iter=6000,
control=list(adapt_delta=0.99999, max_treedepth = 11))
I have two questions. First is it even appropriate to fit a model like this, or are there better practices that are recommended? Second, it is my understanding that the inter class correlation will give me something analogous to phylogenetic signal. If that’s true, would an appropriate way of estimating that given a categorical model family be something like this?
PPD_ranef <- posterior_predict(model, summary = F)
PPD_noraneff<- posterior_predict(model, re_formula = NA, summary = F)
var_ranef <- apply(PPD_ranef , 1, var, na.rm=T)
var_noraneff <- apply(PPD_noraneff, 1, var, na.rm=T)
ICC<- var_noraneff / var_ranef
quantile(ICC, probs = c(.025, .5, .975))
mean(ICC,na.rm=TRUE)
Any feedback is much appreciated!