Use of 95% CI for measurement error instead of SE in brms

Hi all, I’m using a brms model to measure correlation between x and y, and for both x and y I have distributions (posteriors from another model). Is there a way to have the se() (for DVs) and me() (for IVs) use this information directly, rather than having manually find the mean and SE for the distribution’s samples? It feels like doing that loses some valuable information…



Interesting. Here’s a wacky idea:

You might be able to approach this as if you had missing data which you were handling with multiple imputation. Paul briefly covered how one would fit a model with multiple imputation in this vignette. Here you’d divide up your posteriors from that earlier model, by MCMC iteration, and fit models to the iterations. For this to be tractable, I’m guessing you’d want to take a just a subset of those earlier MCMC iterations, like 5 or 20 or 100. Then you’d combine the results using the multiple imputation functionality discussed in Paul’s vignette.


Thanks! I’ll give this a shot and report back.

@Solomon’s idea is interesting. In general preserving information from posteriors into next fits completely is a challenge, some more discussion at e.g. Using posteriors as new priors ; Composing Stan models (posterior as next prior)

The best solution is to just fit a big model that includes everything (though that might be sometimes hard to implement).

Best of luck with the model!

Hi @martinmodrak and @Solomon,

Finally getting back around to responding to this - thanks a lot for your thoughts, I appreciate it. For reference, I’d like to fit a full model, but I think that might be a bit tricky (so far, I haven’t managed to get very clean results).

The data-generating story is this:

Each of 30 participants completes a series of binary trials of a task (let’s call it the “word formation task” for now), which have two subtypes, the outcome of which is of primary theoretical interest. Theory predicts that two internal qualities should influence their responses, one quantity for one subtype, and another for the other.

After the trials of the binary task, each participants completes a different task (30 trials of two different subtypes, let’s call it the “word rating task”) which is predicted by theory to be predicted by the internal qualities which were predictors in the previous task.

The goal is to be able to model the correlation between word-formation task and the word-rating task, both at the population level and at the level of the individual, for each of the two subtypes of trial which measure the two internal qualities. The word formation task has a binary response variable which is predicted by other factors in addition to this internal quantity, and the word rating task is a five-level ordered dependent variable (Likert scale data), where the only theoretically expected predictor is the internal quantity.

edit: What I’ve done is extracted by-participant (posteriors for) predicted values of the BLUP for each subject from both tasks, and was trying to use these as inputs to a correlation (hence the above question), However, I can’t quite think of a great way to do this in the “fit one big model” approach. Do you guys have any suggestions on how to proceed?

(also, as an aside, I’m a huge fan of your books Solomon :) :) :) they’ve really helped me in getting to grips with some of the practical data wrangling that you can / need to do when fitting more complex models)

1 Like

This looks a bit similar to what we discussed at Help conceptualizing a model would any of the approaches mentioned there help? Feel free to ask for clarifications here. Also is going to pure Stan an option or do you need to stay within brms?

To do it well you would need something like a mixture of Normals for the posterior you are including as a predictor. That would be a better fit than just a single Normal prior. Not sure though if/how to do that in brms.