Lets say I am estimating a linear regression with Y as a continuous DV and X as a binary IV. Based on theoretical reasons I am assuming that X has a positive effect on Y in the first quartile of the DV and a negative effect in the other quartiles. If I split the sample this assumption is confirmed.

How am I able to model this relationship without splitting the sample? Quantile regression has produced different results than the splitting of the sample. Are there any other options?

Thank you for your help.