The objective of this paper is to assess the determinants of student achievement in middle schools in Ghana, with special attention given to school characteristics. The paper presents a model of human capital accumulation which includes decisions on how long to attend school, which school to attend, and how much human capital to accumulate. This provides a framework of control for selectivity into middle schools, which is often ignored in the human capital production function literature. The paper also accounts for the fact that many children attend school only sporadically, which reduces their cognitive achievements, but according to the authors, is a rational response among credit constrained households. The paper then estimates for the cohort of children aged 12 to 18, the probability that they are in middle school, their choice of which middle school to attend, and the determinants of achievement in reading and mathematics skills in Ghana's middle schools. In addition to specific findings regarding which school characteristics contribute to such achievement, the paper finds some evidence indicating that households in Ghana suffer from credit constraints and fairly strong evidence that sample selectivity is taking place and hence may distort estimates that do not account for it.