Hi! I am trying to run a piecewise structural equation model using five submodels and I was wondering how to get the complete model to run if the response variables in each submodels have different distributions (three are Gaussian, one is beta, and one is binomial). How can I specify family for each submodel in brm?
Any help and guidance is much appreciated! If there is a better way to code a PSEM in brms please let me know, I’m very new to the package!
Here is the code for each of my submodels and the complete model:
# Submodel 1 (gaussian)
hatch_mod <- bf(Hatch.Day ~ Supp.Factor + pc1.Fall + pc1.Pre + Breed.MT + (1|Nest.ID))
# Submodel 2 (gaussian)
brood_mod <- bf(Sibling ~ Supp.Factor + pc1.Fall + pc1.Pre + Breed.MT + Hatch.Day)
# Submodel 3 (beta)
diet_mod <- bf(Vert ~ Supp.Factor + pc1.Fall + pc1.Pre + Breed.MT + Hatch.Day + (1|Nest.ID))
# Submodel 4 (gaussian)
condition_mod <- bf(Condition ~ Vert + Supp.Factor + pc1.Fall + pc1.Pre + Breed.MT + Hatch.Day + Sibling + (1|Nest.ID))
# Submodel 5 (binomial)
survival_mod <- bf(Surv.Fall ~ Condition + Vert + Supp.Factor + pc1.Fall + pc1.Pre + Breed.MT + Hatch.Day + Sibling + (1|Nest.ID))
# Complete model
k_fit_brms <- brm(hatch_mod +
brood_mod +
diet_mod +
condition_mod +
survival_mod +
set_rescor(FALSE),
data=FinalDiet,
cores=2, chains = 2)