Hi,
sorry for not getting to your question earlier. It is relevant and well written.
I don’t think what you aim for is directly supported, but note that conditional_effects
really just computes posterior predictions of the model (by default with posterior_predict
) while changing only the smooth predictor (here hp
). So what you are getting is AFAIK not the difference of the smooth themselves, but the difference of the whole predictions.
With that in mind, you can use posterior_predict
(or posterior_epred
if you want to work without the measurement noise) to predict the values for two sets of conditions, differring only in the vs
value, then, for each sample, compute the difference and summarise this in a plot. (note that this will also include the fixed vs
effect). I don’t think there is an
A similar question has been discussed at Extracting posterior samples of smooth effects in brms, so linking for completeness.
I think there was some work in tidybayes
to let you extract the smooth terms separately (Add support for mgcv · Issue #130 · mjskay/tidybayes · GitHub) but it doesn’t seem to have been finalized (tagging @mjskay for confirmation)
Does that make sense?
Best of luck with your model!
P.S.: Note that you can use triple backticks (```) to format text as code / output.