We extend the regression discontinuity design model to the case in which the line of best fit is replaced by a stochastic frontier. The method allows causality issues to be examined in a context where the performance measure is subject to inefficiency and where, in addition to the relationship between dependent and explanatory variables, there may be a discontinuity in the inefficiency measure at the break. The inefficiency scores are modelled as part of the system, but we follow a novel nonparametric approach. We illustrate the method with an application to data from Texas on class size and pupil performance, exploiting a Maimonides' rule discontinuity. We find that class size affects performance in the expected direction but that there is a corresponding effect in the opposite direction on efficiency. This may contribute to the difficulty experienced by the authors of earlier studies in identifying a class size effect.