Investigations of the effects of schools (or teachers) on student achievement focus on either (1) individual school effects, such as value-added analyses, or (2) school-type effects, such as comparisons of charter and public schools. Controlling for school composition by including student covariates is critical for valid estimation of either kind of school effect. Student covariates often have different effects between schools than within schools. Econometricians typically attribute such differences to a form of endogeneity, specifically, Level-2 endogeneity, or the confounding of student covariates with unobserved school characteristics, whereas education researchers primarily interpret the differences as contextual effects or the effects of collective peer attributes on individual student achievement. This article considers both and makes connections between the econometric and education research literatures. We show that the Hausman and Taylor approach from panel data econometrics can be used for valid estimation of individual school or school-type effects when there is only Level-2 endogeneity but can lead to bias when there are also contextual or peer effects. In contrast, contextual effects are typically estimated by including school means of student covariates in addition to the student-level covariates (equivalent to the Mundlak device), but this leads to biased school comparisons in the presence of Level-2 endogeneity. We interpret the estimates from these two competing estimators in terms of the Type A and Type B school effects defined by Raudenbush and Willms and show that both estimators are preferable to the common group-mean-centering approach.