I have a dataset where parents and staff were asked to rate how different variables would be expected to affect how much time parents were present at the bedside. The original purpose was to create informative priors for a group of parents we were recruiting with measurements of time at bedside. In the interim, we are interested in how parent and staff responses differ.
I fit the following:
stan1 = stan_lmer(acuity ~ role + (1|role), data = all_merged) stan2 = stan_lmer(acuity ~ role + (1|role), prior = laplace(), data = all_merged)
But there were seven problematic observations in model 2 when using loo. I then specify:
loo(stan2, k_threshold = 0.7)
But get the following error:
Fitting model 1 out of 7 (leaving out observation 44) Error in model.frame.default(delete.response(Terms), newdata, xlev = orig_levs) : factor role has new level Social Worker
I’m sure this is because we only have one social worker observation. Is there any way around this or should I just be re-thinking the model instead?