Hi,

I would like to fit a handful of univariate models using brm. My first thought was to use a for loop, where i corresponds to the columns in my data frame containing the different predictor variables. Y1-Y5 are proportions summing to 1.

bind ← function(…) cbind(…)

ncores = parallel::detectCores() - 1

models ← list()

for (i in 1:12) {

models[ i ] ← brms::brm(bind(Y1, Y2, Y3, Y4, Y5) ~ DF[ , i] ,

data = DF, iter = 1000, chains = 4, cores = ncores, family = “dirichlet”)

}

The above code gives the error:

Error in is(sexpr, “try-error”) :

argument “sexpr” is missing, with no default

I found this post: Argument "sexpr" is missing, with no default, pointing out that brm does not like predictor variables specified in this manner.

Any thoughts on how to automate the implementation of models where everything except the predictor variable changes?

Thanks