Using **hypothesis()** with **s()** from **brms**

Can one specify a hypothesis to test, for example, a difference between:

s(Covariate, by=TwoLevelFactor)

This gives the two smooth terms, one for each level of the fixed factor. The hypothesis() should, then, test if there is a difference (i.e., whether by=by=TwoLevelFactor is justified or not.


Sorry for taking time to reply to your post. I have not worked much with splines, and there could be brms specific things here so my hope is that @paul.buerkner can reply.

1 Like

hypothesis() unfortunately does not work with splines because splines are presented by a whole set of themselves uninterpretable parameters. I suggest you created spline predictions via posterior_smooths and then do the comparison on a per-draw level before summarizing the difference scores via posterior_summary.