Abstract Recent studies have shown that sectors defined by the denominational status and by the era in which schools were founded account for some of the variation in the effectiveness of schooling in Scotland. Other components of the total variation among schools can be attributed to variation in the social composition of schools, and to variation in the process and teaching characteristics of schools. The present paper complements these studies by considering other sources of intra‐system variation. In particular, it investigates variation in pupil‐attainment among different types of communities, and among educational authorities (EAs). It focuses on analyses of pupil attainment in fourth year Ordinary grade English and arithmetic, and on an overall attainment measured across subjects in the Scottish Certificate of Education (SCE) examinations. The effectiveness of schools is then assessed as the variation in pupil‐level attainment that is associated with schools, both before and after adjustment for pupil social background characteristics. The recently developed statistical technique of multilevel modelling is employed to model variation in the effectiveness of schools. This methodology has been developed in order to overcome some of the statistical problems that have bedevilled studies of the performance of schools. Its two main strengths are that it explicitly takes account of the multilevel nature of the information embodied in pupils’ examination results, and that it allows each school to vary in terms of its performance characteristics to a considerably greater extent than previous aggregate‐level methods. In analysing the variation among schools it is important to take account of the selective nature of school intakes, otherwise the apparent differences among schools may reflect no more than the variation in the quality of their intakes. The data available to the present study contain information on pupils’ social background characteristics, but not on their prior cognitive attainments. The selectivity of school intakes derives principally from two sources: variation in the residential pattern of socioeconomic groups, and voluntary choice of school. The data analysed here relate to pupils who entered their secondary schooling in the mid‐1970s before the Parent's Charter was enacted; thus voluntary choice of secondary schooling was constrained mainly to the independent sector. In addition to formal selection in relation to entry to the independent sector, the schools in the cities and large burghs were subject to informal selection through the creaming of their more able and socially advantaged pupils by the independent sector. The study attempts to control for some of the effects of these formal and informal selection processes by stratifying the analysis by the degree of selectivity of schools. Variation among schools in five types of community are investigated: cities, large burghs and towns, small burghs and towns, new towns, and rural areas. The cities account for about one‐third of all pupils in the system, while the two burgh sectors combined account for slightly more than half of all pupils in the system. Although the rural areas account for 10 per cent of pupils, they account for 17 per cent of the schools in the system, because of the smaller size of rural schools. The lowest performing community sector is the city sector, but it also contains the widest range of variation among its schools. The analysis of variation among EAs reveals that the median effectiveness of schools varies to a much smaller extent than the variation among schools, but that the assessment of EA performance is sensitive to the population of schools included in the analysis.