Shujie Ma, Jeffrey S. Racine, and Lijian Yang, "Spline Regression in the Presence of Categorical Predictors", Journal of Applied Econometrics, Vol. 30, No. 5, 2015, pp. 705-717.