This paper develops a general framework for conducting inference on the rank of an unknown matrix \Pi_0. A defining feature of our setup is the null hypothesis of the form H_0: rank(\Pi_0)\leq r. The problem is of first order importance because the previous literature focuses on H_0':...