School climate and delinquency – on the significance of the perceived social and learning climate in school for refraining from offending

Abstract School is regarded as a central arena for crime prevention. This study analyses the effects of student perceptions of school contextual aspects on self-reported offending, using logistic regression with control for clustering effects. The data comprise a census of pupils in year nine in comprehensive school (15 year olds) and in year two of upper secondary school (17 year olds) in the City of Stockholm in 2006, 2008 and 2010 (n = 25,850 of which 47% are boys and 53% are girls). Besides showing that several aspects of students’ perceptions of the school setting have direct protective effects on offending, the study shows that perceiving schoolwork as meaningful appears to moderate the effect of adverse home conditions on delinquency for boys. The only aspect of school investigated in this study that was not significantly related to offending was the perception of classroom order, indicating that emotional support from teachers is more important for crime preventive implications than maintaining order in the classroom. Controlling for clustering effects shows differences in offending between classes and schools that are not produced by differences between the students.


Introduction
Research identifying factors that may increase or decrease the risk for youth crime is central to criminology. This knowledge is regarded as important to our general understanding of why youths commit offences, and to prevent the early initiation of delinquent involvement. From the perspective of possible interventions, however, it is difficult to draw conclusions about preventive measures, since many risk factors are such that it is difficult, if not impossible, for social institutions to influence them. Adverse family conditions in the form of low socio-economic status and/or an unfavourable psychosocial situation -such as low parental education, parental unemployment and alcohol problems in the family (Agnew & Messner, 2015;Catalano & Hawkins, 1996;Farrington & Welsh, 2007) -constitute examples of wellestablished risk factors of this kind. These are conditions that can only be changed by means of broad socio-political measures. Nor is it easy to orient oneself among the complex factors that are continuously being added to by the risk-factor research. Problem behaviours in youth are described as a consequence of complex interactions among a large number of factors that affect youths' lives on different levels and at different times (Agnew, 1992;Catalano & Hawkins, 1996;Farrington & Welsh, 2007;Laub & Sampson, 2006;Thornberry, 1996).
The current study highlights the interplay between risk and protective factors for delinquency. Logistic regression is employed to study the interaction between a set of potential protective factors in school (Rutter, Maugham, Mortimore, Ousten, & Smith, 1979;Sampson & Laub, 1993) and a number of established risk factors identified by criminological research (Agnew, 1992;Merton, 1938).
School is often described as a central arena for crime prevention, in part because youths spend a great deal of time in school and in part because of the expectation that good childadult relationships in school can compensate for dysfunctional relationships with adults at home (Vinnerljung, Brännström, & Hjern, 2012). Teachers and other school staff have increasingly been assigned a major responsibility for identifying problems that may be indicators of possible future criminality and other undesirable behaviour (Lab, 2014). They are further often assigned a key role in the implementation of prevention programmes, a role that, according to Lab (2014), they have rarely been prepared for. When prevention measures focused on and implemented in schools have been evaluated, they have been found to have a relatively limited effect on crime (Lab, 2014). Research focused on factors that may increase the knowledge on how schools, purely by fulfilling their basic educational mission, may work even as protective and crime preventive institutions, is less common.

Purpose of this study
The objective of the study is to examine the potential protective 1 effects on offending of five components of school that are already inherent in the school setting. These are related to Rutter et al. (1979) theory on effective schools and Sampson and Laub's (1993) informal social control mechanisms concerning the importance of perceived positive relationships between students and teachers and students' attitudes towards the school setting. The components are labelled (1) Encouragement and communication, (2) Meaningful schoolwork, (3) Clarity and participation, (4) Grades/performance and (5) Classroom order.
More specifically, the study examines whether students' perceptions of their school setting can contribute to a decreased risk for offending, or have a moderating effect on the propensity to commit offences, given the risk of exposure to some of the most well-established family-related risk factors. Since the data are hierarchically structured (students are nested in classes, and classes are nested in schools), the analyses take this structure into account by controlling for clustering effects. This approach also makes it possible to examine whether there are any school-or school class-related variation in youths' offending propensities, which will further improve the understanding of the significance of the school setting for delinquency. Due to the gender differences in self-reported crime in general and to gender differences found in the desistance literature 2 (Broidy & Agnew, 1997;Giordano et al., 2002), females and males are studied separately.
The study can yield preventive implications, since improved knowledge of the significance of the perceived school setting for youth crime shifts the focus from factors related to individual characteristics towards mechanisms associated with a social institution that is possible to develop.

On protective factors and how they are used in this study
The risk factor concept originated in epidemiological research and was subsequently adopted by social and behavioural scientists in order to study social phenomena. Risk factors have been defined as conditions linked to individual characteristics, interpersonal relationships or social circumstances that increase the risk for unwanted outcomes (Farrington & Welsh, 2007;Loeber, Farrington, Stouthamer-Loeber, & Raskin White, 2008). It is important to note that a single risk factor often produces a limited increase in risk, whereas several adverse conditions operating together tend to increase the risk more substantially.
Elements from a range of theories of youth crime have been combined to produce integrated explanatory models, such as Catalano and Hawkins (1996) Social Development Model, originally based on a combination of social bonding theory (Hirschi, 1969) and social learning theory (Akers, 1973). Such models reflect the complex interplay between individual conditions, characteristics and experiences, and factors in the surrounding context. On the other hand, researchers who have studied crime from a life course perspective have argued that the sum of all the factors that influence the development of our behaviours -individual differences, environmental differences, social interactions and random factors -tend to result in a relatively jumbled and unpredictable process of development (Laub & Sampson, 2006).
Despite its dynamic character, Catalano and Hawkins' theoretical model, and the ambition to take a comprehensive range of risk and protective factors into account, has been criticized for being speculative and for not providing a proper basis for making predictions (Case & Haines, 2009). This might be due to the fact that all-inclusive explanatory models of this kind aim to be universally applicable, claiming to explain the development of all deviant behaviour at a general level. Instead, the current study focuses on the extent to which a limited set of underlying risk factors potentially can be counteracted by specific protective factors in school in their prediction of delinquency.
The content of the concept of protection is more complex than simply the absence of risk (Rutter, 1987). According to Lösel and Farrington (2012), there is no uniform terminology in this area. One key question in the research on protective factors is that of defining what constitutes a factor of this kind, and what it is that distinguishes a protective factor, both conceptually and empirically, from a risk factor (Krohn, Lizotte, Bushway, Schmitt, & Phillips, 2010). Rutter (1985) proposed that factors may be defined as protective if they differentiate between individuals who are at relatively high risk of experiencing the undesirable outcome, but where the actual outcome for the one turns out to be 'unhealthy' and for the other 'healthy' . Defining protective factors in this way maintains the conceptual and empirical distinctions between risk and protection. This study in part examines whether school-related factors have protective effects on the population as a whole, and in part whether they produce a compensatory 3 effect, i.e. if the factors have more significance for the 'at risk' group than for the others. In this study, therefore, protective factors will be viewed as independent variables which may in part have their own effects on the outcome but which may also function as moderators between risk and outcome. The latter would require the protective factor to interact with the risk factor in a way that leads the effect of the risk factor on the studied outcome to become substantially reduced or completely eradicated (Krohn et al., 2010).

Adverse family conditions as a source of risk
The factors investigated in this study as a source of risk are derived from classic and general strain theory (Agnew, 1992;Merton, 1938), which states that some of the most influential risk factors are linked to the family. In particular, the family's socio-economic conditions (Merton, 1938;Nilsson & Estrada, 2009) and young people's relationship with their parents (Agnew, 1992;Farrington & Welsh, 2007) have been put forward as crucial in this respect. Although the relationship between adverse family conditions and offending often is said to be mediated by other factors, for example the subjective judgements of these conditions (Agnew, 1992;Agnew & Messner, 2015), few criminological perspectives question the direct or indirect impact of family factors on later offending. Instead, poverty and dysfunctional family backgrounds are what longitudinal criminological research most often show that both males and females with a long history of crime have in common (Giordano et al., 2002). These kinds of family-related risk factors are also likely to have become established prior to the potential protective exposure in school, which suits the cross-sectional nature of the present study well.

The significance of the perceived social and learning climate in school
The focus on protective factors in the current study is in need of an additional theoretical framework than strain theory, since strain theory focuses explicitly on poor opportunities and on negative relationships with others (Agnew, 1992). The aspect of student attitudes towards school investigated in this study draws in part from theories of informal social control (Sampson & Laub, 1993), and in part from Rutter's classic ideas on the aspects in the social school climate that contribute to what he calls effective schools. In contrast to strain indicators, these dynamic theories instead focus on significant positive relationships with conventional institutions and significant others that, according to life course criminology, are hypothesized to change negative pathways in life. Perhaps the most well-tested theory on the relationship between school and crime is Hirschi's (1969) theory of social bonds. An extended version of Hirschi's informal social control with a more dynamic and positive approach is given by Sampson and Laub (1993), who among other things state that the effects of structural and individual opportunities in childhood on crime are mediated by interpersonal aspects in school during adolescence. According to Sampson and Laub (1993), school is one of the most important agents of informal social control during adolescence. School is also one of the first and most important social institutions in the concept of cumulative disadvantage. Here Sampson and Laub (1997) adopt arguments from the labelling perspective to describe the process in which the individual becomes more marginalized from the conventional society, which in turn increases the likelihood of offending. Several studies have shown that good school performance, attachment to school and involvement in school have a crime preventive effect (Fagan, Van Horn, Hawkins, & Arthur, 2007;Lösel & Farrington, 2012;O'Donnell, Schwab-Stone, & Muyeed, 2002;Ring & Svensson, 2007). Measures focused on attachment to and support from teachers have also been found to counteract the propensity for crime among disadvantaged youth (Krohn et al., 2010;O'Donnell et al., 2002;Smith, Lizotte, Thornberry, & Krohn, 1995).
The view that school is the first and most important environment in which success and failure are measured and reinforced via interactions with teachers and peers is based on an assumption that school success is generally highly valued among young people. This has been confirmed in a classic study by Coleman (1966), which shows that parents from all social classes are very keen that their children should succeed in school. Moreover, minority youth and youth from lower social classes value school success more (Coleman, 1966) or at least as much as other youths. In spite of this, it is youth from the lower social classes that fail more often, and who are subsequently over-represented in recorded crime (Nilsson, Bäckman, & Estrada, 2013).
The concept of successful schools is based on studies of schools at which student performance is good despite their coming from an unfavorable social background. A large number of studies have shown that levels of crime and other undesirable behaviours vary between schools (Barton, Jensen, & Kaufman, 2010;Graham, 1988;Grosin, 2004;Op de Beeck, Pauwels, & Put, 2012;Olsson & Fritzell, 2015;Payne, Gottfredson, & Gottfredson, 2003;Rutter et al., 1979) and that successful schools manifest improved school results, declines in the prevalence of problem behaviours and reduced levels of drug and alcohol use (Gottfredson, 2001;Grosin, 2004;MacBeth & Mortimore, 2001). Rutter et al. (1979) argued that important elements in successful schools included an emphasis on academic success, a focus on praise rather than punishment, maintaining order in the classroom and having the students participate in the teaching. Indicators of successful schools have also been found to have a positive effect on the health outcomes of students in Sweden (Grosin, 2004;Modin & Östberg, 2009). In view of the theoretical framework above, the current study will focus on aspects stemming from students attitudes towards the school climate, the importance of academic success and relational conditions taking place in the school setting, factors closely related both to informal social control performed by teachers and indicators of successful schools.

Data
The data analysed in the study comprise three waves (2006, 2008 and 2010) of the Stockholm School survey, a census survey conducted by the municipality of Stockholm. The survey is conducted in virtually all schools administered by the City of Stockholm, among students in year nine in comprehensive school (15-year-olds) and in year two of upper secondary school (17-year-olds). The primary aim of the survey is to provide a basis for planning preventive measures for the social welfare administration in the municipality of Stockholm. A second purpose is to provide a basis for research and development in the fields covered by the survey. The survey consists of a total of 101 questions about individual background, family and school situation, alcohol, tobacco and drug use, criminal activities and victimization. The data collection and coding were administered by the Office of Research and Statistics on behalf of the Social welfare administration in the municipality of Stockholm. The questionnaires were distributed to the schools through a designated contact person in March and collected during April and May in each year. The students completed the questionnaires during lesson time, and returned them to their teachers in a sealed envelope.
The external non-response due to students absent from school and the internal nonresponse due to poorly completed questionnaires that have been removed from the data-set by the Office of Research and Statistics were estimated to comprise 22% of the study population in 2006, 18% in 2008 and 21% in 2010. 4 Following the removal of questionnaires that did not include information on all of the variables included in the analysis, the current study population comprises 25,281 students distributed across 1791 classes in 444 5 schools, corresponding to 64% of the pupils who attended a school in Stockholm municipality during the years in question (n = 39,550). The fact that the non-response is higher in the data-set being analysed compared to the total number of students who took part in the study is due to missing information on the variables analysed (in sum 13 variables each year). Respondents who lacked information on any of these variables were thus removed from the analyses.

Measures
Prior to the operationalization of the school factors and the outcome measure, factor analyses (described below) and reliability tests were conducted. The reliability tests are reported with alpha values following each operationalization and give information about the consistency of the measure. Cronbachs alpha varies on a scale from 0 to 1, where a value of 0 indicates that the measure consists of nothing but error and the value 1 indicates that there is no variable error at all (Frankfort-Nachmias & Nachmias, 1996).

Outcome measure on offending
All questions relating to self-reported offending were included in an exploratory factor analysis, 6 which resulted in the identification of two dimensions. The first was exclusively comprised of minor offences (such as fare-dodging, shoplifting and graffiti). This factor was excluded from the analysis in order to avoid including behaviours that are very common in the age groups examined, and thus relatively unproblematic. 7 Thus the dependent variable, offending was measured by means of a dichotomised index of those who, at least once during the past year, stated that they had: Forced someone to give them money, a mobile phone or something else valuable; stolen a moped or motorbike; stolen a car; broken into a shop, newsstand or some other building; sold something that had been stolen; bought something that had been stolen; stolen a bicycle; intentionally hit someone so that they think or know that the person needed medical attention; stolen something from somebody's pocket; or forced someone to have sex with them (α = .895). Students who stated having engaged in one or more of these acts during the past year were assigned the value 1, while the remainders were assigned the value 0. Although dichotomized outcome variables are associated with a loss of information, the offending outcome is so seriously skewed that analysing it by means of linear (Ordinary least square) regression is not an option. Thus, the choice of running a logistic regression on a dichotomized outcome rests upon the assessment that it is more advantageous, in terms of interpretability and being able to rely upon the results (Feng, Wang, & Lu, 2014).

Family-related independent variables
The parents' educational level was measured by the question: 'What is your parents' highest level of education?' with separate response alternatives for each parent: 'Compulsory schooling (at the most 9 years in school)' , 'upper-secondary school' , 'university or equivalent' and 'don't know' . The variable has four categories, with the reference category specified as students who have two parents with a university education. The other three categories are: only one parent has a university education, neither of the parents have university education, and a 'don't know' category. 8 Parental unemployment is measured using the question: 'What do your parents do? with separate response alternatives for each parent: 'works (full-or part-time), 'studying' , 'on leave/ parental leave' , 'unemployed' , 'other' and 'don't know' with no unemployed parent serving as the reference category.
Living with both parents is measured by the question 'Who do you live together with' , with those answering that they live with both parents serving as the reference category.
Alcohol problems in the family were measured by the question: 'Do you think that anyone in your family drinks too much alcohol?' with the response alternatives 'yes' , 'no' and 'don't know' . The 'don't know' category was excluded, while those responding 'no' serves as reference category.
Supervision was measured using an index constructed from the following three questions: 'Do your parents/guardians know where you are when you are out with friends in the evening?' followed by the response alternatives: 'always' , 'sometimes' , 'rarely' , 'never' and 'don't know' , 'Do your parents/guardians know which friends you spend time with during your leisure time?' followed by the response alternatives 'yes, all of them, 'yes, most of them' , 'yes, some of them' , 'no, none of them' and, 'don't know' and, 'Do your parents/guardians know what you spend your money on?' , followed by the response alternatives 'yes, all of it' , 'yes, most of it' , 'yes, some of it' , 'no, not at all' and 'don't know' . The 'don't know' category has been excluded, which resulted in an index ranging from 3 to 12 (α = .72).

School-related independent variables
Student's school situation was measured by a battery of 18 questions. 9 Factor analyses resulted in a total of five dimensions (described below), which were used as indicators of different aspects of the students perception of the schools' social and learning climate. All of the school items, with the exception of the grades variable, had the following four response alternatives: Describes very poorly, describes rather poorly, describes rather well and describes very well. Grade scores were instead measured by means of self-reported grades from the last semester in the Swedish core subjects Swedish, English and Math.
Encouragement and communication was based on the following statements: 'My school tells my parents if I have done something well'; 'The teachers praise students who do something well at school'; 'My teachers don't give me any praise if I work hard' (reverse coded) and 'The students' opinions are taken seriously at this school' (α = .59).
Meaningful schoolwork was based on the following statements: 'I look forward to going to my lessons'; 'Most of my teachers give interesting lessons'; 'My schoolwork makes me confused' (reverse coded) and; 'My schoolwork feels meaningless' (reverse coded; α = .70).
Clarity and participation at school was measured by the following statements: 'Adults intervene if someone is getting harassed or bullied'; 'The teachers explain what we can and can't do during lessons'; 'I know the rules that are in place at this school'; and 'We students are involved in planning what we will do during lessons' (α = .58).
Classroom order was measured by the questions: 'At the start of lessons, it takes at least five minutes before we can start working'; and 'There is a lot of noise and disruption during lessons' (α = .58).
The Performance/Grades measure was based on the question: 'What were the (most recent) grades you received last term in the following subjects? Swedish, English and Maths; with the response alternatives 'No grade/fail'; 'Pass'; 'Pass with credit'; and 'Pass with distinction' (α = .77).

Control variables
School year was measured by the question 'State your school year' , with the response alternatives year nine or year two of upper secondary school.
Gender was measured by the question 'Are you a boy or a girl?' . Time in Sweden was measured by the question: 'How long have you lived in Sweden?' with the response alternatives 'All my life'; '10 years or more'; '5-9 years'; and 'less than 5 years' . The variable has been coded into three categories, with the final two response alternatives combined, i.e. the respondent either had lived in Sweden all of her/his life, more than 10 years or less than 10 years.
Year (2006, 2008 and 2010) was included in order to see whether the outcome differs significantly between these years. Table 1 presents descriptives for all variables included in the analysis.

Procedure
Given the hierarchical nature of the data and the binary outcome, I used multilevel logistic regression analysis (three-level random intercept logistic model) in order to test the potential protective effects on the outcome. Multilevel analysis takes account of the significance of both individual and contextual factors for the outcome and is designed to handle hierarchically structured data (Snijders & Bosker, 2012). Although it is reasonable to assume that the greatest variance in offending is found between individuals, there may also be systematic differences in relation to the class or school attended by the respondents.
The potential presence of statistically significant differences in self-reported offending between classes and schools is initially examined in a so-called empty model. This model includes no independent variables, but allows the variance in self-reported offending to be divided into three components, one for each level (student, class and school), thus the empty model shows whether any differences exist between classes and schools. When the observations in the data-set are clustered within schools and classes, as in this case, it is important to take account of the contextual dependence this produces in order to obtain correct regression estimates (Merlo et al., 2006). Further, an analysis of this kind yields important information in its own right, since the objective is to examine aspects of the school environment that are not specific to certain situations or contexts. It is important to emphasize, however, that these estimates only show if there are differences between school and class contexts. Investigating which aspects of these contexts are of significance has been out of the scope of this particular study.
Following the estimation of the empty model, the independent family and school variables at the individual level are included in order to study the extent to which they correlate with the outcome. For each model, information is also provided on the unexplained variance in the outcome variable at the class and school levels, which makes it possible to calculate the MOR (Median Odds Ratio). The MOR can be described as the median change in the odds (here for having committed at least one offence) if a student were to move from one school (or class) to another one that has a higher level of risk. The MOR is preferable to the ICC (intra class correlation) in connection with multilevel analyses of dichotomous outcomes, since the aim of this measure is to transform the area level variance into the widely employed odds ratio scale, the interpretation of which is more accessible (Merlo et al., 2006).  In order to examine the school-related protective factors' potential effects on the outcome, they are initially included in the full model. This allows studying whether they, given controls for the other factors in the model, are negatively correlated with offending, which constitutes a requirement for them to serve as protective factors. In order to be able to argue that a presumed protective factor of this kind also has a moderating effect, the probability of offending in the presence of risk would be smaller than in the non-risk situation (Lösel & Farrington, 2012). If a protective factor has a moderating effect, the correlation between the relevant risk factor and the outcome would attenuate or disappear completely (Crosnoe, Glasgow Erickson, & Dornbusch, 2002). To investigate this, it is necessary to be able to establish a significant interaction between the risk factor and the protective factor on the risk for offending. Interaction terms have been constructed for all combinations of family-related risk factors and school-related protective factors and have been tested in the full model. A total of five interaction terms achieved statistical significance (p-values presented in Table 2). These five were then dichotomized at the mid-point and have been evaluated separately to examine whether or not their effects are compensatory. The ways in which these interaction variables manifest themselves is illustrated by means of two-by-two tables (Tables 3 and 4). The analyses have been conducted using STATA version 12.0 and MLwiN version 2.25. Table 2 presents the results of the logistic regression analyses of self-reported offending in four models separately for boys and girls. The table begins by presenting bivariate correlations between each individual independent variable and offending. Largely the same school and family factors appear to correlate with offending for both boys and girls. The proportion of boys who have reported that they committed at least one of the studied offences during the past year appears to have declined significantly between 2006 and 2010, whereas no corresponding decrease appears to have occurred among the girls. Otherwise, all independent variables are significantly correlated with offending for both boys and girls.

Direct effects of the perceived school setting on offending
As expected, the family-related risk factors included in the study show significant positive correlations with the outcome, i.e. they are associated with increased odds for offending (odds ratios greater than one). Further, the school dimensions all present negative correlations with the outcome, i.e. they are associated with a reduced risk for offending (odds ratios below 1). Model 1 presents the family factors separately, while at the same time taking into account their effects on one another, and also the effects of the control variables. The model shows that the odds ratios for each of the family factors are greater than one, and that all factors significantly correlate with offending, even controlling for one another's effects. For example, the odds of offending for boys whose both parents lack university education, controlling for the other family-related factors, is 46% greater than that of boys whose both parents have university education. The corresponding figure for the girls is 28%. Similarly, for each unit increase in the deficient parental supervision index, the odds for having offended increases by 33% among the boys, and by 36% among the girls, controlling for the effects of the other family factors (Table 2).
Model 2 presents the corresponding information for the various aspects of student perceptions of the social and learning climate at school. The model shows that all estimates, Table 2. odds ratios for correlations between family-related risk factors, school-related protective factors and offending (n = 25,281). * Significant at the 5% level (p < .05); ** Significant at the 1% level(p < .01); *** Significant at the .1% level (p < .001). with the exception of Classroom order and encouragement and communication among the girls, are significantly associated with decreased odds of having offended, even given controls for the remaining school variables. Each unit increase in the meaningful schoolwork index, for example, corresponds to an odds ratio of .9 for the boys and .86 for the girls. The final model (3) presents mutually adjusted effects of all of the independent variables in the analysis on offending. The factors that are no longer significant in the full model are likely to represent indirect effects on offending, i.e. they co-vary with the outcome via one or more of the other variables included in the model. 10 The independent variables whose effects remain significant in model 3 may be assumed to represent direct effects on offending. For the boys, it is only the Classroom order that does not appear to have a direct effect, while for the girls, neither encouragement and communication between teachers and students, parents' educational level, nor classroom order are significantly correlated with the outcome in Model 3. All of the remaining family-related risk factors and school-related protective factors remain significantly correlated with offending in the expected direction (Table 2). Table 2 goes on to present the interaction terms that are significantly correlated with the outcome. 11 This means that the effect of the one variable in the interaction term is dependent Table 3. illustration of interaction effects among boys (odds ratios).  .39*** on, or affected by, the value of the other variable (Allison, 1999a). As was mentioned earlier, the analyses revealed five significant interaction terms. Tables 3 (boys) and 4 (girls) present the interactions in the form of separate results for those with high and low levels of the relevant family-related risk, in order to see whether the effect of the positive aspects of school differs between these two groups.

Protective effects of the perceived school setting on offending
In order to illustrate whether the positive aspects of school have a compensatory effect in relation to adverse family conditions, separate analyses have been conducted for the correlations between the school variables and offending for different values of the family variables (Tables 3 and 4). In the one case, 'high risk' on the family variables serves as the reference category (OR = 1), and in the other case, the reference category is specified as 'low risk' on the family variable. Thus, the positive perceptions of school are compared with these and should be interpreted as reductions in the odds for offending in relation to the reference categories. A more detailed analysis of the significant interactions identified in the analysis (see Table 2) shows that none of the positive aspects of school appear to be able to completely eliminate the effect of adverse family conditions. There appears to be a compensatory effect in one case only, the interaction between meaningful schoolwork and alcohol problems in the family for boys (Table 3(c)). This would mean that boys with experience of alcohol problems in the family are even more positively influenced by meaningful schoolwork than students without experience of alcohol problems in the family. In the remaining cases, the interactions appear to produce a form of additional relative deprivation in relation to the outcome, since it is the group of students whose situation is already beneficial that draws the greatest benefit from the positive aspects of the school environment. It is important to add, however, that even though the positive aspects of school cannot be said to have a compensatory effect in these cases, they are nonetheless associated with a decline in the odds for offending also in the group experiencing adverse family conditions. Thus, not only the group with a beneficial family situation benefits from positive school experiences.
A total of three of the constructed aspects of student's perception of school's social and teaching environment interacted with adverse family conditions among the boys, of which one can also be said to have a moderating effect (Table 3(c)). In those cases where the source of risk lies in the parents' low level of education, the perceptions of meaningful schoolwork and of a high level of clarity and participation appear to contribute to significant reductions in the odds for offending for students with both higher and lower levels of family-related risk. For the group who reported alcohol problems in the family, on the other hand, the perception that schoolwork feels meaningful appears to be more important for those with a high level of family-related risk (OR = .36) than for those with no experience of family problems of this kind (OR = .5). The odds ratios presented in Table 3(c) can be interpreted as showing that given the risk of having alcohol problems in the family, the odds for offending among boys who perceive that schoolwork feels meaningful are only one-third as great as they are among boys who do not view their schoolwork in this way. Expressed differently, the students who perceive that their schoolwork feels meaningful appear to be able to compensate for the heightened risk (see Table 2) for offending that is produced by alcohol problems in the family. The odds ratios in Table 3(a) and (b) can be interpreted in the same way, but with the difference that the interaction appears to be due to the fact that students with lower levels of family-related risk benefit even more than those with higher levels of background risk.
Meaningful schoolwork and high grades are the perceived aspects of school that the analysis showed to interact with deficient parental supervision in relation to offending among the girls. Table 4(a) and (b) show, however, that these interactions involve direct protective effects rather than compensatory effects, since the effect of these positive aspects of school is seen for girls with both lower and higher levels of background risk, but to a somewhat greater extent for the group that is at less risk, which appears to have caused the interaction.

Controlling for clustering effects
Besides taking the hierarchical nature of the data into account, multilevel analysis also enables one to describe the variance in offending between schools and classes, which is presented in the final section of Table 2. This variance is statistically significant both at the school and class levels, which indicates that there are systematic differences in self-reported offending between the schools and classes. These differences remain, even given controls for student composition, although they become somewhat smaller in the full model. As can be seen from the table, all MOR (median odds ratio) values exceed 1, which indicates that both class and school membership are linked to the likelihood of offending. In the empty models, the MOR-value means that if a girl moved, for example, from one school to another with a higher offending risk, her odds of offending would increase by 1.59 times (at the median). Similarly, 'moving class' would increase the risk by a factor of 1.4. The corresponding estimates for boys are somewhat lower: 1.46 (school) and 1.35 (class). Once student composition has been taken into account (Model 3), the variance in offending between classes and schools appears to be much the same for girls and boys. It is important to emphasize, however, that these estimates only indicate that there are differences between school and class contexts, not which aspects of these contexts are of significance.

Main findings
The results show that there are factors in the perceived school setting that appear to have direct protective effects in relation to offending (encouragement and communication, perceiving schoolwork as meaningful, clarity and participation, and good performance). The perception of meaningful schoolwork also appears to be able to moderate the effect of adverse conditions at home for boys; more specifically, alcohol problems in the family. In the fully adjusted model, only one of the five school dimensions, classroom order, was not significantly correlated with offending among the boys. The control for clustering effects also shows that there appears to be a group effect of the school setting as a whole. It is important to emphasize, however, that these findings are probably in part due to a selection of disadvantaged youths to certain schools. This may in turn be linked to residential and school segregation (see e.g. Welsh, Stokes, & Greene, 2000). This is an important topic for further research in the context of Stockholm and Sweden since there are indications of an increase in both residential and school segregation (Fritzell & Strömblad, 2011).

On the significance of the perceived school setting
It is important to note that students with lower levels of family-related risk generally appear to draw as much, or more, benefit from the positive aspects of the school setting than students with higher levels of family-related risk. This is something that -given the literature on how protective factors should be defined in order to be able to differentiate them conceptually and empirically from risk factors -would mean, quite simply, that they cannot be labelled protective factors. Krohn et al. (2010) instead refer to such effects as promotive, while Lösel and Farrington (2012) speak of direct protective effects. One notable exception to this tendency is found in relation to the interaction between alcohol problems in the family and the perception of schoolwork being meaningful, which appeared to produce a greater benefit for the more at-risk group of students, i.e. the effect of this positive aspect of school was greater for students with experience of alcohol problems in the family than for those without such experience. This can thus be defined as a moderating effect.
The school factors that the study shows to have a direct protective effect are perceptions of encouragement and communication between teachers and students, clarity from teachers and student participation, and good school performance. As regards the first two factors, these referred almost exclusively to questions relating to the relations between teachers and students, and can thus be said to reflect the perceived social climate in school. These findings are in line with Rutter et al. (1979) central conclusions about the relationship between on the one hand how well schools functioned as social institutions, that is for example the availability of incentives and rewards and the extent to which students were able to take responsibility, and on the other how successful they were in shaping and influencing the students' attitudes and behaviour. They also relate to criminological perspectives emphasizing the importance of attachment to and involvement in school (Sampson, 2012;Sampson & Laub, 1993) for desistance from crime, and the reverse importance of potential labelling effects that negative relations with teachers are said to have according to the concept of cumulative disadvantage (Agnew & Messner, 2015;Nilsson et al., 2013;Sampson & Laub, 1997). Then on the other hand, since already advantaged students benefit from the positive aspects of school in a greater extent than disadvantaged, this study could also be interpreted as supporting a kind of cumulative advantage. The one important exception from this pattern is the perception of meaningful schoolwork discussed below.

The meaning of meaningfulness
In this study, the school dimension that appeared to have a compensatory effect on the relationship between the experience of alcohol problems in the family and offending was labelled meaningful schoolwork. It is difficult to interpret the content of this dimension on the basis of the theoretical framework employed here. In addition to the question of whether schoolwork feels meaningful, this dimension includes questions on whether the teachers give interesting lessons and whether the students look forward to going to lessons. Even though this might relate to attachment to school and social bond theory, the concept of informal social control is not fully satisfying in the interpretation of this dimension. Rather, the concept could in part be interpreted as a measure of individual aspirations, and in part a measure of how well the teachers succeed in conveying knowledge and inspiring the desire to learn. A low level of ambition could also be linked to factors associated with the students' family conditions. 12 The literature on effective schools has among other things been criticized for exclusively focusing on the teachers' expectations of students, and thus of ignoring the students' own level of ambition (Quaglia, 1989). A more satisfactory conclusion and implication for policy in this regard, given the results of this study, would be that it is important that adults convey to young people a sense that school is meaningful, particularly to those whose own levels of ambition are low.
Theoretically, the implication of meaningfulness as the only perceived school aspect with a compensatory effect, according to this study, needs further investigation. The content of the concept is more complex than simply putting the responsibility on schools ability to perform informal control. Instead, further research on the importance and the content of meaningfulness might benefit from adopting theoretical concepts like blocked opportunities and future prospects from classic strain theory (Merton, 1938). The relationship between negative future orientation and crime has recently been reported in several studies (see e.g. Alm & Estrada, in press;Brezina, Tekin, & Topalli, 2009;Maruna & Roy, 2007;Silver & Ulmer, 2012).

Emotional support more important than maintaining order in the classroom
Classroom order was the aspect of the school's teaching environment that, according to the results of this study, does not seem to be of significance for refraining from offending.
Controlling for the other factors in the model, this dimension was not significantly correlated with offending among either girls or boys. Nor did the classroom order measure produce a moderating effect. This contradicts Rutter et al. (1979) conclusions on the significance of maintaining order in the classroom. It is also interesting given the Swedish school discourse at the time of this data collection. Between the most recent political shift in government in 2014 and the one before, in 2006, there was an ongoing reform work in relation to the Swedish school system. The explicit objective was to re-establish knowledge-based schooling -which among other things involved making greater demands on students, and a focus on a quiet learning environment and the maintenance of order as important factors for success. It is interesting to note that the aspect of school that in this study lies closest to the concept of 'maintaining order' appears to be less important for offending than those aspects that are linked to teachers providing emotional support. 13

Limitations
A limitation of the current study is that the analyses have been conducted on regional data in the city of Stockholm, which limits the possibilities of generalization of the results to a broader area. The fact that the data are cross-sectional constitutes a further limitation, since this excludes the possibility of making causal interpretations. Criticism has also been directed at the use of dichotomous outcome variables and the interpretation of the coefficients produced in logistic regression analysis (Allison, 1999b;Mood, 2010). Mood (2010) argues that unlike linear regression estimates, the estimates produced by logistic regression are influenced by the variables excluded from the models, a phenomenon referred to as unobserved heterogeneity, which makes interpretation of the coefficients more complicated than is the case in linear regression models. Therefore, the results in the present study have been confirmed by means of control analyses using linear regression. My own assessment is that, in terms of interpretability, it is more advantageous to dichotomize the outcome than to use a skewed continuous outcome which would need to be transformed. Using dichotomous variables, the estimates are accurate and transparent in displaying what the outcome takes account of (1 = Students who had engaged in at least one of the acts concerned, while the remainder = 0).
The amount of the estimated interaction terms (in sum 25) in this study constitutes another limitation since the risk of type 1 errors is quite high, i.e. in large models some covariates may become significant by chance. An option which would have resulted in less interaction terms would have been to estimate a compound measure of risk. However, such a procedure would have resulted in a loss of information about which sources of risk the school aspects would have compensated for. Another argument for the existence of 'true' interaction terms is the fact that they are significant on a high level which strengthens the assumption that they are not produced by chance.
A further limitation is a lack of information about the students who were absent from the survey, or who had not answered certain questions. It is reasonable to assume that students with risk behaviours are over-represented in this group.
As regards the multilevel analysis, this study only shows that there are contextual differences at the class and school levels, not which aspects of these contexts are of significance. In other words, it may well be the case that the factors that are of significance for the variation in offending between the classes are not the same as those linked to the differences between the schools. One question that has been less researched in criminology is how much of the variation between schools can be ascribed to school climate, teaching ability and the school organization, and how much may be explained by the composition of the student population, i.e. that students of different backgrounds attend certain types of schools (Farrington & Welsh, 2007). Contextual analyses across schools of this kind have been carried out for example by Op de Beeck et al. (2012) and Welsh et al. (2000), suggesting that certain school contextual factors could partly explain the variation in crime across schools. It has been out of the scope of this study to examine this issue in more detail; this will be the focus of a forthcoming study.

Further implications for crime prevention
Most of the school-related aspects investigated in this study could not be established as protective factors. However, this does not need to constitute an argument against regarding these factors as positive and important in the context of prevention work and school improvement. In fact, it is hardly surprising that students from beneficial conditions find it easier to profit from positive aspects of the school setting. What is essential in this respect is that it is not only students from more positive family conditions who benefit from these aspects of the school environment, but also those from more adverse family conditions, which this study shows to be the case. Finally, besides the complex nature of the one compensatory effect discussed above, the study's results direct a focus at the role and capacity of teachers. The fact that teachers, without being assigned specific crime preventive tasks, can actually fulfil a crime preventive function simply by accomplishing the principal task of schools, shows how important it is that the resources required for this are made available. At the same time as they are being assigned more responsibility for preventing offending (Wahlgren, 2014), Swedish teacher surveys show that it is becoming increasingly common for teachers to complain about their work situation (National union of teachers in Sweden, 2011). An increasing amount of time and energy has to be devoted to administrative tasks, leaving less time for the students. If teachers' social and teaching abilities are to be of benefit to students, it is essential that they are given the opportunity to work in an environment that enables them to devote sufficient time to teaching and to interacting with their students.

Notes
1. In this study, the term protective factors refers in part to direct protective effects in relation to offending, i.e. factors that contribute to a reduced risk for offending even given controls for other variables included in the analysis, and in part factors that produce a compensatory effect by moderating the effects of risk factors. Both types of protective factors are examined in the study, but they should be distinguished from one another in definitional terms. 2. According to Giordano, Cernkovich, and Rudolph (2002) neither marital attachment nor job stability -key factors in the process of desistance according to Sampson and Laub (1993) were strongly related to desistance for serious female offenders. 3. The concepts of compensatory and moderating protective factors are viewed as equivalent in this study and are defined as stated above. The significance of these concepts will only be differentiated in relation to the concept of direct protective effects. 4. For a discussion of the significance of the non-response, the reader is referred to the report En uppskattning av bortfallets betydelse för Stockholmsenkäten, published by the City of Stockholm.
(http://www.stockholm.se/utveckling). 5. Since the participating students are different in each wave of the survey, the number of schools has been counted separately for each wave and then summed. This means that the same school may have been included in the figure three times. 6. The factor analysis was conducted using Principal components. Rotation Method: Varimax with Kaiser Normalisation in SPSS (Statistical package for the Social Sciences). 7. Although I am attempting to capture a 'more vulnerable group' , far from all of those identified in this group will continue offending as adults. As a result of the difficulties associated with identifying boundaries between different groups of more or less serious behaviours, I have allowed the exploratory factor analysis to determine which of the self-reported behaviours would be included as offences in the outcome measure. 8. A relatively large proportion of the students did not know their parents' educational level (see Table 1). The category 'Don't know' was therefore included in the analyses. Since this category is not significantly correlated with the outcome, it is not, however, presented in the result section (Table 2). In the analyses of the interaction variables, the 'Don't know' category has been recoded as missing, since it is not possible to say anything about this group. 9. A total of 21 questions, of which three were completely excluded because they either had relatively low loadings on more than one of the factors, or because their factor loadings were smaller than .5. 10. In many school studies, the grades variable is employed as the outcome measure, and it probably 'consumes' the effect of those factors that it may be influenced by. 11. Each interaction term has been tested separately in the full Model 3 for girls and boys, respectively. A total of 25 interactions were tested, but only those showing statistically significant effects are presented in the table. 12. A further interpretation of the concept of meaningful schoolwork would be that it is the indicator that lies closest to individual resources at the level of the individual student. It is reasonable to assume that schoolwork is more often perceived as meaningful by gifted students, or by students who mature early. It is possible that the measure is influenced by individual characteristics that predict both perceptions of meaningfulness and the risk for offending. 13. This is not to say that these more 'disciplinary' aspects of the school environment may not play a significant role in relation to other outcomes, such as pupils' psychological well-being and school performance (Grosin, 2004;Modin & Östberg, 2009).