The re-emergence of educational inequality during a period of reforms: A study of Swedish school leavers 1991–2012

Against the background of a liberalization of Swedish compulsory education, this paper analyses post-1991 shifts in the way compulsory education performance in Sweden has been shaped by parental background, residential context and school context. We can document increasing school and residential segregation of foreign background students and, after 2008, increasing segregation by income, employment status and social allowance reception. Over time, educational performance has become increasingly linked to family, neighbourhood and school context. The greatest change has been for parental background, but the importance of school context and neighbourhood context has also increased. A noteworthy finding is that residential context consistently has a stronger effect on student performance than school context. Student grades were found to be most strongly influenced by the closest (12 or 25) residential peers of the school leavers as compared to larger peer groups. The increase in the influence of family, neighbourhood and residential context has been accompanied by a dramatic increase in the between-school variation (intra-class correlation) in student performance, but it was not until after 2005 that this increased variability became clearly linked to the social composition of the schools. This study’s results suggest that the restructuring of Swedish compulsory education has had consequences for equality, possibly because disadvantaged social groups have not been as able as advantaged groups to navigate and benefit from the educational landscape created by the school reforms.


Introduction
In the literature on educational inequality, Sweden has been singled out as an exception to a general pattern of persistent inequality (Gamoran, 2001). The reason for this is that Sweden during the 20th century managed to reduce the influence of socio-economic class on educational attainment: On the one hand, a general reduction in social inequality and, on the other hand, a quantitative expansion of the educational system that has made education less selective (Erikson and Jonsson, 1996). The period analysed by Erikson and Jonsson corresponds well with what has been seen as the most successful part of the Swedish welfare state era, closely connected to the political programme of the Social Democrats. Post-1990 trends, on the other hand, have been influenced by welfare state retrenchment and neoliberal inspired reforms that in many ways have implied a reversal of earlier policies in Sweden (Lundahl, 2002).
The restructuring of the Swedish school system is a prominent feature of these post-1990 trends. The aim of these reforms, implemented after 1992, has been to provide more competition, as well as higher quality and a higher degree of market control (Wiborg, 2013). Moreover, the reforms have established what has been described as a 'quasi-market' (Alegre and Ferrer, 2010;Lundahl, 2002). School vouchers, school choice and private stakeholders in independently run schools are important elements of the new policy (Bunar, 2010). In terms of possibilities for school choice, Sweden is not a unique case in the Nordic context. Denmark had school choice also before 1990, and in Finland possibilities for school choice have expanded in the 2000s, especially in the Helsinki metropolitan area (Bernelius and Vaattovaara, 2016;Lundahl, 2016;Rangvid, 2007). However, in Nordic research the Swedish school system has been seen as a benchmark in neoliberalization since Danish, Norwegian and Finnish school systems are not as liberalized (Bernelius and Kauppinen, 2012;Brattbakk and Wessel, 2013;Fekjaer and Birkelund, 2007;Kauppinen, 2008;Wiborg, 2013).
In addition to liberal reforms, the post-1990 period has seen a transformation of the European as well as the Swedish population, with a large increase and a changing composition of the foreign-born population  as well as an increase in income inequality (Hedman and Andersson, 2015).
Against this background, the overarching aim of this paper is to analyse if progress towards reductions in educational inequality that were reported for Sweden up to the 1990s has been endangered by increased opportunities for school choice, increased social inequality and a changing population composition. Our study will build on the existing literature of inequality in educational opportunities by specifically analysing changes in the way parental background, residential context and school context influence educational performance in Sweden during the 1991-2012 period. We will focus on school grades given to students at the end of Sweden's nine-year long compulsory education (ages 15/16). This implies that we will focus not on how educational inequality is produced by differences in transition rates to higher level of education but rather on the extent to which differences in educational outcomes are shaped by inequalities in parental background, social and ethnic school segregation, and social and ethnic residential segregation.

Theoretical considerations
In the sociological literature there has, since Coleman (1966), been an ongoing discussion about factors that influence educational inequality (ethnicity, socio-economic factors and school reforms) (Jackson et al., 2012;Lareau, 2011). Erikson and Jonsson (1996) point to two mechanisms: on the one hand, the transmission of academic skills and attitudes; on the other hand, the way in which students from different backgrounds are sorted into different types of education. Much work on the effects of class and family background on educational achievements also builds on the tradition of habitus and reproduction of class (Bourdieu and Passeron, 2008) and other works of sociologists (Breen and Jonsson, 2005;Palme, 2008). Middle-class parents raise children to negotiate the educational system using inherited skills and these children acquire ways of conduct and values for educational success (Barthon and Monfroy, 2010;Bourdieu and Passeron, 2008;Forsberg, 2015;Reay and Ball, 1997).
While there is a general agreement that parental background is the most important factor, there is less agreement on the extent to which schools influence inequality (Downey and Condron, 2016), or on the role of neighbourhood context for shaping inequality (Br€ annstr€ om, 2008;Sykes and Musterd, 2011).
Theoretically, our analysis of how parental background, school context and residential context shape educational outcomes, and how educational and societal changes since 1990 have strengthened or weakened the reproduction of educational inequality in Sweden, will build on ideas put forward in the effectively maintained inequality approach to educational inequality. Thus, as Lucas (2001) argues, once a 'level of schooling becomes nearly universal . . . the socioeconomically advantaged seek out whatever qualitative differences there are at that level and use their advantages to secure quantitatively similar but qualitatively better education' (1650). Lucas's main interest is, admittedly, in transitions to different curricula and this can be seen as limiting the applicability of the effectively maintained inequality framework to our study. However, since grades given in year 9 serve as an instrument by which admittance into different upper secondary school programmes is regulated, it can be argued that they not only reflect the innate ability, but are also reflecting strategies used by parents to ensure that children will get grades that will make them eligible for educational tracks that are seen as advantageous.
The need for such strategies has increased as a consequence of the transformed educational landscape that Swedish parents are facing. In the year 2000, only 3.2% of compulsory school graduates attended independent schools. In 2011/2012, the end of our period of study, the percentage of students leaving independent compulsory schooling was 14.6% (Skolverket, 2017). To attract students, most schools, both public and independent, advertise themselves as pedagogically specialized. The profiling includes focusing on specific school subjects (sports, language, media, etc.), using specific pedagogical methods, or being based on particular religious orientations. Independent schools are voucher financed per student from the municipality but have to obey the national regulations for education. To summarize the reform discussion in relation to concerns about segregated schools, the law requires equal education in every form of schooling and equality in access to education independent of geographical location and socio-economic status (Gorard and Smith, 2004;Regeringskansliet, 2010).
Effectively maintained inequality can also provide a tool for understanding parental support for school choice (Malmberg et al., 2014) since it provides a means by which qualitatively better educational alternatives can be accessed within a framework of universal education. More generally, not only school choice but also the selection of residential neighbourhoods (Holme, 2002;Poupeau et al., 2007) could be considered as means by which 'socioeconomically advantaged actors secure for themselves and their children some degree of advantage wherever advantages are commonly possible' (Lucas, 2001(Lucas, : 1652. Our study will add to the literature in two ways. First, we will add to the analysis of how school choice and other liberal educational reforms affect educational inequality (see, e.g. € Osth et al., 2013;B€ ohlmark et al., 2016;B€ ohlmark and Lindahl, 2015;Byun and Kim, 2010;Forsberg, 2015;Liu and Apple, 2016;Saporito and Sohoni, 2007;Van Zanten, 2005) by providing a long-term perspective. Our contribution is not to demonstrate causal effects of neoliberal educational reforms, but instead to provide evidence of long-term trends in educational inequality for a case where ambitious neoliberal educational reforms have been carried out in a systematic way.
Second, differences in residential context are acknowledged as one of the drivers of educational inequality in the literature (Erikson and Jonsson, 1996;Gamoran, 2001). Having access to detailed geo-coded individual level register data for an entire national population makes it possible for us to measure the residential context of Swedish compulsory school students in a very refined way, and thus, to provide new insights into the role played by residential segregation for differences in educational outcomes. By adding neighbourhood context to the school context, we get a better coverage of the time spent by students on different every-day activities (Kwan, 2012). We also argue that with improved measures it becomes possible to capture effects from school context and residential context simultaneously (Harris et al., 2007;Lubienski et al., 2009;Singleton et al., 2011).

School effects and neighbourhood effects
As for school effects, they are often called class or peer effects and thus indirectly originate from peers' parental background (Hanushek et al., 2003) and they differ between schools since children are sorted into different schools depending on school choice, residence, profiling, etc. Reasons for sorting differ by school system but can result in effectively maintained inequality according to theory (Marks, 2013). If school choice was performed equally across families and based on school quality there would not be sorting from the school choice process. Unequal school choice has also been confirmed in different empirical studies (Andersson et al., 2012;Butler and Hamnett, 2010;Maloutas, 2007;Or ıa et al., 2007).
Another reason for school effects is underlying residential segregation that casts its shadow over neighbourhood schools. Despite having school choice, many students go to the school closest to home. In addition, the status of a surrounding neighbourhood will influence the reputation of the school (Bunar and Ambrose, 2016). For a Swedish study and overview of school peer effects, please see Nordin (2013).
The theoretical inspiration for neighbourhood effect studies is built on concepts such as collective efficacy, institutional resources, stigmatization and norms (Ainsworth, 2002;Friedrichs, 2016;Leventhal and Brooks-Gunn, 2000;Sampson, 2012) and, thus, is markedly different from the theoretical frameworks that underlie studies of school effects. Still, the assumed correlations can be similar. Usually, high socio-economic status in the neighbourhood is associated with advantageous educational outcomes, while low neighbourhood socio-economic status is associated with poorer educational outcomes in youths (Andersson and Subramanian, 2006;Brattbakk and Wessel, 2013;Leventhal and Brooks-Gunn, 2000).
Since neighbourhood effects research has its roots in concerns about the consequences of segregation, the aspect of race and ethnicity has been an important factor in explaining grades, particularly in the United States. Minorities such as Latinos and African Americans are analysed with respect to educational outcomes (Caughy et al., 2013;Wilson, 1987). In Europe instead, multi-ethnic and foreign-born dominated areas are found to be negative environments for youths' education (Andersson and Malmberg, 2015;Brattbakk and Wessel, 2013) but the opposite of producing positive effects on education is also found (Fekjaer and Birkelund, 2007).
Moreover, in the neighbourhood effects literature, an important issue is the extent to which measured effects of residential context constitute causal effects (Spielman et al., 2013;Van Ham et al., 2012). Recent studies have shown that selection into neighbourhoods influences estimated contextual effects, but not the extent to which non-adjusted estimates become un-informative. Thus, based on a rigorous research design, Chetty and Hendren (2016) conclude that up to 80% non-adjusted contextual effect estimates can in fact be causal. Our aim in this study, however, is not make a contribution to the debate about selection effects and causal effects. Instead we want to test if more refined measures of context give more statistically precise estimates.
In spite of the fact that both schools and neighbourhoods have a potential for influencing educational outcomes, there are relatively few studies that include measures of both residential context and school context. One reason could be that neighbourhood effects are seen as mediated through the school or that residence is seen as decisive for the inclusion/exclusion in different contexts, be they neighbouring adults, peers, schools or the community (Kauppinen, 2008;Leventhal and Brooks-Gunn, 2000). Another explanation could be that students sampled from school registers can lack good data on student's residential context, whereas students sampled in neighbourhoods lack good data on student's school context.
Studies that have assessed both school context and residential contexts report that the school environment is of greater importance than the residential area (Br€ annstr€ om, 2008;Kauppinen, 2008;Sykes and Musterd, 2011). This could 'point to schools as a pathway through which the influence of the neighbourhood may be transmitted' (Sykes andMusterd, 2011: 1307) even if this conclusion is contradicted by Bergsten (2010) and Nieuwenhuis et al. (2019). However, it could also be the case that measures of neighbourhood context that are based on aggregates for fixed geographical subdivisions such as census tracts fail to capture the relevant residential context correctly (Andersson and Malmberg, 2015).

Data and study design
In the analysis we used data from Statistics Sweden via Micro data on line access in the Geographical context-project at Stockholm University. The data included longitudinal individual micro data in Swedish registers including geo-coordinates (Statistics Sweden, 2015). The total number of students ending grade 9 during the 22 years was 2,356,695. However, due to missing data regarding family background foremost due to missing family identifying numbers, the loss of students was between 6 and 13% during the period from 1991 to 1997. This loss decreased to 5% in 1998, and between 2001 and 2012 the loss of data each year was below 2%. Thus, pre-1998 results should be considered with some caution.
Below we present the dependent variable -grades when leaving compulsory school. After that, individual, school and peer context variables are presented. As explained below, we use eight different socio-demographic indicators to capture different type of influences on grades. Each of these indicators is measured both on the individual level, on the level of schools and on the neighbourhood level. All variables can be found in Table 1. All variables (except grades) are collected at the end of December, the year before students graduate from the ninth grade.

Dependent variable
The student grades in year 9 are summarized into one value, and on the basis of this summarized value, students enter upper secondary school. However, before year 9, there is not as much student selection as in upper secondary school or for that matter university, and, from 1994, every student follows the same curriculum, though with some teaching done in ability-based groups (Rudolphi and Erikson, 2016). According to Bourdieu and Passeron (2008), much greater selection of students occurs at the later stages in the school system, which is difficult to control for in analyses of outcomes. Since student grades in year 9 are given at the end of compulsory education we believe that such selectivity is less of a problem in the present study. There was an important reform in 1994 having effects on the students graduating a few years later. There was a shift from a grading scale of 1-5 to another with a maximum of 320 credits (adding 0, 10, 15 and 20 for different subjects). Therefore, we use the percentile rank of the grade of the students that year instead of the grade as the variable.
The student with the highest overall grade was given the value 1.0 while the student with the lowest overall grade was given the value 0.0. Grades are reported in June.

Individual level data
As individual controls, we included the individual's sex, country of birth, whether the parents have social allowances, tertiary education, whether parents are non-employed and whether they live in single parent households. Furthermore, we included individual controls for foreign-born parents, the family's disposable income and whether they live in single family housing (see Table 1).
In earlier research, female students usually achieve better in school in Sweden, whereas students with parents on social allowances, who have parents born abroad or who have single parents usually get lower grades (Andersson and Subramanian, 2006). Furthermore, students with parents having tertiary education perform better in school than their counterparts, as do students with high income parents and students living in single family housing. On the other hand, variables such as parental non-employment and students born abroad are likely to affect students negatively concerning educational achievements (Andersson and Malmberg, 2015).
Of the students in our sample, about 60% lived in single family housing. Girls and boys are evenly represented in the material and further tertiary education among parents rises from about 30% in 1991 to more than 40% of parents in 2012. Over the years, the proportion of parents who are foreign-born increased, as did the proportion of single parent households. The average percentile for the parents' disposable income in relation to the rest of the Swedish population remained unchanged during the study period, except for the variation due to the change of equalizing weights for children when constructing the variable after 2004.

School level data
The school population consists of students that have finished ninth grade (around 15 and 16 years old) every year. To cater for more than just that particular year's students, we included those finishing the ninth grade both the year before and after the particular cohort of students. For students finishing the ninth grade in, for example, the year 2000, not only students finishing the same year but also the students that finished ninth grade in the year before (1999) and the year after (2001) were considered as constituting the school context population (see Table 1). Students in schools with less 15 students (including the year before and after graduation) per school were excluded from the sample.
When estimating models for the effects of school composition on grades, there were indications of multi-collinearity for the school level variables. To address this, we extracted principal components to be used as explanatory variables instead of the original school context variables. Component 1 captured 52% of the total variance in the school variables and Component 2 captured 18% of the variance. With respect to parental income and tertiary education, Component 1 has negative loadings and Component 2 has positive loadings. This implies that schools that rank high on both components or rank low on both components will have average levels of income and tertiary education. But the first type of schools will have high shares of foreign-born students and high shares of students with foreign-born parents (because of high loadings in these variables for Component 1). An alternative could have been to remove some of the school level variables, but then the symmetry in variables used for the different levels would have been lost.

Neighbourhood level
The population in the residential neighbourhood surrounding each 15-year-old student is defined in this study as the peers aged 13-17 years (in the beginning of the year) who live closest to the student (see Table 1) (Kallus and Law-Yone, 2000). This implies that the population of residential peers is about five times larger than the number of students used in the regression for each year. Tests with alternative measures indicate that the result reported below would essentially be the same if all neighbours, not only peers, had been used to calculate the socio-demographic composition of the neighbourhoods (compare Å slund et al., 2011). With a multiscalar approach, we have been able to gradually expand the neighbourhood from the 12 closest peers (k ¼ 12) to the 800 closest peers (k ¼ 800) for every individual (Fowler, 2018).
We found that models using lower k-values had less remaining variance, that is lower À2Âlog likelihood values (see Orloff and Bloom, 2014). For all the 22 years, the best fit (lowest À2Âlog likelihood values) was for either k ¼ 12 or k ¼ 25. This suggests that contextual influences are strongest for those k-values. Because of this and the theoretical motivations mentioned above, we have chosen to use contextual measures based on k ¼ 25 to evaluate the effect of residential context on educational performance. Using aggregates for fixed geographical subdivision, so-called SAMS areas, does not, however, substantially change the results.
It can be noted that choosing k ¼ 25 neighbourhoods implies that the measure of residential context is based on a smaller sample than our measure of school context. In the residential context, the number of exact age peers is five (on average), but the number of exact age peers in the school is around 60 (on average). This implies that one can expect the variance in residential context variables to be larger than the variance in school context variables.

Multilevel regression models
The data are analysed using a multilevel regression approach that takes into account that students are nested in schools. The neighbourhood level is more complex with individualized neighbourhoods. In principle, it is possible for each student to have a unique residential context. However, on average there will be some overlap and this might induce an underestimation of the standard errors if we assume independent observation. Nonetheless, even in a 'worst case' scenario where all students share neighbourhood with same year born (not all peers) this would not make the standard errors too large since they, in most cases, are very small in the estimated models. This test of standard errors and the complexity with the individualized neighbourhoods made us restrain from running a cross-classified multilevel  model. We acknowledge this problem in our analysis but we have not been able to find earlier research that solves the problem of adjusting the standard errors in cases like this. For each studied year, seven different models are estimated, starting with an empty model, followed by a model with individual and parental level variables added, and then five models with different combinations of contextual variables included (see Table 2 for a detailed specification of the models). The structure of the models and an illustration to explain the parts of the model are shown in Figure 1. By building models for each year separately, we are able to see how the parameter estimates change over time. Table 2 shows the seven multilevel regression model types, exemplified with the year 2012. By adding controls for each of the levels in our models, there is an increasing goodness of fit. This can be read from the log likelihood and Akaike information criterion (AIC) values for the year 2012 in Table 2. Compared to the empty Model 1, individual level variables in Model 2 decrease the log likelihood values and AIC importantly, as do controls added in Models 3, 4 and 5.

Multilevel models
Model comparisons using AIC. In order to compare the relative importance of parental background, school context and residential context, we rely on a comparison of À2 Â log likelihood values for the empty model (Model 1) and the models including individual level and different sets of contextual variables. We base this use of À2 Â log likelihood values on Menard (2000) who, building on Nagelkerke (1991), argues that Here, L 0 is the value of the likelihood function for the model containing only the intercept, and L M is the value of the likelihood function for the model containing all of the predictors.
To adjust for the number of parameters estimated, Figure 2 presents the AIC values for Models 1-5 and how they changed between 1991 and 2012. The AIC is equal to the À2 Â log likelihood value adjusted for the number of parameters estimated. Figure 2, upper panel (as well as Table 2, for 2012), shows the AIC for the empty model (Model 1) and for the models with different controls (Models 2-5). As can be seen from the reduction in AIC, it is the introduction of parental background controls (Model 1 compared to Model 2) that adds most to the explanation of student grades. Adding controls for school context and residential context has a comparatively small effect on how much is explained. Figure 2, upper panel also shows that in 1991 about half the variation in student grades as measured by the AIC was left unaccounted for when the controls were included (distance in graph below Models 2, 3, 4, 5). In 2012, by comparison, only about one-fifth of the variation in student grades was still unaccounted for when the controls were included. This suggests a strong increase in the influence of parental background on school performance between 1991 and 2012. Figure 2, lower panel, shows the AIC values for Models 3-5 (parental background, school context and residential context controls) expressed as differences from the AIC of Model 2 (only parental background control). Model 3, with school level controls, shows a decrease in AIC compared to the model with individual level controls. Interestingly, for our study, there is a further decrease when peer residential context is added (Model 4). That is, even when controlling for school level context, residential context adds explanation to the variation in grades among students. Finally, Model 5 shows that a model with only residential context and no school context included outperforms Model 3, that is a model with only school context and no residential context. This is true for the entire 1991-2012 period, but the difference is especially large in the period 2000-2005. Summing up, the important result from comparing AICs is that models including the peer residential context do a better job of explaining grades than the model including school context alone. This contradicts earlier results where school and residential contexts are compared as regards their importance for educational performance (Br€ annstr€ om, 2008;Kauppinen, 2008). One reason for this result could be that with k ¼ 25 neighbourhoods, there will be higher variance in the residential context measure compared to studies using larger statistical areas. For example, the reduction of log-likelihood decrease in average 182 when going from k ¼ 25 to k ¼ 200 in Model 4 and for some years, the difference in log-likelihood between Models 3 and 5 is smaller than this difference. That is, if larger neighbourhoods had been used then we could have had results more similar to Br€ annstr€ om. On the other hand, higher variance as such would not result in a reduction of model log-likelihood unless the context variable is of importance.
As noted above, individual level variables (Model 2) make by far the most important contribution to explaining students' grades. However, the explanation added by Models 3, 4 and 5 is important to consider and there is also a pattern of increased importance for school context and residential context over the years, evidenced by larger declines in the AIC values compared to Model 2 with only the parental background control. The AIC values also suggest that school socio-economic context was relatively unimportant before 2006 but increased in importance after 2006. However, this does not change the fact that, judged by the AIC value of Model 5 compared to Model 3, the residential context measured by the 25 closest peers with families is more important for grades than school context. Parameter estimates. The parameter estimates for the parental background, school context and residential context variables are presented graphically in Figure 3 and with statistical details in Table 2 (only for 2012). Table 2 shows that the estimates for individual level controls are significant and have the expected signs. Being foreign-born as a student has a significant negative effect on grades. Read from Table 2, the negative estimate is .045 for foreign-born students, which means final grades that are 4.5 percentile points lower than average (Model 2). Negative effects are also found for parental social allowance and non-employment as well as for having single parents as a student. Figure 3 shows changes in these parameter estimates over time. Thus, over the 1991-2012 period there is a strong increase in the positive effect on students' grades of having high income parents (1991 estimate (0.060; 95% CI: 0.05, 0.069); 2012 estimate (0.162; 95% CI: 0.155, 0.170)), and the negative effect of having a single parent decreases over time (1991 estimate (À0.056; 95% CI: À0.061, À0.051); 2012 estimate (0.029; 95% CI: À0.033, À0.025)). The increase in the positive effect of having high income parents started already before the change in variable definition after 2004 (see 'Data and study design' section) and continued after the change. Therefore, the increase could not be attributed to the change in variable definition. Figure 3 also shows the parameter estimates over the 22 years (x-axis) for Model 4 with school context and neighbourhood peer context variables added, and for Model 7 with school context measured using principal components. Statistical details for these estimates are provided in Table 2 (only year 2012). Figure 3 clearly shows that estimates are smaller for neighbourhood peer context (lowestrow diagrams) than for school context (middle-row diagrams). They are also more stable over time. The lower size of the neighbourhood context can be related partly to the estimates' larger variance. This comparability problem was tested with beta-values, that is parameter values adjusted for the standard deviation of the variables. The difference in beta-values is still large between neighbourhood and school context variables but the difference is smaller when standard deviations are adjusted for. However, adjusting for the standard deviation does not reduce the volatility of the parameter estimates of the school context variables. One interpretation of this volatility is that there is multi-collinearity. Compare, for example, the estimates for income and education in the school. Here there is a pattern that high positive parameter estimates for income are associated with low and even negative estimates for education.
The level of education in the residential neighbourhood has a positive effect on the grade of the student. This is also the case for parental income among the closest living 15-yearolds, with a drastic increase after 2004. Having peers with single parents or peers with social allowances is from time to time negatively associated with grades over the period. Note that the standard errors are not adjusted for possible spatial autocorrelation.
The volatility of the school context variables is a little perplexing but it is possible that there is a relation between this volatility and the failure of school context variables to account for the increase in between-school variance up to 2006 (referring to intra-class correlation (ICC) in Figure 4). Of particular interest here are the negative estimates for parental education level up to 2008.
In addition, Figure 3 presents parameter estimates for models where principal components are used to measure school context. These models are not as good at explaining the variance in grades as the models that use nine school level variables. As can be seen from Figure 3, the estimated parameters for Factor 2 (Component 2) that is linked to high income and many parents with tertiary education change over time: from weakly positive in the first years, to negative in the mid-1990s and early 2000s, and finally to positive in the last years. Thus, it is only in 2006-2012 that we see the expected positive link between a favourable social composition of and educational outcomes.
The individual level parameter estimates are presented in the top diagrams of Figure 3 and show much less of the volatility in the school context parameters. However, there is an increase in the estimates for parental disposable income over the period and fewer negative estimates for single parents over the period (Figure 3). Furthermore, income and education show the two most interesting trends in Figure 3. Parental education decreases in importance for the outcome of the grade (perhaps because an increasing proportion of the students have parents with higher education, which makes it a less exclusive measurement). Interestingly, the disposable incomes of the household have an increased importance for the outcome. ICC for schools. The top line in Figure 4 shows how the between-school variance in final grades, measured as the proportion of total variance (ICC), changed between 1991 and 2012. What is shown here is a steady upward trend in the variation in grades between schools, and the results confirm earlier findings both in studies using student grades and test results ( € Osth et al., 2013). Figure 4 also presents variation at school level by year, for the model with controls for individual level (2), school level (3), residential peer context (4) and for residential peer context excluding school level variables (5). What the graph shows is that up to 1998, very little of the ICC/variance in grades can be explained by individual level variables, school context or residential context. This can be read in the graph as almost no difference between the empty model's top line and the other lines. In 2005, individual level variables still explain some variance in grades but note also that a smaller proportion of the betweenschool variance can be explained by school level variables. After 2006, individual level factors explain an increasing share of the ICC (diff. between Models 1 and 2) and also the variance explained by school level variables pushes down the ICC/variation in the graph. Thus, in 2012, almost half of the explained between-school variance can be accounted for by individual level variables. The residential context factor (4) makes essentially no contribution to explaining the between-school variance; the Model 4 line including residential context is in fact covering the school level ICC (Model 5).

Concluding discussion
In this paper, we have raised the question of whether educational and societal changes since 1990 have strengthened or weakened the reproduction of educational inequality in Sweden. Looking at the results presented above, the effects of parental background, school context and residential context, there are clear signs of a school system that no longer has the same equalizing power as before. Most importantly, there has been an increase in the importance of parental background for student performance. In 1991, parental background accounted for about 52% of the variation in performance. In 2012, this proportion had risen to 76% (see Figure 2, upper panel). Thus, Swedish compulsory education today is less efficient in compensating for family background than it was before the liberalization of school choice. In addition to this change, the socio-demographic composition of students' residential neighbourhoods has also become more important for educational outcomes. In fact, based on an evaluation of difference in log likelihood between models, our findings indicate that residential context is a stronger determinant of student's grades in the final year of compulsory schooling than the socio-demographic composition of the school, and this result holds despite the fact that the effect of school composition on student's grades has increased over time. One reason why peer residential context is more important/explains more than student composition in schools could be that in schools, differences in peer composition can be mitigated by compensatory efforts by teachers and by need-based resources allocation. In neighbourhoods, such compensation efforts can be more difficult to implement.
Taken together, these results suggest that the restructuring of Swedish compulsory education, including many components, working reciprocally over some time, has had some negative consequences for educational equality. Thus, influences on student's school performance are increasingly located not in the school but elsewhere.
In many ways, the findings we present in this paper resonate with the results of earlier studies looking at the effect of liberalization on educational equality. This said, the contribution of this paper is two-fold. First, we have provided strong evidence that educational reforms in Sweden, not necessarily by themselves but in combination with other societal trends, have reversed a longstanding trend towards educational equality. Second, we have demonstrated that discussions about how educational inequality is created cannot be restricted to the direct effect of parental background and the effect of school factors. There is also, as our results have shown, a need to consider the role played by residential context and residential segregation in the reproduction of inequalities in educational outcome.

Declaration of conflicting interests
The author(s) declared no potential conflicts of interest with respect to the research, authorship, and/or publication of this article.

Funding
The author(s) disclosed receipt of the following financial support for the research, authorship and/or publication of this article: We acknowledge financial support from the Swedish Research Council