Essays On A Discontinuity Test Of Endogeneity