Introduction Poor school attendance due to absence (authorised or unauthorised) from available sessions or exclusion (where a headteacher forbids a student to attend for a fixed number of sessions or permanently) leads to multiple immediate and long-term socioeconomic disadvantages. It is associated with a range of negative outcomes across the life course, including poor educational attainment, unemployment, and poverty.1-5 Several smallscale studies in the UK, USA, and Australia, with sample sizes ranging from less than 100 to 13 000, suggest that absence from school is more common in children with a mental disorder, specifically depression, anxiety, and disruptive behaviour disorders, through school refusal, truancy, or the condition itself.6-11 Studies from the UK12,13 and the USA14 report an association between Research in context Evidence before this study We searched PubMed for papers published in English between database inception and July, 20, 2021, using the search terms ((children) OR (adolescents)) AND ((school attendance) OR (school absence) OR (exclu*) OR (truan*) or (school disengagement) OR (School Refusal)) AND ((depression) or (anxiety) or (adhd) or (autism) or (learning difficulty) or (schizophrenia) or (bipolar) or (self-harm) or (eating disorder) or (drugs) or (alcohol) or (conduct disorder)). We found 13 small-scale cross-sectional surveys that used questionnaires to assess mental disorders and one national electronic cohort study linking education and secondary healthcare datasets. School absence and exclusion were found to be associated with neurodevelopmental disorders, depression, anxiety, disruptive behaviour, substance misuse, or self-harm, but current evidence is sparse and based on small numbers. Added value of this study Our population-based, electronic cohort study was larger than most previous studies, including more than 400 000 pupils, and linked routinely collected primary and secondary healthcare data to educational data. Previous studies have been based on secondary care data only and probably missed disorders, such as anxiety, that are more commonly managed in primary care. Our study encompasses a wide range of clinically diagnosed and recorded mental and neurodevelopmental disorders up to the age of 24 years, and so includes conditions, such as bipolar disorder and schizophrenia, that are less frequently studied in this context are are more often diagnosed in late adolescence and early adulthood. Furthermore, the large size of this study allows for the inclusion of people with less common diagnoses, such as eating disorders. We found strong associations across all disorders and self-harm with absenteeism and exclusion from school. Odds ratios for both outcomes increased with the number of comorbidities and deprivation. Implications of all the available evidence Poor attendance affects the educational attainment of children and future social and developmental outcomes. Children with mental or neurodevelopmental disorders or who self-harm are more likely to miss school through absenteeism and exclusion than their peers. Exclusion or persistent absence are potential indicators for current or future poor mental health that are routinely collected and could be used to target assessment and early intervention. neurodevelopmental disorders (ie, ADHD and autism spectrum disorder [ASD]) and self-harm with persistent absenteeism. Similarly, school exclusion appears to be strongly associated with ADHD, ASD, and mental disorders, particularly depression, in UK-based and international studies.13,15 In these mostly cross-sectional studies, diagnoses were assessed by use of questionnaires or interviews. However, children and young people (<24 years) with these disorders are more commonly from disadvantaged families and might be less likely to participate in research surveys.16-18 They also have higher levels of attrition at follow-up16-18 for reasons including impairments affecting the young person or their parent and impacting survey completion or a related absence when surveys are done in a school setting. Furthermore, birth cohort studies often include insufficient numbers of children with mental health conditions to support indepth analysis of rarer conditions. For the sail Databank see In this study, we capitalised on electronic linkage https://saildatabank.com/ between routinely collected primary and secondary health-care data on clinical diagnoses and data on school attendance and exclusions at a population level. Our hypothesis was that school absences and exclusions are associated with a broad range of diagnosed and recorded neurodevelopmental and mental disorders and self-harm by 24 years of age within our cohort of pupils, even after adjusting for sex, age at the start of the academic year, and deprivation. Once established (and previous literature is scarce), this hypothesis would lead to further questions for more detailed study. Methods Study design and participants In this nationwide, retrospective, electronic cohort study, we drew our cohort from the 5 341 392 individuals in the Welsh Demographic Service Dataset to include individuals aged 7-16 years (16 years being the school leaving age in the UK) enrolled in state-funded schools in Wales in the academic years 2012/13-2015/16 (between Sept 1, 2012, and Aug 31, 2016) who had primary and secondary care linked data and no conflicting data in the education dataset that pointed to a many-to-one correspondence between the anonymised linkage field and the internal pupil identification number. Ethics approval was granted from the Secure Anonymised Information Linkage (SAIL) Information Governance Review Panel, an independent body consisting of a range of government, regulatory, and professional agencies, in line with ethical permissions already granted to the analysis of data in the SAIL Databank (approval number 0808). Procedures We linked data on an individual level via the Adolescent Mental Health Data Platform, an international data platform that supports mental health research in children and young people. For our study, the Adolescent Mental Health Data Platform used datasets from the SAIL Databank, a repository of routinely collected health and education datasets for the population of Wales.19,20 All data are treated in accordance with the Data Protection Act 2018. Individuals within the datasets are assigned a unique anonymised linkage field that replaces any identifiable information, such as names, and enables anonymised linkage across the different datasets. The datasets in the SAIL Databank that we used were: the Welsh Demographic Service Dataset (a demographics register of people registered with general practitioner [GP] practices in Wales) on Nov 1, 2018; the Office for National Statistics deaths register on March 28, 2019; the Welsh Index of Multiple Deprivation 2011 (an official measure of small area [defined as containing approximately 1500 individuals] deprivation in Wales, based on employment opportunities, income, education, health, community safety, geographical access to services, housing, and the physical environment; quintile 5 represents the most deprived areas) on Nov 1, 2018; the Welsh Longitudinal General Practice Database (on Aug 20, 2018) and the Patient Episode Database for Wales (on Jan 31, 2019), which contain attendance and clinical information for all GP interactions and hospital inpatient and day case activity in Wales, respectively; and the Welsh Government Education Dataset (appendix 2 p 6). The Welsh Government Education Dataset includes records for all children registered at mainstream state schools in Wales or educated in settings other than school. It contains information on attendance, exclusions, eligibility for free school meals, and receipt of a statement of special educational needs (SEN). Attendance records were available from the academic year 2007-08 to the academic year 2015-16. Each school reported, per pupil, the number of authorised and unauthorised absences for that year out of a total number of possible sessions per year. Exclusion records (categorised as permanent, fixed, or lunchtime) were available from the academic year 2012-13 to the academic year 2015-16. A child might have SEN status if they have a learning difficulty or disability (including neurodevelopmental or mental disorders) that requires special education provisions to be made for them.21 We queried primary and secondary care datasets to extract recorded neurodevelopmental and mental disorders and self-harm using code lists from the ICD (version 10) for secondary care and read codes (version 2)22 in primary care. The codes were collated from published articles and code lists or were compiled in collaboration with clinicians (appendix 2 p 7). Neurodevelopmental disorders (ie, ASD and ADHD), learning difficulties, and conduct disorder were extracted for our cohort of pupils from their birth until they reached 24 years of age because these conditions often arise early in development and are diagnosed at a young age. Other mental disorders (including depression, anxiety, eating disorders, bipolar disorder, schizophrenia, alcohol misuse, and drugs misuse) or self-harm were extracted for our cohort of pupils between the ages of 10 years and 24 years. We categorised all F ICD-10 codes and E read codes not included in other category code lists, such as those for mania, into the other psychotic disorders category. Each pupil had a flag per each disorder categorised as a binary variable (recorded present or absent). The age at first diagnosis was extracted for each pupil and disorder. Where a pupil could not be linked to primary or secondary care datasets, this was flagged as linked or unlinked. We extracted SEN status for each pupil as a binary variable (present vs absent) to understand the extent to which it, in addition to a disorder, affected outcomes. We counted the number of morbidities per person to assess the effect of comorbidities (defined as two or more of the studied disorders recorded for the same individual, not necessarily concurrently). Outcomes We defined absenteeism as a binary variable, categorised as 1 when a pupil missed more than 10% of sessions in 1 year and categorised as 0 otherwise. The choice of 10% was based on a report from Estyn (the quality inspectorate of education in Wales), which described that, of pupils who were absent for more than 10% of sessions, fewer than 80% achieved the level expected of them by age 11 years in mathematics, science, and either English or Welsh as a first language and fewer than 40% achieved level 2 (equivalent to five GCSEs at grades A*-C) at 16 years of age.23,24 10% is the level used in England to define persistent absenteeism,25 although the level used in Wales is 20%.26 Exclusion (a record of any type of exclusion in a specific academic year) was also categorised as a binary variable (yes vs no). Statistical analysis Data were retrieved from the SAIL Databank by use of IBM DB2 9.7 SQL. Statistical analysis was done by use of R (version 3.3.3), accessed through RStudio (version 1.2). We analysed the association between the outcome variables (absenteeism and exclusion) and the existence of a record of each neurodevelopmental or mental disorder and self-harm, up to 24 years of age, using generalised estimating equations (R library geepack).27 Generalised estimating equations with exchangeable correlation structures using binomial distribution with the logit link function were used to calculate odds ratios (OR) for absenteeism and exclusion, adjusting for sex, age at the beginning of the academic year, and deprivation. We used a long data format with one row per pupil and year. The experimental unit (id) was the pupil, and the repeated measurements were ordered by academic year (wave). 95% CIs for proportions and percentages were estimated by the Wilson score method with continuity correction. We did not explore causality; therefore, the time dependence of measurements per person (up to four measurements at different academic years) was modelled with a correlation function as a source of variance, which was marginalised over so that the variance of the estimated covariates were calculated efficiently.28 We used an exchangeable correlation structure, in which any two measurements for the same pupil had the same correlation. We analysed each recorded disorder separately using a sub-cohort consisting of those presenting with these disorders together with pupils in our cohort with no record of any of these disorders (our controls). We tested multiple models, sequentially adding age (week of birth), sex (male vs female), and deprivation quintile (quintile 5 representing the most deprived) as covariates.29,30 We tested the goodness of fit for each of these models by calculating the Quasi-likelihood model information criteria.31 We stratified the population by condition and analysed the association between the outcome variables and sex, age, and deprivation separately. For the main analysis, we pooled pupils with ADHD and ASD (under neurodevelopmental disorder) and pooled pupils with depression, anxiety, eating disorders, schizophrenia, bipolar disorder, and other psychotic disorders (under any mental disorder). In the first sensitivity analysis, we ran the main analysis on both the subgroup that had linked healthcare data and the full dataset. Neurodevelopmental and mental disorders typically show comorbidity over the life course. We assessed the sensitivity of our analysis to comorbidities by conducting three extra sensitivity analyses. First, we compared the model results between those with one morbidity and those without any of the morbidities studied. Second, we compared the model results between those with more than one morbidity and those without any of the morbidities studied. Finally, separately, we ran the model with the number of comorbidities as a covariate. We conducted several other sensitivity analyses. For some children, certain types of mental disorders are an entry point for SEN status within the education system. We assessed sensitivity to SEN status by exploring the interaction between any of the disorders studied and SEN status. We also ran our models in the subpopulation of participants first diagnosed or with their first record before 17 years of age (ie, while of school age). Furthermore, we compared individual-level yearly rates of absences (number of sessions absent/total number of possible sessions per year) for those excluded versus for those not excluded and calculated the Pearson correlation coefficient between individual-level yearly rates of absences and individual-level yearly rates of exclusions. Role of the funding source The funders of the study had no role in study design, data collection, data analysis, data interpretation, or writing of the report. Results 437 412 individuals had education and demographic data and were aged 7-16 years during the 2013-16 academic years, of whom 213 816 (48-9%) were female and 223 596 (51-1%) were male (figure 1). Of these 437 412 individuals, 22 775 (5-2%) had no linked hospital or primary care records. We considered health data for these individuals as missing at random because missingness was not based on health or education status. In the group with health-care data, 212 848 (51-3%) of 414637 pupils were boys and 201789 (48-7%) were girls (appendix 2 p 1). In the group without health-care data, 10 748 (47-2%) of 22 775 pupils were boys and 12 027 (52-8%) were girls (appendix 2 p 1). Compared with those with health-care data, a higher proportion of individuals with missing health-care data resided in quintile 2 areas on the Welsh Index of Multiple Deprivation and a lower proportion resided in quintile 5 areas (appendix 2 p 1). We repeated the main analysis in the group with linked primary and secondary health-care data (n=414637) and in the larger group (n=437 412). Results were equivalent (appendix 2 pp 25-26) so we removed those without linked health-care data from all main and other sensitivity analyses (list-wise deletion). Each pupil contributed 1-4 years of data. The distribution of morbidity, sex, and deprivation by number of years of data contributed is shown in appendix 2 (pp 2-4). Demographics and morbidity were not correlated with the number of years of data contributed so we also viewed this as missing at random. Of the 414 637 pupils with primary and secondary care data comprising our study population, 201 789 (48-7%) were female and 212 848 (51-3%) were male. Their mean age on Sept 1, 2012, was 10-5 years (SD 3-8). Ethnicity data were not available. 57 930 (14-0%) pupils had at least one of the disorders studied (a neuro-developmental or mental disorder or a record of selfharm) by the age of 24 years, and 42 734 (10 -3%) while of school age. 356 707 (86-0%) of414 637 individuals had no record of self-harm or any of the disorders studied. The numbers of diagnosed individuals, age at first diagnosis, and SEN status before 17 years of age are detailed in appendix 2 (p 7). 118 140 (28-5%) had recorded absenteeism during at least 1 school year, of whom 5901 (5-0%) had a neuro-developmental disorder, 17 724 (15-0%) had a mental disorder, and 5164 (4-4%) had a record of self-harm. 20 507 (17-4%) of the 118 140 with recorded absenteeism were diagnosed while of school age, ofwhom 5762 (28 -1%) had a neurodevelopmental disorder, 12 164 (59 -3%) had a mental disorder, and 4450 (21-7%) had a record of selfharm. The proportion of absentee pupils with no record of any of the disorders studied remained stable in primary school (7-11-year-olds) at around 12-5% and increased in secondary school (11-16-year-olds) to around 18% for 16-year-olds (figure 2). For the raw counts used to create figure 2, please see the appendix (pp 16-20). Across all ages, a higher proportion of pupils with a neuro-developmental disorder, mental disorder, or self-harm record were absent from school compared with pupils without a record (figure 2). In the last 2 years of primary school (10-11-year-olds), pupils with a subsequent diagnosis of schizophrenia or drugs misuse had the highest rate of absenteeism at around 30-33% (figure 2). In the last 2 years of secondary school (ages 15-16 years), pupils with a record of bipolar disorder, schizophrenia, alcohol misuse, drugs misuse, or self-harm had the highest rate of absenteeism at around 40-55% (figure 2). Goodness-of-fit tests (appendix 2 p 27) showed that including sex, age, and deprivation as covariates sequentially improved the fit, so we present both unadjusted and adjusted results (table 1). Having a record of a neurodevelopmental disorder (OR 2-1, 95% CI 2-0-2-2), mental disorder (2-9, 2-8-2-9), or self-harm (4-0, 3-8-4-1) was associated with absenteeism (table 1). Adjusted ORs (aORs) ranged from 2-0 (95% CI 1-9-2-0) for pupils with a neurodevelopmental disorder to 4-2 (3-4-5-3) for those with schizophrenia and 5-5 (4-2-7-2) for those with bipolar disorder (table 1). Of those with a record of neurodevelopmental disorders, learning difficulties, conduct disorder, depression, other psychotic disorders, or drugs or alcohol misuse, boys were less likely to be absent than were girls (appendix 2 p 9). For those with a record of anxiety, eating disorders, bipolar disorder, schizophrenia, or self-harm, sex was not significantly associated with absenteeism (appendix 2 p 9). For pupils with a record of neurodevelopmental disorders, conduct disorder, depression, anxiety, eating disorders, drugs or alcohol misuse, or self-harm, age was associated with absenteeism, with slight increases in ORs per year (appendix 2 p 9). The sample sizes for bipolar disorder and schizophrenia were too small to assess the association of deprivation quintile with absenteeism; however, the odds of being absent increased with increased deprivation (5th vs 1st quintile) for all other variables apart from other psychotic disorders, ranging from 1-5 (95% CI 1-3-1-9) for conduct disorder to 2-8 (2-2-3-6) for alcohol misuse (appendix 2 p 9). 15 199 (3-7%) of 414637 pupils had been excluded from school at least once, 243 (0-1%) of whom were excluded permanently. 1979 (13 -0%) of 15 199 had a neurodevelopmental disorder, 3161 (20-8%) had a mental disorder, and 1518 (10 -0%) had a record of self-harm. 4568 (30 -1%) were diagnosed while of school age, of whom 1925 (42 -1%) had a neurodevelopmental disorder, 2048 (44-8%) had a mental disorder, and 1291 (28-3%) had a record of self-harm. Children aged 7-11 years with no record of the studied diagnoses or self-harm were very unlikely to be excluded (1174 [0-5%] of 233 191). They were more likely to be excluded if they had a record of ASD (211 [4-7%] of4464) or conduct disorder (193 [8 -0%] of 2415). Exclusions generally became more common among older children (figure 3). For those with no disorder or self-harm, the proportion of exclusions increased to 2-9% (2770 of95 977) among those aged 15 years, before decreasing to 2-2% (2064 of94 172) in the last year of secondary school (age 16 years). Notable increases in exclusion rates were seen among pupils aged 14 years with ADHD (374 [15-1%] of 2483), conduct disorder (207 [14-5%] of 1433), drugs misuse (205 [24-2%] of 848), alcohol misuse (150 [14-6%] of 1026), and selfharm (443 [10-7%] 4135), although exclusion rates tended to decrease in the final year of secondary school (figure 3). The proportion of pupils with severe mental illness who were excluded was also high, with 16 (17-4%) of 92 with bipolar disorder excluded at age 15 years and 16 (18-4%) of 87 with schizophrenia excluded at age 14 years (figure 3). For the raw counts used to create figure 3, please see the appendix (pp 21-24). Goodness-of-fit tests (appendix 2 p 27) again showed that including sex, age, and deprivation as covariates sequentially improved model fit. Having a neuro-developmental disorder, a mental disorder, or a record of self-harm were all associated with being excluded from school (table 2). After adjusting for sex, age, and deprivation, pupils with a record of drugs misuse had the highest odds of being excluded (table 2). To note, alcohol misuse, self-harm, schizophrenia, and bipolar disorder also had high aORs (table 2). Across disorders, apart from bipolar disorder, boys were significantly more likely to be excluded than were girls (appendix 2 p 13). Boys with a record oflearning difficulties, anxiety, eating disorders, schizophrenia, other psychotic disorders, or self-harm had an OR for being excluded between 2 and 3 (appendix 2 p 13). Being older was associated with a higher odds of exclusion for individuals with a record of most variables studied (OR range 1-09-1-19), except for bipolar disorder, schizophrenia, other psychotic disorders, drugs misuse, and alcohol misuse (appendix 2 p 13). The sample sizes for bipolar disorder and schizophrenia were too small to assess the association of deprivation quintile with exclusion; however, the odds of exclusion were higher in the most deprived areas than in the least deprived areas for all variables apart from other psychotic disorders, with the OR varying from 1-4 (95% CI 1-1-1-9) for those with conduct disorder to 3-3 (2-7-4-0) for those with anxiety (appendix 2 p 13). Pupils in our cohort had up to eight morbidities in total. 41 018 had one morbidity, 12 096 had two, 3495 had three, and 1321 had four or more (appendix 2 p 10). Absenteeism was more likely in pupils with comorbidities than in pupils with one morbidity, except in the case of bipolar disorder (table 1). Pupils with a single diagnosis of an eating disorder, schizophrenia, or other psychotic disorder were not at higher risk of being absent compared with their healthy peers (table 1). When the number of comorbidities was modelled as a covariate, the OR of being absent was between 1-2 and 1-4 for each additional comorbidity, except for bipolar disorder for which the OR was 1-0 (appendix 2 p 11). SEN status did not reduce the ORs for being absent in those with anxiety, eating disorders, schizophrenia, or alcohol misuse (appendix 2 p 12). For those with ADHD, ASD, learning difficulties, conduct disorder, depression, bipolar disorder, drugs misuse, other psychotic disorders, or a record of selfharm, having SEN status reduced the OR for absenteeism to 0^59-0^89 compared with not having SEN status (appendix 2 p 12). The results for pupils with a record before 17 years of age were similar to those of the main cohort, except for pupils with a record of alcohol or drugs misuse, bipolar disorder, or depression who had slightly higher odds of being absent, and for pupils with schizophrenia who had slightly lower odds (table 1). In the group of pupils with more than one morbidity, aORs for being excluded were consistently higher than for those with one morbidity (table 2). When the number of comorbidities was modelled as a covariate, the OR of being excluded was between 1-2 and 1-8 per each additional comorbidity (appendix 2 p 14). SEN status was associated with decreasing ORs for being excluded for those with neurodevelopmental disorders, conduct disorder, depression, bipolar disorder, other psychotic disorders, drugs misuse, and self-harm (appendix 2 p 15). aORs for being excluded differed between the subpopulation diagnosed while at school and the main cohort, depending on the variable (table 2). Of note, there was little difference for neurodevelopmental disorders, the aOR for exclusion was lower for people with schizophrenia when diagnosed while at school, and the aORs for exclusion were somewhat higher for individuals with drugs or alcohol misuse recorded while of school age (table 2). The individual-level yearly absence rate (number of sessions missed/total number of possible sessions per year) was higher in the group with a record of exclusion than in the group without a record of exclusion (appendix 2 p 5). The correlation between individuallevel yearly absence rates and individual-level yearly exclusion rates was r=047 in the full cohort and r=045 for those with recorded exclusions. Discussion Our study, which involved more than 400 000 pupils, highlights that children and young people diagnosed with a neurodevelopmental disorder or mental disorder, or who have a record of self-harm, before 24 years of age are much more likely to miss school than their peers, even after adjusting for age, sex, and deprivation. Our data and study size enabled us to include disorders typically not included in studies of school-aged children, such as rare disorders and disorders that typically present after individuals have left school (eg, schizophrenia), that might confer antecedent clinical vulnerabilities.32 School absenteeism and exclusion rates were higher after 11 years of age for all children but disproportionally more so in those with a record of a disorder or self-harm, even if it was recorded during school age. This finding could reflect a reduced direct influence of parents on older children’s attendance or the smaller size of primary schools compared with secondary schools. Generally, individuals with more than one recorded morbidity were more likely to be absent or excluded than were those with only one morbidity, which was exacerbated with each additional disorder. Within the diagnosed populations, girls with neurodevelopmental disorders, learning difficulties, conduct disorder, depression, other psychotic disorders, or drugs or alcohol misuse were more likely to be absent than were boys, and boys were more likely to be excluded than were girls across all studied disorders apart from bipolar disorder. This finding aligns with the view that boys externalise mental distress through their behaviour, which in turn impacts the school environment and results in their exclusion, whereas girls, and especially those with emotional disorders or delayed diagnosis of neurodevelopmental disorders, tend to be more anxious and withdraw from social contact.32 Age was found to be associated with both outcomes in relation to most disorders. We also found associations between both outcomes and deprivation within most disorders studied. Having SEN status reduced the likelihood of being absent or excluded, most notably for those with records of neurodevelopmental disorders or bipolar disorder, compared with those with a record but no SEN status, potentially highlighting the positive impact of recognition, diagnosis, and educational interventions. Our findings strengthen those found previously in much smaller population-based studies. In the ALSPAC study29 of a UK birth cohort, by 8 years of age, 19% of children with ADHD and 31% of those with conduct disorder were excluded from school compared with 1-9% and 2-8% of those without ADHD or conduct disorder, respectively. In another study ofa UK cohort (BCAMHS),30 psychiatric symptoms (assessed through validated questionnaires) were a significant predictor of exclusions. Our study is based on routinely collected data encompassing a wide range of clinically diagnosed and recorded disorders. It benefits from well documented, often validated, and curated lists of ICD-10 and read (version 2) codes to ascertain each of the disorders. Arguably, diagnoses made by clinicians for those in contact with services provide more complete case ascertainment than do surveys or cohort studies, which are susceptible to selection bias due to low recruitment and high attrition in populations with psychiatric disorders. However, a common feature of all database studies of routinely collected data is the underestimation of the number of disorders in the population as not all those affected consult their GP, or conditions might not be recognised or recorded.33 Additionally, there is no validated measure of the clinical problems recorded, which prevents any estimation of severity, and administrative data are vulnerable to random errors in data entry. This study’s novelty lies in its linkage of education, health (including primary care), and deprivation datasets for a whole population (Wales) at an individual pupil level over 4 school years for a wide range of disorders. Linking health and education data on this scale allows us to gain valuable insights on the education of children with neurodevelopmental disorders, mental health disorders, or self-harm. Because many older adolescents with common mental disorders are managed in primary care, it is important to include this data source. A whole population dataset enabled us to include pupils with rarer conditions such as schizophrenia and bipolar disorder. Linking diagnoses up to the age of 24 years allowed for assessment of conditions more frequently diagnosed after school leaving age (eg, schizophrenia), for which their antecedents or premorbid presentation, such as cognitive or social deficits, apathy, or selfmedication with drugs, might affect attendance and exclusion. We did not take physical comorbidities into account, although we note the strong association between poor mental and physical health,34 because some absences would have been due to physical morbidity and medication rather than the mental or neurodevelopmental disorder, which would have complicated the interpretation of our findings. Our estimates might underestimate the effect of mental health difficulties on exclusions and absenteeism. Younger children will have had less time for evidence of their diagnosis to be recorded, especially for those conditions that tend to appear later in adolescence, and some young people who are diagnosable will not present to services. There is some evidence30 to suggest that, for each diagnosed child, there could be a number that have multiple symptoms but do not meet the criteria for a diagnosis. These children might well have issues at school that could lead to poor attendance or exclusion. Some children, especially those with ADHD, ASD, or learning difficulties, might not have been included in our dataset because they are in schools for children with special educational or behavioural needs or are homeschooled. Different pupils contributed different numbers of years to the analysis. We are satisfied that there were no demographic or mental health-related differences between these pupils. 5 -2% of pupils with education data in the 2013-16 academic years did not have any linked health data and were removed from our analyses. There are various processes through which school attendance might be associated with neurodevelopmental disorders, mental disorders, and self-harm. These processes include disruptive behaviours resulting in exclusion, physical comorbidities or somatic symptoms (eg, stomach pain and headaches) leading to authorised absence, symptoms associated with anxiety and depression leading to school refusal, family problems, and peer problems (eg, bullying). If absence from school results in social isolation and poorer academic performance, it could exacerbate mental health and attendance issues if the cycle is not disrupted. Our study cannot infer causal relationships and further research should focus on the direction of the association, which could be bidirectional for individual disorders and outcomes. Clinical record data might not be ideal to use in these future studies because the documentation in clinical records will not represent an accurate measure of the time of first onset of the symptoms or disorder. However, even without an understanding of the direction or mechanisms of the association, the demonstration of an association using real life outcomes and data is important. Poor school attendance affects the educational attainment of children and future social, developmental, employment, and physical health outcomes. Many governments, including UK Governments, have recognised the importance of regular school attendance and have issued related guidelines, which include penalty notices for the carers or parents of persistently absent children and the use of incentives to encourage high attendance.35 Exclusions from schools in England and Wales are intended to be used in serious breaches of behaviour policies—for violence, sexual abuse, the supply of illegal drugs, or the use of weapons.36,37 Currently, rates of exclusion in England are rising, raising concerns about school-based policies to improve behaviour and support teachers. Similar initiatives are in place in the USA and elsewhere.38 Linking routinely collected health and education data has the potential to improve services for children39 by identifying those in need, alongside gaps in provision. Our analysis clearly shows that children with neuro-developmental disorders, mental disorders, and selfharm spend less time at school. As such, exclusion or persistent absence is a potential indicator for current or future poor mental health that is routinely collected by schools and local education authorities and could be used to target assessment and early intervention.40 There is growing interest in school-based prevention and early intervention programmes that focus on improving the school climate for reducing adolescent mental health problems,41,42 which has relevance now as children return to school following closures and blended learning in response to the COVID-19 pandemic. Other interventions have included psychological interventions that focus primarily on anxiety and depression symptoms.43 Schoolbased mental health provision and integration with mental health services has been highlighted as a major strategic priority in the UK.44 This approach could benefit young people, as supported by our finding that having a SEN status decreases the odds of being absent or excluded, even if it does not remove the risk completely. Attendance and exclusion data, which are already collected by schools, could provide useful information about where to focus sparse resources. School-based mental health prevention strategies might also help to build resilience, enabling pupils to develop strategies for managing and improving their mental health and wellbeing, and to understand when and how to seek additional help. Future research could further explore whether improvements in school attendance over time serve to reduce the incidence of mental disorders and whether the timing of diagnosis is an important factor in the risk for absenteeism or exclusions. This can be done by looking at causal relationships between mental health and school outcomes using a longer follow-up period. Other avenues for research include evaluating the effect of physical comorbidities on school outcomes and the differential associations of pairs of disorders with school outcomes. To conclude, people up to 24 years of age who have mental or neurodevelopmental disorders or self-harm have poorer attendance at school than their peers who do not have disorders or self-harm. Exclusion or persistent absence is a potential indicator of current or future poor mental health that is routinely collected by schools and local education authorities and could be used to target assessment and early intervention. Articles 16 Frojd SA, Kaltiala-Heino R, Marttunen MJ. Does problem behaviour 31 affect attrition from a cohort study on adolescent mental health? Eur J Public Health 2011; 21: 306-10. 32 17 Wolke D, Waylen A, Samara M, et al. Selective drop-out in longitudinal studies and non-biased prediction of behaviour 33 disorders. Br J Psychiatry 2009; 195: 249-56. 18 Saiepour N, Ware R, Najman J, Baker P, Clavarino A, Williams G. Do participants with different patterns of loss to follow-up have 34 different characteristics? A multi-wave longitudinal study. J Epidemiol 2016; 26: 45 49. 19 Ford DV, Jones KH, Verplancke JP, et al. The SAIL Databank: building a national architecture for e-health research and 35 evaluation. BMC Health Serv Res 2009; 9: 157. 20 Lyons RA, Jones KH, John G, et al. The SAIL databank: linking multiple health and social care datasets. BMC Med Inform Decis Mak 36 2009; 9: 3. 21 Sadler K, Vizard T, Ford T, et al. Mental health of children and young people in England, 2017. Nov 22, 2018.https://digital.nhs.uk/ data-and-information/publications/statistical/mental-health-of-children-and-young-people-in-england/2017/2017 (accessed 37 Nov 12, 2021). 22 NHS Digital. Read codes. 2018. https://digital.nhs.uk/services/ terminology-and-classifications/read-codes (accessed Nov 2, 2021). 38 23 Estyn. Effective practice in improving attendance in primary schools—June 2015. June 12, 2015. https://www.estyn.gov.wales/ thematic-report/effective-practice-improving-attendance-primary-schools-june-2015 (accessed Nov 2, 2021). 39 24 Estyn. Attendance in secondary schools—September 2014. Sept 1, 2014. https://www.estyn.gov.wales/thematic-report/ attendance-secondary-schools-september-2014 (accessed 40 Nov 2, 2021). 25 Department of Education. A guide to absence statistics. March, 2019. https://assets.publishing.service.gov.uk/government/ 41 uploads/system/uploads/attachment_data/file/787314/Guide_to_ absence_statistics_21032019.pdf (accessed Nov 2, 2021). 26 Welsh Government. Absenteeism from secondary schools, 2018/19. Aug 29, 2019. https://gov.wales/sites/default/files/statistics-and- 42 research/2019-08/absenteeism-from-secondary-schools-september-2018-august-2019-318.pdf (accessed Nov 2, 2021). 27 Hojsgaard S, Halekoh U, Yan J. The R package geepack for 43 generalized estimating equations. J Stat Softw 2006; 15: 1-11. 28 Liang KY, Zeger SL. Regression analysis for correlated data. Annu Rev Public Health 1993; 14: 43-68. 29 Paget A, Parker C, Heron J, et al. Which children and young people 44 are excluded from school? Findings from a large British birth cohort study, the Avon Longitudinal Study of Parents and Children (ALSPAC). Child Care Health Dev 2018; 44: 285-96. 30 Ford T, Parker C, Salim J, Goodman R, Logan S, Henley W. The relationship between exclusion from school and mental health: a secondary analysis of the British Child and Adolescent Mental Health Surveys 2004 and 2007 Psychol Med 2018; 48: 629-41. Pan W. Akaike’s information criterion in generalized estimating equations. Biometrics 2001; 57: 120-25. Pine DS, Fox NA. Childhood antecedents and risk for adult mental disorders. Annu Rev Pyschol 2015; 66: 459-85. John A, Marchant AL, Fone DL, et al. Recent trends in primary-care antidepressant prescribing to children and young people: an e-cohort study. Psychol Med 2016; 46: 3315-27. van der Lee JH, Mokkink LB, Grootenhuis MA, Heymans HS, Offringa M. Definitions and measurement of chronic health conditions in childhood: a systematic review. JAMA 2007; 297: 2741-51. Welsh Assembly Government. Strategies for schools to improve attendance and manage lateness. 2011. https://dera.ioe.ac. uk/2945/3/110308section3en.pdf (accessed Nov 2, 2021). Department for Education. Exclusion from maintained schools, academies and pupil referral units in England. September, 2017. https://assets.publishing.service.gov.uk/government/uploads/ system/uploads/attachment_data/file/641418/20170831_Exclusion_ Stat_guidance_Web_version.pdf (accessed Nov 2, 2021). Welsh Government. Exclusions from schools and pupil referral units (PRU). April 1, 2015. https://gov.wales/exclusion-schools-and-pupil-referral-units-pru (accessed Nov 2, 2021). US Department of Education. Key policy letters signed by the Education Secretary or Deputy Secretary. Oct 7, 2015. https://www2. ed.gov/policy/elsec/guid/secletter/151007.html (accessed Nov 2, 2021). Downs J, Gilbert R, Hayes RD, Hotopf M, Ford T. Linking health and education data to plan and evaluate services for children. Arch Dis Child 2017; 102: 599-602. Kearney CA, Graczyk P. A response to intervention model to promote school attendance and decrease school absenteeism. Child Youth Care Forum 2014; 43: 1-25. Shinde S, Weiss HA, Varghese B, et al. Promoting school climate and health outcomes with the SEHER multi-component secondary school intervention in Bihar, India: a cluster-randomised controlled trial. Lancet 2018; 392: 2465-77. Bonell C, Blakemore S-J, Fletcher A, Patton G. Role theory of schools and adolescent health. Lancet Child Adolesc Health 2019; 3: 742-48. Fleming T, Dixon R, Frampton C, Merry S. A pragmatic randomized controlled trial of computerized CBT (SPARX) for symptoms of depression among adolescents excluded from mainstream education. Behav Cogn Psychother 2012; 40: 529-41. Department of Health & Social Care, Department for Education. Transforming children and young people’s mental health provision: a green paper. December, 2017. https://assets.publishing.service.gov. uk/government/uploads/system/uploads/attachment_data/ file/664855/Transforming_children_and_young_people_s_mental_ health_provision.pdf (accessed Nov 2, 2021). 34 www.thelancet.com/psychiatry Vol 9 January 2022