Dear community,
Please advise how to better approach a problem of unbalanced observations in a group when modelling hierarchical truncated poisson model. My objective is to estimate mean number of young trees per species. Four species of young trees (species.p) are nested within mature trees (id.m) that, in turn, are also nested within subplot_id. The problem is that some subplots_ids have only 1 species, the rest three species are NOT missing, they simply do not grow there.
I am afraid that partial pooling in the hierarchical model will work badly for such subplots, worsening the model fit. I would not include the sub-plots with only 1 species in the model but I am interested to hear your opinion. The model is as follows:
center =data %>% mutate(ba_m2.c = (sqrt(ba_m2.p) - mean(sqrt(ba_m2.p), na.rm=TRUE)), dbh.c = (log(dbh_cm.p) - mean(log(dbh_cm.p), na.rm=TRUE)))
dat1=subset(center, species.p %in% c("Acer platanoides", "Acer pseudoplatanus", "Fagus sylvatica", "Ulmus glabra"))
alive=subset(dat1, status.p %in% c("alive"))
fit=brm(count|trunc(lb=1)~ba_m2.p+species.p+species.m+dbh_cm.p+offset(log(crown_area_m2.m))+offset(log(population.d))+(1|subplot_id/position.m)+(1|year/id.m),
data=alive, family=poisson(link="log"), prior=bprior, save_all_pars=TRUE, cores = 4, iter = 1000 + 6000, warmup = 1000, chains = 4, seed=123,
sample_prior="yes", silent=TRUE, open_progress=FALSE, control = list(adapt_delta = 0.99, max_treedepth = 15))
Data are enclosed. Thank you in advance for your time!
- Operating System: Microsoft, Windows 10
- brms Version: 2.13.5
poisson.csv (872.2 KB)