Brms hypothesis test for term in interaction by condition


#1

Probably a basic question, but say I have a model Y ~ X1*X2 and both X1 and X2 are continuous. How would I do a directional hypothesis test for the effect of X1, conditioned on the predictor X2 being some arbitrary value, e.g., X2 = 2?


#2

Just plug in 2 for X2 (or whatever value) when computing your predictions.


#3

Using the predict function? If so, how do I then test the hypothesis (e.g., that the effect of X1 > 0)?


#4

If X2 = 2:

hypothesis(<model>, "X1 + X1:X2 * 2 > 0")

#5

Of course, that’s beautiful and simple! Thank you.