Thanks again for your response, @fweber144!
This now works when parallel = FALSE
but throws the following error when parallelised:
Error in { : task 1 failed - “could not find function “nlist””
When trying latent = TRUE
, it unfortunately throws the same error, with the full traceback below:
Error in eval(formula[[2]], data, environment(formula)) :
object ‘.y’ not found
7: eval(formula[[2]], data, environment(formula))
6: eval(formula[[2]], data, environment(formula))
5: eval_el2(resp_form, newdata)
4: y_wobs_offs(newdata = newdata, wrhs = wrhs, orhs = orhs, resp_form = if (extract_y) lhs(formula) else NULL)
3: extract_model_data_usr(object = object, newdata = newdata, …)
2: extract_model_data(object, newdata = NULL, extract_y = TRUE)
1: init_refmodel(fit_brm, data = df, formula = y ~ ., family = binomial(),
latent = TRUE, cvfun = custom_cvfun, cvrefbuilder = custom_cvrefbuilder,
ref_predfun = custom_ref_predfun_1)
To those coming across this question, I realised that the modelling of duplicate predictor measurements using (1 | subject)
isn’t correct, although other than calculating the mean of the duplicates prior to modelling, I’m not sure of the best way to handle this (e.g. here) that would be compatible with projpred
.