Endogenous binary choice model with median restrictions