We present a panel stochastic frontier model that handles the endogeneity problem. This model can treat the endogeneity of both frontier and inefficiency variables. We apply our method to examine the technical efficiency of Japanese cotton spinning industry. Our results indicate that market concentration is endogenous, and when its endogeneity is properly handled, it has a larger negative impact on the technical efficiency of cotton spinning plants. We find that the exogenous model substantially overestimates efficiency in concentrated markets