In this paper we shall propose a test of linearity of a median regression curve against an alternative of convexity. To be specific, we shall test $H_0: Y_i = \alpha + \beta X_i + \epsilon_i,\qquad i = 0, 1, \cdots, n,$ against $H_1: Y_i = \phi(X_i) + \epsilon_i,\qquad i 0, 1, \cdots, n,$ where $\alpha, \beta$ and $\phi$ are unspecified, and $\phi(x)$ is a nonlinear convex function. The basic assumption underlying the test is that the $\epsilon_i$ are independent identically distributed random variables with median zero and with a continuous density function $f(\epsilon)$ such that $f(0) > 0$. The $X_i$ are fixed and known. The test consists in estimating a line by the Mood-Brown procedure (using medians) from a central subset of the observations, making a weighted count of the number of remaining observations lying above the line, and rejecting $H_0$ if this number, $R_n$, is large. The test can easily be adapted to a one-sided alternative of concavity or to a two-sided alternative of either convexity or concavity. Section 2 is devoted to a discussion of the line estimation procedure, and in particular, the asymptotic distribution of the estimator is obtained under the null and alternative hypotheses. In Section 3 the $R$ test of convexity is introduced, the asymptotic null and alternative hypothesis distributions of the test statistic $R_n$ are obtained, and a formula for the asymptotic power is given. The test is shown to be consistent against twice differentiable convex alternatives. In Section 4 we obtain the relative asymptotic efficiency of the $R$ test as compared to the least squares test for parabolic alternatives with errors normally distributed, and make recommendations for the use of the test. Finally, in the Appendix, results of some Monte Carlo experiments used to investigate the small sample behavior of $R_n$ under $H_0$ are presented. The author is not aware of the existence of other tests of linearity against general convex alternatives. In the case where the alternatives in mind can be expressed in a linear regression scheme, both the least squares test and the median test suggested by Mood in  are possible competitors of the convexity test presented in this paper. The least squares test is to be preferred when errors are known to be normally distributed with common variance, but for more general types of errors there is at present no obvious way of determining a "best" test, and consequently the choice of test to be used in a given situation must be based largely upon subjective considerations.
"A Test of Linearity Versus Convexity of a Median Regression Curve." Ann. Math. Statist. 33 (3) 1096 - 1123, September, 1962. https://doi.org/10.1214/aoms/1177704475