Hi all,
I am a PhD student using brms to run mixed models to understand the effect of parental factors on the hatching success of eggs. On of my variables is age, which has been shown to have a non-linear relationship with hatchabiity in species other than the one I am studying. As a result, I want to include the age effects as quadratic effects in my model. My model currently looks like this:
model_hatch <- brm(Hatched ~
#quadratic fixed effects
Sire.age.years + Dam.age.years +
I(Dam.age.years^2) + I(Sire.age.years^2) +
#linear fixed effects
Dam.Inbreeding + Sire.Inbreeding + Pair.Inbreeding +
Sire.Inbreeding*Sire.age.years + Dam.Inbreeding*Dam.age.years +
#random effects
(1| Sire.Studbook.ID) + (1| Dam.Studbook.ID)+
(1|Lay.Year) + (1| Location),
data = data_dev_hatch_sc,
family = "bernoulli",
prior = priors_hatch,
iter = 50000,
control=list(adapt_delta=0.99),
cores = 8,
sample_prior = TRUE)
Based on other research my priors are as follows:
priors_hatch <- c(set_prior("normal(-5.8,5)", class = "b", coef = "Dam.age.years"),
set_prior("normal(-5.8,5)", class = "b", coef = "Dam.age.years"),
set_prior("normal(-5.8,5)", class = "b", coef = "Sire.age.years"),
set_prior("normal(0,5)", class = "b", coef = "Sire.Inbreeding"),
set_prior("normal(-5,5)", class = "b", coef = "Dam.Inbreeding"),
set_prior("normal(-0.5,5)", class = "b", coef = “Pair.Inbreeding"))
I would like to set priors for these quadratic effects that are different from their linear counterparts but so far am struggling to do so. Is it possible to do this within brms?
Thanks
- Operating System: macOS Monterey
- brms Version: 2.18.0