Within and between classroom transmission patterns of seasonal inuenza and implications for pandemic management strategies at schools

Schools can play a central role in driving infectious disease transmission. Strategies for safe operation of schools during pandemics therefore need to carefully consider both the eciency of measures for infection control and the impact on children through lost face-to face schooling time. Heterogeneous social contact patterns associated with the social structures of schools (i.e. classes/grades) are likely to inuence the within-school transmission dynamics; however, empirical evidence on the ne-scale transmission patterns between students has been limited. Using a mathematical model, we analysed a large-scale dataset of seasonal inuenza outbreaks in Matsumoto city, Japan to infer social interactions within and between classes/grades from observed transmission patterns. The overall within-school reproduction number, which determines the initial growth of cases and the risk of sustained transmission, was only minimally associated with class sizes and the number of classes per grade. We then used these patterns in a model parameterised separately to COVID-19 and pandemic inuenza, and simulated school outbreaks under multiple strategies for minimising the risk of within-school transmission. Simulations suggested that with such transmission patterns, interventions changing class structures (e.g. reduced class sizes) may not be effective in reducing the risk of major school outbreaks upon introduction of a case and that other precautionary measures (e.g. screening and isolation) need to be employed. Class-level closures in response to detection of a case were suggested to be effective in reducing the size of an outbreak when regular screening tests for students are not available. seasonal inuenza from over 10,000 primary school students. This calibration allowed us to capture granular social contact patterns relevant to respiratory virus transmission in schools. We then embedded these estimates of the impact of class, grade and school sizes on social contact patterns into a dynamic model of SARS-CoV-2. Using this model, we assessed the risk and size of outbreaks under current COVID-19 interventions in use widely such as changes in class structure, screening and isolation, intermittent schooling and responsive class closures, and we evaluated the ecacy of school-based pandemic management strategies. We conducted sensitivity analysis by also adapting the model with transmission parameters of pandemic inuenza in order to assess the robustness of these optimal strategies to a different pathogen.


Background
With the emergence and rapid growth of the coronavirus disease 2019 (COVID-19) outbreak in early 2020, many countries decided to enforce school closures to prevent schools from becoming hotspots of transmission and thereby mitigate the further spread in the population [1,2].
Worldwide, there is much variability in how to balance these epidemic control measures and access to education. For example, many countries (including most European countries) had reopened schools by late 2020, employing a range of precautionary measures such as increased ventilation, enhanced hygiene, reduced class sizes and the introduction of 'social bubbles' (i.e. limiting contacts to small groups of students) [3]. Other countries took a different approach; as of 8 March 2021, in some countries (including the US and Canada) schools are only partially open, while in 26 countries schools remain closed [2]. Such diverse policies may in part re ect our still limited understanding of the potential role of schoolchildren in the transmission of severe acute respiratory syndrome virus 2 (SARS-CoV-2). While most infections are mild or asymptomatic among children [4][5][6][7], serology and outbreak investigations have shown that children can contribute to transmission [8][9][10][11][12]. Reports of COVID-19 outbreaks in school settings are relatively rare even after the full reopening of schools [13][14][15]; however, these data need to be interpreted with caution as multiple factors including asymptomatic infections, variability in transmission and enforcement of precautionary measures could have been involved. There have been sporadic reports of large outbreaks associated with schools in various countries [16][17][18] and there is therefore uncertainty in the public health risk to students, teachers and the wider community when schools eventually reopen as normal.
A decision whether and how to keep schools open during a pandemic will need to weigh the rights and welfare of children and their families against the public health implications. Although such policy should ideally be evidence-based, supporting data on outbreak risks and possible interventions in school settings are scarce. The few existing studies that assess the effect of school reopening plans on COVID-19 have three important limitations [19,20]. First, they assume that the contact rates of students are proportional to the number of students attending, which is not empirically validated. This assumption of density-dependent mixing necessarily entails that reducing student attendance (e.g. by introducing small class sizes or staggered attendance) would uniformly scale down the transmission risk, which may overestimate the effect of interventions. Second, while school-based interventions aim to reduce social contact within and between classes and grades, previous studies have not been able to parameterise the corresponding contact rates from empirical data. Third, previous studies on within-school transmission dynamics were based on a limited number of schools and thus did not provide robust ndings across schools or capture the full range of heterogeneity present [21,22].
To overcome these limitations, we rst quanti ed social interaction within and between classes and grades by calibrating a model of pathogen transmission via direct contact to a dataset of seasonal in uenza from over 10,000 primary school students. This calibration allowed us to capture granular social contact patterns relevant to respiratory virus transmission in schools. We then embedded these estimates of the impact of class, grade and school sizes on social contact patterns into a dynamic model of SARS-CoV-2. Using this model, we assessed the risk and size of outbreaks under current COVID-19 interventions in use widely such as changes in class structure, screening and isolation, intermittent schooling and responsive class closures, and we evaluated the e cacy of school-based pandemic management strategies. We conducted sensitivity analysis by also adapting the model with transmission parameters of pandemic in uenza in order to assess the robustness of these optimal strategies to a different pathogen.

Results
Transmission patterns of seasonal in uenza in primary schools and estimated effects of school interventions on the reproduction number We analysed the citywide survey data of 10,923 primary school students (5-12 years old) in Matsumoto city, Japan in 2014/15, which included 2,548 diagnosed in uenza episodes of students (Fig. 1A). The dataset was obtained from 29 schools with a range of class structures (sizes and the number of classes per grade), allowing for ne-scale analysis of within and between class transmission patterns (Fig. 1B). Using a mathematical model that accounts for different levels of interaction within and between classrooms and grades, we estimated the within-school effective reproduction number R S of seasonal in uenza in primary schools along with the breakdown of transmission risks associated with class/grade relationships (Fig. 1C). The relationship between any pair of students in the same school was classi ed as either "classmates", "grademates" (in the same grade but not classmates) or "schoolmates" (not in the same grade). The estimated R S was broken down as a sum of the contributions from these students, where the class size (n) and the number of classes per grade (m) was assumed to affect the risk of transmission. The reconstructed overall R S in a 6-year primary school was estimated to be around 0.8-0.9 consistently and was minimally affected by n or m. Namely, an infected student was suggested to generate a similar number of secondary cases irrespective of the class structure. Transmission to classmates accounted for about two-thirds of R S when each grade has only one class and was partially replaced by transmission to grademates as the number of classes per grade increases, while the sum of within-grade transmission (i.e. transmission to either classmates or grademates) remained stable. Around 20-30% of overall R S was explained by transmission to schoolmates throughout.
Assuming that the relative contribution of class/grade relationship to the transmission risk is generally conserved in the dynamics of directlytransmitted diseases, we predicted the potential effects of interventions altering the school population structure (e.g. class sizes). The estimated relative effects of school-based interventions (summarised in Table 1) on R S in a hypothetical setting of 6-year school with 2 classes per grade (40 students each) showed that splitting classes or staggered attendance alone is unlikely to reduce R S (Fig. 1D), which is consistent with the aforementioned estimates of R S minimally associated with class sizes and the number of classes. By reducing interactions between students from different classes ('class distancing/bubbling') by 90%, R S could be reduced by up to around 20%.
Combining split classes/staggered attendance and reduced interactions outside classes did not suggest incremental bene t in reducing R S .

Simulation of COVID-19 outbreaks in school
We reconstructed the time-dependent infection pro le (i.e. the temporal distribution of secondary transmissions as a function of time after infection of the primary case) of SARS-CoV-2 from distributions reported in the literature [24,25] and assessed the possible reduction in R S by screening either by symptoms or regular testing (Fig. 2). If every student showing COVID-19-like symptoms is asked to isolate, postsymptomatic transmission within the school will be prevented. Post-symptomatic transmission is estimated to account for about half of the total secondary transmission of symptomatic individuals [24] and therefore expected to suppress the right tail of the infection pro le.
However, since symptom-based isolation will not apply to asymptomatic infections, the proportion of preventable transmission decreases with smaller assumed symptomatic proportions ( Fig. 2A). A recent study estimated 50% of seropositive children aged 2-15 years were symptomatic [26], and the performance of symptom screening could be even lower if some mild/atypical symptoms were missed in screening.
In addition to symptom screening, we also considered screening by regular testing. The daily rate of infectious students detected by a test (who will be asked to isolate from the next day) is given by the product of the frequency and sensitivity of the test ('effective testing rate').
Combined with symptom screening, regular testing could further reduce the risk of transmission (Fig. 2B). Of note, 10-20% daily effective testing rate (roughly corresponding to performing an over 70% sensitive test once a week) is suggested to be su cient to reduce the reproduction number by 40-70% and the effect saturates after the rate exceeds 30% (Fig. 2C).
We interpreted the estimated within-school transmission patterns (i.e. the strati ed school reproduction number) of seasonal in uenza as re ecting social interaction among students which can then be used to study the dynamics of infectious diseases that share similar modes of transmission. By combining these patterns with the infection pro le of SARS-CoV-2 (known to have a longer course of infection than in uenza), we simulated possible outbreaks of COVID-19 in a 6-year school triggered by a single case introduced from outside (Fig. 3). For each of the three R S values assumed (1.8, 1.2, 0.8), temporal patterns of disease spread across the school were simulated and compared between interventions. Without interventions, an outbreak can reach the whole school 50-60 days after the introduction at earliest in scenarios where R S is above one. Given the estimated transmission patterns, the simulation also suggested that infection in a class can quickly spread to classes in different grades, indicating that an outbreak may be less likely to be contained within a grade. Interventions that change the size or the number of classes (split class and staggered attendance) were not predicted to contribute to the outbreak control (Fig. 3A). Screening by symptoms and regular testing was suggested to be effective (Fig. 3B). If 50% of infected students can be detected by symptoms at some point during their infectious period, symptom screening alone could render the scale of an outbreak with R S = 1.2 comparable to one with R S = 0.8 with no intervention. A combination of symptom screening and regular testing (effective test rate of 10%) could even bring an outbreak with R S = 1.8 to a similar level. Intermittent schooling (setting regular "off" days on which students do not attend on-site classes) was also suggested to be effective. Alternating 'on' and 'off' every day was su cient to suppress the outbreak. If combined with symptom screening, more days could be spent on-site (2 days 'on': 1 day 'off') while achieving the equivalent control of the outbreak.
To simulate outbreaks with 'class distancing', where between-class interactions are reduced (e.g. by enforcing 'social bubbles' within school), we employed two different assumptions on the change in within-class interactions. While within-class interaction may remain constant when interactions with students outside the class are restricted, it could also cause an increase in the within-class interaction to compensate for the reduction outside the class, similar to our estimates of transmission risks between grademates. Although the scale of the outbreaks became smaller than the baseline irrespective of the presence of compensation, the effect was smaller than other interventions (screening or intermittent schooling), especially in the presence of compensation effects (Fig. 3C).
From the simulation results with a single initial case for each intervention scenario, we estimated the risk of outbreaks involving over 10 or 30 secondary transmissions given multiple introductions of cases from outside the school (Fig. 3D). With an increase in the number of introductions, the risk of large outbreaks was suggested to rapidly increase. The results imply that when multiple introductions are expected due to high levels of community transmission, it may be safe to ensure that the school reproduction number R S is around 0.5 or below; otherwise only up to 10 introductions would be su cient to pose a non-negligible risk of a large school outbreak. The risk decreases if we assume an excessive overdispersion as is observed with SARS-CoV-2 [27]; however, the results exhibit qualitatively similar patterns and R S of 0.5 should remain to be the primary target.

Managing school outbreak of COVID-19 by single-class closures
We explored the conditions that allow for effective control by class closures instead of a whole school closure by assessing the simulated spread of infections by the time the outbreak is rst recognised either by symptoms or regular tests (Figs. 4A-C). If the case nding depends only on symptoms, it is fairly likely (~ 50% or more) that more infections have spread unnoticed when the rst case is recognised. Moreover, there is a chance of 25% or more that unnoticed infections also exist outside the class of the rst detected case ('spillover'), which suggests that closure of that class alone may be insu cient for containment. If the proportion symptomatic is lower than 50% reported in [28], the outbreak could reach a substantial size (even over 10 or 20 infections) by the time the rst case shows symptoms. Introducing regular testing, even at the effective testing rate of 10%, could markedly reduce the chance of undetected spread. The risk of outside-class spillover by the time of detection is limited to around 10%, which opens a possibility for control by closing only one class (or a few additional classes in the case of a rare event). If regular testing is not available and thus case nding needs to depend on the presence of symptoms, another possible option is to implement class distancing well before an outbreak is recognised to reduce the risk of spillover upon detection. When 50% of infections are symptomatic, reducing outside-class interaction by 50% is predicted to render the spillover risk comparable to the 10% testing scenario. Similar results were obtained even in the presence of a compensatory increase in the within-class interactions ( Figure S6A).
We then simulated outbreaks of COVID-19 in schools where the single-class closure strategy is in operation, i.e. a class is closed for 14 days if any student in the class is found to be infected (either by showing symptoms or testing positive) while other classes with no detected infection keep operating (Figs. 4D, 3E). Although the single-class closure strategies were suggested to be effective in outbreak containment across the settings considered, the 'naive' strategy with no regular testing or class distancing tended to result in a larger outbreak and more class closures, indicating the loss of education opportunities. This difference was particularly marked when the proportion of symptomatic infections is smaller ( Figure S5). Incorporating regular testing or class distancing showed better performance both in terms of outbreak containment and education opportunities; regular testing resulted in smaller outbreak sizes while class distancing required less class closure, although the differences were minor. However, the results of regular testing combined with single-class closures warrant caution because the outcome was not substantially different from the isolation-only scenario with 10% regular tests; such marginal bene t may not be worth the loss of education opportunities. These results suggest that when regular tests are available, asking only test-positive students to isolate may be preferable to a class closure. Regular testing can identify infected students early in their infectiousness period; therefore, it becomes more likely that isolation alone is su cient to prevent further transmissions.

Simulation of pandemic in uenza outbreaks in schools
As a sensitivity analysis, we applied our pandemic management approaches discussed as above in the context of COVID-19 to another potential threat-pandemic in uenza. Compared with COVID-19, in uenza tends to exhibit a shorter time course (i.e. shorter generation time and incubation period), which may affect the effectiveness of screening by symptoms/regular tests. Although empirical data is relatively scarce on the symptomatic ratio of past pandemic in uenza strains, that of seasonal A/H1N1 or A/H3N2 in uenza strains in primary schoolage children has been estimated to be around the range of 25-50% [29][30][31], in line with that of SARS-CoV-2 in children [28].
The infection pro le constructed from the serial interval distribution used for the inference of the Matsumoto city data (mean: 2.2 days [32]) and the incubation period distribution of in uenza A (median: 1.4 days [33]) re ected the possible scenario where screening by symptoms or regular tests may be less effective than SARS-CoV-2 because the majority of infections may occur before isolation due to shorter infection cycles (Fig. 5B). In this setting, screening by symptoms and regular testing with 10-20% effective testing rates could reduce the reproduction number by only up to 30-40%-about half of what was estimated for SARS-CoV-2.
Outbreak simulations with various interventions overall showed similar patterns to COVID-19 except that screening by symptoms/regular tests was suggested to be less effective for pandemic in uenza than for COVID-19 (Fig. 5A). Notably, another difference was that combining "2 days on: 1 day off" intermittent schooling and symptom screening was less effective than the COVID-19 simulation and no longer had an equivalent effect to "1 day on: 1 day off" intermittent schooling. Single class closure strategies improved the outcome in most cases, although they resulted in larger outbreak sizes and more closures than in the COVID-19 simulation (Figs. 5C, 4D). Combining class closures with regular testing, which was not suggested to be cost-effective for COVID-19, exhibited a plausible level of performance for pandemic in uenza.

Discussion
We employed a mathematical model that strati es transmission within and between classes/grades to understand and simulate the dynamics of directly-transmitted respiratory diseases at school. A citywide primary school seasonal in uenza epidemic data was used to calibrate the model and a range of interventions were assessed in simulations of COVID-19 and pandemic in uenza outbreaks. We used one of the largest datasets of school outbreaks with over 10,000 students and 2,500 cases in a single epidemic season, which we believe provides the best available evidence on the transmission patterns within schools. Moreover, given that documented COVID-19 outbreaks in schools has been small in size compared with those of in uenza, this dataset likely remains to be one of the most important resources to assess school transmission risks in the current COVID-19 pandemic as well as future pandemics.
The inferred transmission dynamics of seasonal in uenza in Matsumoto city suggested that the within-school reproduction number R S was, unlike as is often assumed, almost constant regardless of the size or the number of classes ('frequency-dependent mixing' [34]). The estimated R S of 0.8-0.9, more than half of which was attributable to within-class transmissions, is consistent with a previous study in the United States [21] and also in line with the reported R 0 of 1.2-1.3 for seasonal in uenza [35] provided that students in this dataset were previously estimated to have infected 0.3-0.4 household member on average [36]. The value of R S below 1 suggests that the outbreak cannot sustain itself within school alone and that interactions through importing and exporting infections between households and the general community is likely to play a crucial role in the overall transmission dynamics.
The estimated breakdown of R S showed intriguing patterns. As the number of classes per grade increases, the contribution of within-class transmission risk declines and is replaced by within-grade transmission. Combined with the almost constant overall R S , this might indicate that contact behaviour between students that contributes to transmission is only minimally affected by the student population density. That is, students may have a certain number of 'close friends' with whom they have more intimate interactions that could facilitate transmission.
In a school with more classes per grade, some of such friendship comes from grademates instead of classmates, but the total number of close friends remains similar. This interpretation is in line with our understanding of in uenza spreading predominantly in close proximity [37], and can have a non-negligible impact on the expected effect of interventions on not only in uenza but also SARS-CoV-2, which shares similar routes and range of transmission [38,39]. Our results suggested that interventions such as reducing class sizes or the number of students present (staggered attendance) may be less effective than what is expected under the density-dependent mixing assumption. If interventions altering class structures are not accompanied by additional precaution measures and students try to resume their 'natural' behaviours (i.e. the same contact patterns as those in school with the resulting class structures) through so-called social contact 'rewiring' [40], the effect of such interventions can diminish or even reverse. For example, if other classes are absent due to staggered attendance, students may increase their interactions with classmates instead of their previous close friends in other classes. We propose that reducing the class sizes or the number of attending students should be considered only if they enable effective implementation of precaution measures such as physical distancing, environmental cleaning or forming social bubbles.
Simulated school outbreaks of COVID-19 and pandemic in uenza suggested two possible directions of management strategies. One of them is the 'preemptive' approach, which tries to reduce R S before the emergence of an outbreak by interventions. If R S is kept su ciently small during everyday operation by incorporating various intervention methods (e.g. screening based on symptoms or regular tests, reducing outside-class interactions and intermittent schooling), a school would be resistant to sustained transmission. We believe that the preemptive approach should aim R S of at most around 0.5 such that the risk of large outbreaks is kept at a low level (~ 10% or less) even with multiple introductions from outside school. This approach is likely to require combining multiple intervention methods if the baseline R S is high; however, if successfully implemented, it may also ensure that schools can operate nearly as normal even amid ongoing community transmission. Alternatively, schools could also decide to operate with less stringent measures and take a 'responsive' approach, where only students in classes with at least one con rmed case will isolate (single-class closure). This strategy requires less intensive baseline measures and thus could be more e cient and pragmatic in low community transmission settings. Moreover, it allows ramping up control efforts according to the actual intensity of outbreaks (i.e. the scale of closure follows that of an outbreak). For the responsive approach to work, the outbreak needs to be recognised before it spreads outside the initially-affected class. Reduced outside-class interactions will assist this and are expected to reduce both the scale of outbreaks and class closures. While regular testing combined with the responsive approach could also bring a similar effect, it was not suggested to be cost-effective for COVID-19 because isolating only test-positive students (without class closure) was predicted to achieve similar outcomes with minimal loss in education opportunity (except for some of the pandemic in uenza scenarios assuming shorter infection cycles). That is, if a school can afford regular testing of students, the preemptive approach will allow su cient control and class closures may not be necessary. Alternatively, in such resource-rich settings, intensive testing of a whole class where a positive case is found may achieve the same effect as a class closure in the responsive approach, which may be preferable in some settings as it allows uninfected students to remain at school.
When designing an overall school outbreak management plan, the strengths and weaknesses of intervention measures should be evaluated. Regular testing is a powerful intervention that enables prompt detection and isolation of cases, which leaves responsive class closures almost unnecessary. In our simulations, the effective daily testing rate of 10% exhibited su cient performance in most cases. Using tests with a reasonably high sensitivity (~ 70% or above), this means the frequency of tests need not be more than once a week. Although this would ease the required logistical burden, the option may not always be available to every school due to multiple aspects of resource constraints. Invasive nature of regular testing should also be recognised as students are a vulnerable population; less-inasive methods such as saliva tests need to be considered [41]. The issue of false-positive also needs to be noted. Effective testing rate of 10% means that a 99.9% speci c test may produce a false positive more than once a month on average, although this may be balanced by the reduction in the outbreak risk if only positive (including false-positive) students are isolated. Testing kits have different levels of speci city and should be selected considering the overall bene t given the risk of false positives. Meanwhile, screening by symptoms is unlikely to suffer from this issue since it will be reasonable to ask symptomatic students to stay at home regardless of the actual cause. However, symptom lists should be broadly de ned such that mild symptoms (including those not typically considered as illness, e.g. loss of smell/taste for SARS-CoV infection [26]) also isolate. Potential effectiveness of symptom screening in preventing COVID-19 in schoolchildren was also suggested by a large-scale online survey [42]. Intermittent schooling is another powerful intervention better coupled with the preemptive approach, which reduces the number of days infectious students spend at school, irrespective of whether they are identi ed as cases. In our simulations, students were assumed to stay home once in two or three days. While this can result in missed opportunities for education, if considered in combination with weekends, it may be achievable only at the cost of one or two days of in-class teaching. Missed opportunities could even be mitigated by introducing online teaching on these "off" days. Compared with staggered attendance, intermittent schooling may be logistically more feasible as it does not require separate courses for split groups of students. Choice and combination of intervention measures should consider the risk assessment, current situation of community transmission and practical constraints.
Several limitations of this study should be noted. First, the transmission patterns within schools were estimated from a single dataset of seasonal in uenza in primary schools (aged 5-12 years) in Matsumoto, Japan, and it is unclear to what extent the results can be extrapolated to other settings, e.g. secondary schools. Some features of our results may still be relevant to transmission dynamics in different types of schools if they re ect general social contact behaviours of schoolchildren; however, the relative contribution of withinclass/within-grade interactions may become smaller for older students [43]. The data points used in the inference mostly consisted of classes of size 20-40 (those with a size smaller than 10 were excluded as they might be operated differently) and most schools had no more than 5 classes per grade. Our simulation was also limited to within this range for internal consistency and thus is not necessarily applicable to class structures outside this range (e.g. splitting a class of 20 students into two). Since the illness data of teachers were not available, they were not considered throughout the analysis, although their role in seasonal in uenza transmission may have been minor. Second, there were potential sources of bias inherent to the nature of the dataset which was not necessarily fully addressed. Most importantly, the original study was an observational study and thus the differences in the transmission patterns between schools of different class structures might not be causal. Interventions employed during the outbreak may also have been different between schools. We assumed that if class structures were altered by interventions, students would rewire their contacts according to the new class structure. However, students may respond differently in interventional settings, which could not be validated in observational studies. Although we believe our student incidence data had a better quality than most existing studies given encouraged medical attendance and con rmation by rapid diagnostic kits [36], a certain proportion of infections (e.g. asymptomatic or very mild) may have been missing from data. We believe that students feeling unwell due to in uenza mostly attended medical institutions and received a test as it was encouraged by schools. Nonetheless, it should be noted that this could have been a source of bias in the estimated transmission patterns. Students with very mild symptoms (e.g. only slight sore throat) may visit a medical institution only if they know of other classmates also diagnosed with in uenza. If such cases were common, the contribution of within-class transmissions in our results might have been an overestimate. Third, the epidemiological properties used in our simulations were subject to a number of assumptions. Within and between class/grade transmission patterns of COVID-19 and pandemic in uenza were assumed to be proportional to those of seasonal in uenza and scaled by the chosen R S in the simulation. However, modelling studies often use similar assumptions of proportionality between transmission and social contacts [19,44] and we believe our approach has strength over such studies as it could indirectly measure social contacts in the context of transmission. Infections acquired from household and general community were not explicitly modelled and simply treated as external introductions. Temporal pro les of infectiousness were based on limited data and also neglected individual-level variation. These may need to be updated in the future to re ect newer data; currently, the simulation results should be interpreted as a scenario analysis rather than conclusive predictions.
The present study offers novel insights into the transmission patterns in school settings re ecting class/grade structures. We believe these results would not only inform modelling studies that incorporate transmission dynamics in schools but also aid planning and assessment of outbreak management strategies at school for the current and future pandemics.

Data
We analysed a citywide school-based in uenza survey data from 2014/15 season. The survey was conducted in Matsumoto city, Japan, enrolling 13,217 students from all 29 public primary schools in the city. During the survey period (from October 2014 to February 2015), the participants were asked to ll out a questionnaire when they are back from the suspension of attendance due to diagnosed in uenza (prospective survey). In March, the participants were asked to respond to another survey on their experience during the study period, regardless of whether they had contracted in uenza (retrospective survey). A total of 2,548 diagnosed in uenza episodes were reported in the prospective survey, which accounted for 96% of the cases o cially recognised by the schools during the study period. Primary schools in Japan often requested students suspected of in uenza to seek for diagnosis at a medical institution. All students reporting an in uenza episode in the prospective survey answered that they had received a diagnosis and at least 95% of them were noticed of type A in uenza (indicating that they were lab-con rmed). In the retrospective survey, 11,390 (86%) participants responded, among which 8,375 reported that they did not have in uenza during the study period.
We combined those who responded to the prospective survey ("case group") and those who reported no in uenza experience in the retrospective survey ("control group") and obtained a dataset of 10,923 students. Of those, 71 students from 3 schools with less than 10 students per grade were excluded because they may have different schooling patterns from other schools (e.g. some students in different grades shared classrooms). We used individual pro les (sex, school, grade, class, household composition), onset dates, in uenza episodes of household members and precaution measures students engaged in (vaccine, mask, hand washing) in the subsequent analysis. Further details of the dataset can be found in the original studies [23,45].
The secondary data analysis conducted in the present study was approved by the ethics committee at the London School of Hygiene & Tropical Medicine (reference number: 14599).

Inference model
We modelled within-school transmission considering class structures as follows. We de ned the "school proximity" d between a pair of students i and j attending the same school as d ij = To investigate the potential effect of reduced class sizes and the number of attending students, we modelled the transmission between students as a function of two variables: the class size n and the number of classes per grade m (i.e. the number of students per grade is nm). Namely, we assumed that in the absence of any individual covariate effects, the transmissibility between student i and j in proximity d is represented as where β d , γ d , δ d are parameters to be estimated. When i and j are in the same grade (i.e. d = 2, 3, 4), the average class size and the number of classes in that grade were used as n i , d and m i , d . When d = 1, the school average was used as n i , d and m i , d . The exponent parameters within the same class were assumed to be equal: γ 3 = γ 4 and δ 3 = δ 4 .
We modelled the daily hazard of incidence for student i as a renewal process. Let h τ be the onset-based transmission hazard as a function of serial interval s (normalised such that ∑ ∞ s = 1 h s = 1; h s = 0 for s ≤ 0). We used a gamma distribution of a mean of 1.7 and a standard deviation of 1.0 for in uenza, which resulted in the mean serial interval of 2.2 days [32]. The daily hazard of disease onset attributed to school transmission is given as where v i and w i represent the relative susceptibility and infectiousness, respectively, which are speci ed for each individual by a log-linear regression model to account for potential confounders (see Supplementary materials for detailed methods and a list of covariates included).
In addition to the above within-school transmission, we also considered within-household transmission and general community transmission. The within-household transmission was incorporated as the Longini-Koopman model [46] with parameters from a previous study on the same cohort of students [36]. General community transmission was modelled as a logistic curve tted to the total incidence in the dataset to re ect the overall trend of the epidemic. See Supplementary materials for further details of the model We constructed the likelihood function and estimated the parameters by the Markov-chain Monte Carlo (adaptive mixture Metropolis) method.
We obtained 1,000 thinned samples from 100,000 iterations after 100,000 iterations of burn-in, which yielded the effective sample size of at least 300 for each parameter.
Using the posterior samples, we computed the proximity-speci c reproduction number R d in a hypothetical 6-year school with given n and m (assumed to be constant schoolwide) as and de ned the within-school reproduction number R S as a sum of them.
We predicted the relative reduction in R S under intervention measures changing the number of attending students and class structures by using posterior samples. Interventions were assumed to change n and m as shown in Table 1, and the predictive distribution of the relative change in R S was computed for each intervention. The estimated R S represents the value in a hypothetical condition where an infectious student spends the whole infectious period at school; the effect of absence due to symptoms or the staggered attendance was not included in this reduction.
Temporal infection pro le of SARS-CoV-2 and in uenza We reconstructed the temporal infection pro le of SARS-CoV-2 using distributions estimated originally in He et al. [24] and recalculated in Ashcroft et al. [25]. Since the estimated infection pro le used the date of symptom onset as a reference point, we convolved the distributions of infection pro le incubation period to reconstruct the infection pro le as a function of time from infection. We approximated the infection pro le reported in [25] as a normal distribution N(µ = 0.53, σ = 2.65) and convolved it with the lognormal incubation period distribution LN(µ = 1.43, σ = 0.66) [24] to obtain the infection pro le. This resulted in a 6.8% chance of generation time being 0 day or less due to convolution; we thus used a truncated distribution at t = 0.
The modi cation of infection pro le h τ by screening was modelled as follows. Let U τ represent the survival function against screening, i.e.
the probability that an infected individual remains undetected by day τ post-infection. The infection pro le under symptom screening is represented as where σ is the effective testing rate and F τ is the cumulative distribution of the incubation period.
Similarly, we obtained the infection pro le for in uenza by using the gamma distribution described earlier (from [32]) and the estimated incubation period distribution of H1N1 pandemic in uenza [33].

Simulation of COVID-19 and pandemic in uenza outbreaks in school
We simulated school outbreaks using the estimated transmission patterns within and between classes/grades and infection pro les of SARS-CoV-2 and H1N1 pandemic in uenza. For simplicity, we assumed that transmission risks between students are determined by class/grade structures and neglected the effect of other potential confounders such as sex, age and precaution measures (therefore, grades in the simulations were only for labelling purpose and did not necessarily correspond to actual school years). The inference model used for the Matsumoto city data and posterior samples were used for simulation, where external infection from outside the school (i.e. transmission from households and general community) was excluded except for the initial case. Starting from a single initial case on day 1, the simulation of transmission over 360 days (we did not consider weekends and school holidays for simplicity) was repeated 500 times, each with a different set of posterior samples of parameters.
For each of the assumed value of R S (1.8, 1.2 and 0.8), we rescaled the posterior samples of the proximity-speci c reproduction number R d such that the relative magnitude between R d is conserved and that ∑ 3 d = 1 R d = R S . Different types of interventions (see Table 1) were incorporated into the simulation as follows. R d values corresponding to different n and m were used to simulate the effect of changes in the size and the number of classes. Screening by symptoms and regular testing was implemented by using the modi ed infection pro le in Eq. (5). To represent intermittent schooling interventions, the values of infection pro le on "off" days were manually set to zero. For reduced outside-class interactions scenarios, we reduced R d values corresponding to outside-class interactions by either 50% or 90%. In addition to the "pure reduction" scenarios where outside-class interactions are reduced without counter-effects, we also accounted for a possible compensatory increase in the within-class interactions. We assumed that within-class interactions may increase by 20% to compensate for a 50% reduction outside-class and by 40% to compensate for a 90% reduction.
Using the distribution of nal outbreak size with a single initial case q 1 (x) obtained in the simulation, we also estimated the risk of large outbreaks (i.e. > 10 and > 30 secondary transmissions) given multiple introductions. The nal outbreak size distribution given z introductions q z (x) is obtained as a z-fold convolution of q 1 (x): where δ ( x ) ( y ) is the Kronecker delta.

Assessing the risk of undetected spread of infection
We computed the distribution of the number of unnoticed infections by the detection of the rst case in school by sampling the date of detection in each of the 500 simulation results. Let I t be the number of new infections on day t. The cumulative distribution function (CDF) for the date of detection T D is given as We sampled T D according to this CDF and obtained the number of undetected infections as ∑ T D t = 1 I t − 1. The class which the rst detected student belongs to was also sampled to provide the number of undetected infections outside that class, which was used to specify the spillover risk.

Simulation of single-class closure strategy
The single-class closure strategy was simulated using the same approach as previously described, except that classes have either an 'open' or 'closed' state each day. Students in closed classes were considered to be isolating at home and thus do not transmit to or receive infection from others on that day. For each infected student, the date of detection was sampled with the distribution in Eq. (6) and the class closure started from the day after the rst date of detection among the class. The class closure was assumed to last for 14 days (COVID-19) or 7 days (pandemic in uenza). To assess the effectiveness of closure strategies, we compared the proportion of students experiencing infection by the end of the outbreak against the simulation results in the same settings but without closures.
All analysis was performed in Julia 1.2.0. Replication code is available on GitHub (https://github.com/akiraendo/schooldynamics_FluMatsumoto14-15). Figure 1 Transmission dynamics of seasonal in uenza in primary schools in Matsumoto city and estimated effects of interventions for SARS-CoV-2. Each dot represents a class in the dataset. Dots are jittered along the x-axis. Three schools had classes of fewer than 10 students (denoted by dotted horizontal line) and were excluded from the analysis. (C) School reproduction number (RS) and its breakdown by the class/grade relationship (median estimates). (D) Relative change in the school reproduction number under school-based interventions. Dots represent medians and whiskers 95% credible intervals. Reduced outside-class transmissions (i.e. from grademates or schoolmates) were also considered (50% reduction: blue; 90% reduction: green).

Supplementary Files
This is a list of supplementary les associated with this preprint. Click to download. supplementv1.0.docx