P. falciparum as a function of age and transmission intensity. We focus on: anti-parasite immunity (i.e. ability to control parasite densities) and anti-disease immunity (i.e. ability to tolerate higher parasite densities without fever). Our findings suggest a strong effect of age on both types of immunity, not explained by cumulative-exposure. They also show an independent effect of exposure, where children living in moderate/high transmission settings develop immunity faster as transmission increases. Surprisingly, children in the lowest transmission setting appear to develop immunity more efficiently than those living in moderate transmission settings. Anti-parasite and anti-disease immunity develop in parallel, reducing the probability of experiencing symptomatic malaria upon each subsequent P. falciparum infection.Fundamental gaps remain in our understanding of how immunity to malaria develops. We used detailed clinical and entomological data from parallel cohort studies conducted across the malaria transmission spectrum in Uganda to quantify the development of immunity against symptomatic  Plasmodium parasite. One parasite in particular, Plasmodium falciparum, is responsible for most malaria-related deaths across the globe. A person can be infected by P. falciparum many times throughout their life. However, after children have had multiple infections, they become less likely to develop symptoms of malaria, such as high fever. In other words, they gradually acquire immunity.Malaria kills around 500,000 children every year. The disease occurs when an infected mosquito bites a human and passes on a This immunity to malaria can come in two forms: “anti-parasite immunity”, where the body fights the parasites and keeps their numbers low; and “anti-disease immunity”, where the body is more likely to tolerate an infection without developing a fever. To date, scientists do not fully understand how either kind of immunity arises in children. Is it because they have simply been exposed to more malaria? Or does being older and having a more mature immune system also help?P. falciparum. Mosquitoes were also collected from their houses to estimate how often the children were being bitten and infected. Using this information, Rodriguez-Barraquer et al. studied the different factors that affect how children develop anti-parasite and anti-disease immunity.Now, Rodriguez-Barraquer et al. have followed more than 1,000 children living in places with high, moderate and low rates of malaria infection in Uganda. Over three years, regular blood samples were taken to see if the children were infected with Both types of immunity develop differently in places with high, moderate and low rates of infection, so being infected multiple times is important. Yet, the findings also show that growing older itself contributes to the development of immunity regardless of how often a child is infected.Children who get infected most often – in other words, those living in houses with the most mosquitoes – develop immunity faster than those who get infected at a moderate rate. Unexpectedly, however, children living in places with low rates of infection also develop immunity faster than those living in places with moderate rates.Understanding how children acquire immunity to malaria is important for people trying to control the disease. These results suggest that reducing rates of infection to very low levels may not interfere with development of immunity and may even improve it. However, future research should see if these findings apply to other parts of the world as well, and, if so, why children develop immunity faster in places with lower rates of malaria infection. The last decades have seen substantial declines in malaria transmission in sub-Saharan Africa that are largely attributable to increased access to effective control measures, including insecticide-treated bednets, indoor residual spraying of insecticide and artemisinin-based combination therapy . In settGradual acquisition of immunity against symptomatic malaria  is a key driver of the epidemiology of malaria in endemic settings, where the incidence of disease typically peaks in early childhood and then declines, while the prevalence of detectable asymptomatic parasitemia increases throughout childhood before declining in adulthood . While tHere, we use data from three parallel cohort studies conducted across the spectrum of malaria transmission in Uganda to model and quantify the development of immunity against symptomatic malaria as a function of transmission intensity and age. A key strength of these studies is that they involved detailed clinical and entomological surveillance of all study households. We focus on two specific types of immunity: anti-parasite immunity (i.e. the ability to control parasite densities upon infection) and anti-disease immunity (i.e. the ability to tolerate higher parasite infections without developing objective fever), as they have been described as independent components of clinical immunity .P. falciparum infection between August 2011 and November 2014. The three cohorts enrolled a total of 1021 children aged 6 months to 10 years from 331 randomly chosen households across the three study sites. This analysis was limited to data from 773 children who experienced at least one patent Participants living in Nagongera experienced the highest incidences of symptomatic malaria (median 2.6 episodes per person year), followed by those living in Kihihi (median 1.6 episodes per person year) and Walukuba (median 0.6 episodes per person year) . These iP. falciparum, we correlated the measured annual EIRs (aEIR) for each household . aEIR explained less of the variance between individuals within each site: Nagongera ; Kihihi ; Walukuba .To assess whether entomological metrics were a good indicator of individual exposure to ousehold  with estousehold . IndividParasite densities developed upon infection decreased with increasing age in all settings and for both symptomatic (passive detection) and asymptomatic (detected during routine visits) infections. Despite the large variability in parasite densities recorded within and between individuals, this trend is evident in the raw data . A trendWe considered multiple candidate models to describe the association between parasite density, age and aEIR (Appendix 1). Models allowing smooth (non-linear) relationships with aEIR best fit the data. Models allowing for two-way interactions between age and aEIR also outperformed models that did not include interactions.In moderate and high transmission settings (households with aEIR >5), increasing age and increasing exposure were independently and linearly associated with decreases in the parasite densities . On averTo test whether the observed associations with age could be explained by the cumulative exposure over a life time, we also fit models where, instead of adjusting for the aEIR, we adjusted for the cumulative number of infectious bites (i.e. the product of age and aEIR) . ResultsWe define anti-disease immunity as the ability to tolerate a given parasite density without developing objective fever. Thus, we were interested in modeling temperatures recorded at specific parasite densities, as a function of age and aEIR. Consistent with models characterizing anti-parasite immunity, models including smooth effects and interactions fitted the data significantly better than simpler models.As expected, we found a strong association between parasite densities and objective temperature . IncreasSimilar to the anti-parasite immunity results described above, the observed association between exposure level and anti-disease immunity was less evident than the association with age  and 6. FAs an alternative way to characterize anti-disease immunity, we used our best fitting model to predict the fever threshold, defined as the minimum parasite density associated with objective fever (temperature >38°C), across levels of age and aEIR . This quFinally, to characterize the association between age and aEIR on the overall risk of developing symptomatic malaria upon infection (i.e. the combined effect of anti-parasite and anti-disease immunity), we fit a series of models where the outcome of each independent microscopically detectable infection  was modeled as a function of age and aEIR. Models allowing smooth relationships, with or without two-way interactions, fit the data equally well.Results from this analysis are consistent with results from the anti-parasite and anti-disease models . While yP. falciparum infection was associated with different levels of anti-parasite and anti-disease immunity, we used data on the recent malaria history of each individual to fit models adjusted for number of P.falciparum positive visits in the past 3 and 6 months. We found no association between the number of recent malaria infections and our outcomes of interest . Thus, the expected values modeled here may be biased by the frequency of active vs passive episodes detected. In particular, it is possible that we have under-sampled the instances of asymptomatic infection, and thus, our estimates of the expected parasite densities may be an over-estimate of those present in the population. Similarly, it is also possible that consecutive asymptomatic infections represent persistent, rather than new infections. To address these limitations, we performed sensitivity analyses where we (a) up-weighted the episodes of asymptomatic parasitemia, to account for potentially unobserved asymptomatic infections and (b) included only ‘incident’ asymptomatic infections, under the assumption that subsequent asymptomatic samples represented persistent (rather than new) infections. Results from these analyses were qualitatively identical to the main analysis reported here and are presented in the supplementary material  and 7.To explore whether differences in the prevalence of certain host genetic polymorphisms between sites could be driving some of our findings, we also performed sensitivity analyses limiting the dataset to those subjects without the sickle hemoglobin mutation (β globin E6V), known to protect against malaria . Even thP. falciparum. While anti-parasite immunity acts to restrict the parasite densities that develop upon each subsequent infection, anti-disease immunity increases the tolerance to high parasite densities. Thus, older children are less likely to develop symptomatic malaria upon infection both because they tolerate parasite densities better without developing fever, and because they are less likely to develop high parasite densities.Our findings illustrate how anti-parasite and anti-disease immunity develop gradually and in parallel, complementing each other in reducing the probability of experiencing symptomatic disease upon infection with P. falciparum more often, the results obtained for the lowest transmission settings are harder to reconcile. These results were largely driven by observations collected in the Walukuba site, and as such it is possible that site-specific characteristics may have driven them. Walukuba was previously a relatively high transmission rural area, but substantial decreases in transmission intensity have been observed since 2011, likely due to urbanization. While our sensitivity analyses suggested that differences in the prevalence of three well characterized host-genetic polymorphisms between sites do not explain these discrepant results, it is still possible that other unmeasured site-specific characteristics may have driven them. Lower complexity of infection coupled with lower parasite diversity in Walukuba, for example, could cause this difference, as developing an effective immune response against fewer parasite strains may be much easier than developing immunity against a more diverse pool  were biased by these sources of measurement error, sensitivity analyses suggest that the relationships observed were robust. Secondly, while we found an independent association between the average household aEIR and both anti-parasite and anti-disease immunity, it is not clear that this is the most relevant metric of exposure for the development of clinical immunity to malaria. Alternative metrics such as the number of discrete infections, the number of ‘strains’ seen or the total parasite-positive time might be more relevant, but require the collection of additional data, including more frequent sampling. Finally, while this study provides very detailed insight into how two types of clinical immunity to malaria develop in endemic settings as a function of age and repeated exposure, it says nothing about the duration of immunity.Prior studies have tried to model the processes driving acquisition of clinical immunity against malaria. However, these models have been generally informed by aggregated epidemiological data  which limits their capacity to isolate the contributions of age and repeated exposure , 2014. OThe study protocol was reviewed and approved by the Makerere University School of Medicine Research and Ethics Committee , the Durham University School of Biological and Biomedical Sciences Ethics Committee (PRISM Entomology Uganda), the University of California, San Francisco, Committee on Human Research (Identification numbers 11–05539 and 11–05995) and the Uganda National Council for Science and Technology (Identification numbers HS-978 and HS-1019). All parents/guardians were asked to provide written informed consent at the time of enrollment.We used data from three parallel cohort studies conducted in Uganda in sub-counties chosen to represent varied malaria transmission . WalukubThe studies included passive and active follow-up of participants. Parents/guardians were encouraged to bring their children to designated study clinics for any illness. All medical care was provided free of charge, and participants were reimbursed for transportation costs. All children who reported fever in the previous 24 hr or were febrile at the time of the visit (tympanic temperature >38.0°C) were tested for malaria infection with a thick blood smear. Light microscopy was performed by an experienced laboratory technician who was not involved in direct patient care and verified by a second technician. Parasite density was calculated by counting the number of asexual parasites per 200 leukocytes , assuming a leukocyte count of 8,000/μl. A blood smear was considered negative when no asexual parasites were found after examination of 100 high-power fields.If the smear was positive, the patient was diagnosed with symptomatic malaria and received treatment with artemether-lumefantrine (AL), the recommended first-line treatment in Uganda. Episodes of complicated or recurrent malaria occurring within 14 days of therapy were treated with quinine. In addition, routine evaluations were performed every 3 months, including testing for asymptomatic parasitemia using thick blood smears.Anopheles mosquitoes. Individual mosquitoes were tested for sporozoites using an ELISA technique , the average sporozoite rate  and the entomological inoculation rate .Entomological surveys were also conducted every month at all study households. During these surveys, mosquitoes were collected using miniature CDC light traps . Established taxonomic keys were used to identify female echnique . All femThe purpose of these analyses was to model and quantify the development of immunity against symptomatic malaria, as a function of age and exposure, measured by the household EIR.We modeled two specific types of immunity that have been previously described as components of immunity to malaria. We defined anti-parasite immunity as the ability to control parasite densities upon infection and anti-disease immunity as the ability to tolerate parasite infections without developing objective fever. Thus, for models of anti-parasite immunity, the outcome of interest was the parasite density recorded (using thick blood smear) at each parasite-positive study visit. For models of anti-disease immunity, the outcome of interest was the objective temperature recorded during parasite positive visits, conditional on the parasite density. In addition, we also modeled overall immunity against symptomatic malaria. For these analyses, the outcome of interest was the probability of presenting with fever given infection (parasite positivity).In order to model the association between the outcomes and covariates of interest we used generalized additive models (gams). Gams provide a good framework, as they allow for smooth non-linear relationships. Details on the specific models explored are provided in the supplementary material (Appendix 1). In summary, the models followed the following form.(1) Anti-parasite immunity(2) Anti-disease immunityi is an index for individuals, j for households and k for specific visits. Thus, i from household j during visit k, and j. We included the EIR as an average (time-invariant) covariate, as we were interested in modeling the impact of the average exposure to malaria over time on the development of clinical immunity. Therefore, our model implicitly assumes that malaria transmission has been relatively stable at these three sites. To account for lack of independence, all models included random effects at the individual (ui) and household (γi) levels.(3) Overall immunity against symptomatic malariaAll our primary analyses included the full dataset. However, since results were consistent with a non-monotonic relationship between aEIR and the outcomes of interest, we also fit models stratified by aEIR (aEIR ≥5 vs. aEIR <5). All models were fitted in the R statistical framework using package mgcv . Best fihttps://github.com/isabelrodbar/immunity (https://github.com/elifesciences-publications/immunity). Complete data from the 3 cohort studies are available in the ClinEpiDB website (https://clinepidb.org/ce/app).All the data used for these analyses as well as the R code used to reproduce the main study findings are available at Confidence bounds are presented in  In the interests of transparency, eLife includes the editorial decision letter and accompanying author responses. A lightly edited version of the letter sent to the authors after peer review is shown, indicating the most substantive concerns; minor comments are not usually included.eLife. Your article has been reviewed by three peer reviewers, including Ben Cooper as the Reviewing Editor and Reviewer #1, and the evaluation has been overseen by a Senior Editor.Thank you for submitting your work entitled "Quantification of anti-parasite and anti-disease immunity to malaria as a function of age and exposure" for consideration by eLife.Our decision has been reached after consultation between the reviewers. Based on these discussions and the individual reviews below, we regret to inform you that your work will not be considered further for publication in All reviewers thought the work presented some very detailed and interesting data. However, following consultation, the consensus was that by failing to account for individual exposure history in the data the work fell short of what was possible with these data, and also made implicit independence assumptions that seem hard to justify. If these limitations could be addressed in future work, the journal would be interested in considering a new manuscript looking at the same data.Reviewer #1:P. falciparum and anti-disease immunity change with age and transmission intensity.This manuscript presents an elegant application of generalised additive models to a rich longitudinal malaria data-set from 773 children across three study sites in Uganda. The authors use this statistical modelling approach to investigate how both anti-parasite immunity to As the authors argue, this works represents a substantial advance over previous attempt to model processes driving malaria immunity which have been informed by aggregated data. The individual level data makes it possible to disentangle the effects of age and exposure history, and demonstrate an independent effect of age .Generally the manuscript is very well written, easy to read, clearly presented, and the findings accompanied with appropriate caveats. This work seems to make an important and worthwhile contribution to the literature. The sensitivity analysis in the supplementary material also considerably strengthens the work.Reviewer #2:P. falciparum parasite density, temperature, clinical episodes of malaria and EIR. In order to assess the statistical methods it is worthwhile to consider this analysis in the context of a previous analysis of Ugandan data by the same authors in an excellent paper published last year in The Journal of Infectious Diseases. The data utilised in this analysis is superior to that utilised in the previous paper in a number of ways: more participants; household measurements of EIR; individual level measurements of temperature and parasite density, etc. The absence of data on low density PCR-detectable infections however is a limitation. Although the statistical models utilised in this analysis are justifiable and robust, I feel that the methods have taken a step back compared to their previous methods.This study analyses data from three longitudinal cohort studies from regions of Uganda with varying transmission intensity. The analysis is based on very detailed epidemiological data sets with data collected on In their previous analysis the authors captured how previous exposure to malaria affects the probability that an infection will lead to a clinical episode . It appears to me that in this analysis that the rich data on an individuals' exposure history is not accounted for – and with a mean of 2 years' follow-up (over 3 years in some case) this is quite substantial data. Instead, the authors' models for temperature, parasite density and symptomatic malaria for visit k, depend only on measurements at visit k, and not on the individuals' malaria history at previous visits. I would like to see the authors utilise a method that accounts for malaria history at visits before k .Reviewer #3:This article using 3 very interesting longitudinal data sets from Uganda to investigate how the acquisition of immunity is influenced by exposure and age. These are very pertinent questions. Unfortunately, the authors do not make good use of the excellent longitudinal data they have nor is the way they combine active and passive case detection samples in the definitions of anti-parasite and anti-disease very clear.The authors treat all infections within a child as statistically independent. This is not strictly speaking correct.Firstly, infections within the same child are controlled by the same immune system and thus reflective of the same immune status. Appropriate analyses of these data would thus need to take into account the non-independence of samples within the same individual.P. falciparum may last for up to 1 year or more. Therefore, it is likely that in particular in at low transmission household 2 or more consecutive infection may represent a single P. falciparum infection. In low transmission settings where few infections are acquired asymptomatic infections are likely to be longer lasting both the more limited number of treatments and the lack of superinfections that will result in higher parasitaemias and clinical symptoms in their early  growth phase. This factor could explain the overall higher proportion of asymptomatic infections and the lower parasitaemia at a given in age at low transmission.Secondly, asymptomatic The authors have defined anti-disease immunity as difference in the mean objective temperature at a given parasitaemia. This may again be potentially impacted by the quite different numbers of observed symptomatic vs. asymptomatic detection samples. From the Materials and methods section it is not clear how author dealt with children that reports having been febrile in the last 24hrs but did not have an objective fever. Were there many such children (and how to the relate to listed asymtomatic infections) and how were they treated in the analysis. Also did the proportion of such children differ with age and exposure in similar ways that the proportion of asymptomatic infections differs .[Editors’ note: what now follows is the decision letter after the authors submitted for further consideration.]eLife. Your article has been reviewed by three peer reviewers, including Ben Cooper as the Reviewing Editor and Reviewer #1, and the evaluation has been overseen by Prabhat Jha as the Senior Editor. The following individual involved in review of your submission has agreed to reveal their identity: James Watson (Reviewer #2).Thank you for submitting your article "Quantification of anti-parasite and anti-disease immunity to malaria as a function of age and exposure" for consideration by The reviewers have discussed the reviews with one another and the Reviewing Editor has drafted this decision to help you prepare a revised submission.Summary:Plasmodium falciparum infection. They used data from 773 children in three cohort studies in Uganda (2011-2014), in settings with a wide range of transmission intensity  is estimated from monthly mosquito household catch surveys). They used age and number of infectious bites per year to characterise how immunity develops over time. Immunity was assessed in two ways: anti-parasite immunity (measured by parasite density) and anti-disease immunity (measured by the parasite density which causes fever). The data were analysed using generalised additive models, which allow for complex relationships between aEIR, age and immunity. The results quantified how both age and exposure had important influences on immunity and suggested a surprising (and hard-to-explain) non-linear relationship where children living in the lowest transmission settings appeared to develop immunity faster than those in higher transmission settings.The authors sought to describe how both age and transmission intensity affect the dynamics of the development of immunity against symptomatic Essential revisions:This is a uniquely rich data set, that has the potential to yield important insights.However, all reviewers were highly skeptical about some of the findings (as outlined in the reviews) which challenge most current thinking about malaria and immunity. Some of these findings are so surprising that we think more effort to check their robustness is needed.One of the biggest concerns was the grouping of active and passive case detection data without regard to the different data generating mechanisms. In particular there may be important biases operating .For these reasons we would like to see the following revisions:1a) Repeat the analysis just with the active case detection data (this should provide the basis for the most reliable inference).1b) Compare 1a with the same analysis on passive case detection data.If 1a and 1b give essentially the same results this provides a useful confirmation – if the same results can been shown with data collected in two different ways that should lead to more confidence in the results. If results are different, then some thought about the reasons why are needed (though this in itself could be an interesting finding).2) The current models use a mean aEIR, but EIR can vary substantially over time (and there is clear evidence that it does vary greatly in this data set]. This means that the model is implicitly assuming that a person's immunity at one time point depends on what happens (to the EIR) in the future. This doesn't make a lot of sense. It should not be difficult to account for this temporal variation in the EIR in the analysis (i.e. considering cumulative EIR), and we consider this an essential revision.3) All non-linear models should be compared to their linear counterpart. In the current submission AP1 is the linear version of AP2, but there is no linear version of AP3 with the age/EIR interaction (similarly for the ADx models that consider temperature).4) Additional checking of model adequacy is needed e.g. plots of scaled residuals and predictive checks .5) The evidence for the surprising non-monotonic relationships for acquired immunity predicted by the model would be greatly strengthened if the authors could present a plot clearly showing this signal in the data .Reviewer #1:I reviewed an earlier submission of this manuscript which was rejected largely because of the consensus (following consultation between reviewers) that the analysis was not making the best of use of the data. In particular, not accounting for individual-level malaria history from previous visits was felt to be a big limitation.There have been a number of changes in the current submission which have undoubtedly improved the manuscript and addressed many substantive concerns. First, the provision of the code and data needed for the analysis is very welcome and helps clarify exactly what was done and makes it possible for others to verify the findings.Second, the revision has clarified that dependencies were accounted for (with a random effects term), and explained why more explicitly accounting for individual histories was not done . It has also clarified that individual exposure histories are being implicitly accounted for through adjustment for age, aEIR and through the random effects terms. In light of these clarifications, the modelling decisions seem more understandable.P. falciparum positive visits in the previous 3 and 6 months periods), but found no evidence that this recent exposure was associated with either anti-parasite or anti-disease immunity .In addition to these clarifications there is some new material including individual immunity trajectories , additional models which did use data on recent exposure  which suggests an effect of age independent of exposure.Finally, the authors have added figures showing confidence bounds for age and EIR-specific anti-parasite and anti-disease immunity. This were omitted from the original submission and are also a welcome addition.As the rebuttal letter makes clear, the authors do not have a clear explanation for the "provocative finding" that children exposed to the lowest transmission are developing immunity more effectively than those in more moderate transmission settings . Clearly, this finding goes against most preconceptions about how immunity in malaria works and I think the authors are therefore right to spend a lot of effort in sensitivity analyses to show that this is a robust finding and not an artefact. While the fact that same effect is seen for two different measures of immunity strengthens the case for this being a real effect, I am concerned that there are other possible reasons why this could still be an artefact which have not yet been ruled out. Two possibilities I can think of are:i) Is there a possibility that differences in measuring aEIR at different sites could account for this? The sensitivity analysis excluding Walukuba helps here . What about looking at Kihihi/Kanungu alone? This seems to have a big enough range of aEIRs that the effect should be seen if present. [note: following consultation this was not considered to be an essential revision].ii) Is there a possibility that there are edge effects in fitting that GAMs that introduce these effects? This could be checked, for example, by fitting the same models to simulated data under different assumptions. Is it possible get similar results  even when data are simulated under the assumption of a monotonic relationship between aEIR and the rate at which immunity develops? [note: following consultation this was not considered an essential revision].When comparing the model fits (Supplementary file 1), the flexible GAM models  are compared with a single mixed model expressing a monotonic relationship (with temperature and log parasite density varying linearly with age and with log(aEIR)). Why not also consider other functional monotonic relationships between these measures of immunity and age and aEIR? [note: following consultation this was not considered an essential revision]Finally, the mgcv packages allows a lot of flexibility when fitting GAMS/GAMMs including allowing for autocorrelated errors. Without diving into the code (which I haven't done) it is not clear what choices were made and why form the supplementary material alone. Are key results robust to modelling decisions made, and what diagnostics checks have been done?Reviewer #2:This is a data analysis exercise using cohort studies taken across the spectrum of Pf transmission in Africa. They use age and number of infectious bites per year to characterise how immunity develops over time. This is a very nice dataset and overall the paper is well written, and the plots are informative and clear. Code and data were provided online in order to reproduce the results.I have a few concerns in the following paragraphs.“aEIR as a metric of individual exposure”:The annual entomological inoculation rate (aEIR) is estimated from monthly mosquito household catch surveys. This estimated quantity is then plugged into the models  as the proxy for the total number of infectious bites per year. Given that in the lowest transmission setting, the median number of infectious bites is 2 per year, this implies that a median of 2 infectious mosquitoes were captured over the course of one year. What is the median denominator here, e.g. how many mosquitoes were captured? The uncertainty on these aEIR estimates must be much larger for the low transmission settings vs high transmission settings. This may explain why the R2 is also much lower when correlating log(aEIR) and hazard of infection . This may also explain the trends observed in Figure 3 (top right panel), where the individuals with lowest aEIR have lower parasite densities that those with medium aEIR.This potentially indicates that the aEIR is not a good estimate of the true number of infectious bites at very low transmission? If so, this means the conclusions drawn from the models cannot be taken at face value. Model comparison:The online code was broken in parts and I had to spend an hour debugging it. This is quite annoying!My main question was to understand whether the more complex non-linear models (GAMs) were truly better than their linear counterparts. In particular whether the pattern shown in Figure 5B was not the result of over-fitting. If I understand Figure 5B correctly (probably the most important plot in the paper), a 2 year old with an aEIR of 2 infectious bites per year has on average the same anti-disease immunity as a 5 year old with an aEIR of ~200 infectious bites per year. This is very hard to believe and my prior on this being true would be very low. I believe this may be an artefact due to the problem highlighted above for the extremely low aEIRs.I ran a series of 50 random 10-fold cross-validation experiments in order to characterize the out-of-sample mean squared error of each of the models 1-3 and a fourth model: the linear equivalent of model 3 (interaction between age and log(aEIR) with random effects at the individual and household level). The author's model 2  performs best on average but the effect is very small. The fact that the non-linear model fits best the data is driving the surprising conclusions and I remain skeptical regarding the following line of the Abstract:"Our findings suggest a strong effect of age on both types of immunity, that is not explained by cumulative exposure. They also show a non-linear effect of transmission intensity, where children living in the lowest transmission intensity setting appear to develop immunity faster than those experiencing higher transmission."Even if the underlying relationship is truly non-linear, it would be useful to report the conclusions of a linear model which are likely to be generalisable. This would be similar to what the authors have done , but for instance reported as: for a twofold increase in yearly inoculation, the pyrogenic densities decrease by X amount.Reviewer #3:It's tough to come out against this one as the authors have used some great data sets and innovative statistical modelling approaches to tackle a very hard question, namely how is immunity to malaria acquired in moderate to high transmission settings. My concern is that the design of the data, and the design of the model don't fit well together leading to some hard to explain results.Hard to explain results:There are at least two results which I would put in the 'hard to explain' category.Firstly, the authors have proposed biologically and epidemiologically well-informed hypotheses to explain the non-monotonic relationship with aEIR in Figure 7. However a simpler hypothesis is that this is an artefact of combining this particular model and this particular data set.The second result is from Figure 6 where the fever threshold for 39C comes in and out of view as we increase from (a) aEIR = 2; (b) aEIR = 10; (c) aEIR = 50; to (d) aEIR = 200. This result would imply that a 2 year old with parasite density of 1e6 parasites/uL has fever > 39C when aEIR = 2; tolerates parasites better by having fever < 39C at aEIR = 10; then tolerates parasites worse by having fever > 39C when aEIR = 50; before finally switching back to better toleration of parasites with fever < 39C when aEIR = 200."They also show a non-linear effect of transmission intensity, where children living in the lowest transmission intensity setting appear to develop immunity faster than those experiencing higher transmission."In an Abstract, one has little choice but to read a statement literally. This implies that children living in the lowest transmission setting appear to develop immunity faster than those experiencing higher transmission. This flies in the face of conventional malaria epidemiology. Perhaps the authors are trying to say something more subtle like there is a diminishing contribution to the acquisition of immunity with subsequent infections.Model:The authors have provided a change in notation to emphasise the utilisation of random effects, but otherwise left the model and results unchanged. The random effects at the individual and household level will account for a substantial degree of the variation between children. However, within an individual the only piece of longitudinal information included is age, incremented by the index k for visit. Otherwise, incidence of symptomatic episodes are independent (and there can be up to 30 of them). For example, the probability of symptomatic malaria is the same for a child on their 1st and 10th episodes.It is notable that although age is updated at each visit, aEIR is not – instead being averaged over the duration of follow-up. Looking at Figure 5 of the original publication by Kamya et al., we see that there is a lot of time-dependent variation. For example, in Kihihi there is a huge spike in aEIR in 2013 towards the end of the study.Some of the 'hard to explain' results could be arising from non-linearities and tensor interactions in the generalised additive models. Looking at models AP1-3, I note very little change in% deviance explained despite changes in the AIC. Looking at models SM1-3, I note that as model complexity increases, the% deviance explained actually decreases, despite the AIC appearing to favouring the more complex models.Data:I am concerned that the passively detected cases and routinely (every 3 months) detected cases are fundamentally incompatible.If I interpret things correctly, a passively detected case will by definition contribute 1 count of a symptomatic episode and 1 light-microscopy measurement of parasite density. These data provide no discriminatory power on whether an infection  becomes symptomatic, and no information on temperatures < 38°C.By not having the precondition of treatment-seeking behaviour and fever >38°C, routinely detected cases arguably provide richer information. Although the majority of these measurements are parasite negative (by microscopy) and presumably excluded.In Table 1 there are reported to be 2447 + 1555 + 207 = 4209 symptomatic episodes versus 955 + 331 + 145 = 1431 asymptomatic parasitaemia episodes. This suggests that the passively detected cases are provided far more data points.eLife. Your revised article has been favorably evaluated by Prabhat Jha (Senior Editor), and three reviewers, one of whom is a member of our Board of Reviewing Editors.Thank you for resubmitting your work entitled "Quantification of anti-parasite and anti-disease immunity to malaria as a function of age and exposure" for further consideration at The reviewers noted that the authors have worked hard to address the raised concerns, generating new sensitivity analyses that lend supporting evidence to their conclusions and providing new presentations of the data to better visualise the non-monotonic relationships.The authors have now adequately addressed all but one of the reviewers' main concerns.The one last point, which reviewer 3 noted the authors did not address in their previous response, was related to the unexpected result of% Deviance Explained as the complexity increases for the nested models for anti-parasite immunity and overall immunity against symptomatic malaria. From the previous review:"Looking at models AP1-3, I note very little change in% deviance explained despite changes in the AIC. Looking at models SM1-3, I note that as model complexity increases, the% deviance explained actually decreases, despite the AIC appearing to favouring the more complex models."This is an important point that requires a response.Reviewer 2 also made the comment that It would be useful if the authors provided an extra variable in their data on github: passive versus active detection. [Editors’ note: the author responses to the first round of peer review follow.]eLife.We would like to submit a new version of our manuscript “Quantification of anti- parasite and anti-disease immunity to malaria as a function of age and exposure” for publication in eLife and rejected due to specific concerns from the reviewers and editors. In particular, reviewers thought that our analysis failed to account properly for individual exposure history, and that it made certain unjustifiable assumptions. We have now revised our analysis to address these and other concerns expressed in the reviews and to clarify our assumptions and rationale for the analyses presented.This manuscript was previously submitted to In summary, the major changes made were:P. falciparum to assess whether recent exposure is associated with different levels of anti-parasite and anti-disease immunity;We have performed additional analyses where we use the rich data on recent exposure to To show that our analysis captures individual heterogeneity in immunity, we have added a figure showing the predicted trajectories of anti-parasite and anti- disease immunity for a subset of individuals, as a function of age;We have modified the Materials and methods section to make clear that our analyses do explicitly consider the longitudinal nature of the data. All our models include random effects at the individual and household levels to account for the lack of independence at both levels;We have added extensive sensitivity analyses to show that our main findings are robust to the assumptions made;We have made all the data used for these analyses, as well as the R code used to reproduce the main study findings available in our Github repository.We want to underscore that we believe that the metric of individual exposure used in this analysis  is a major, unique strength of this study. While no metric of natural exposure is perfect, our frequent, household level mosquito captures could be considered the most proximal feasible metric to the ideal when modeling the effect of exposure (transmission intensity) on malaria immunity. It directly quantifies the extent of environmental exposure to malaria, it is completely independent from the outcome of interest (immunity), and is strongly correlated with the individual hazard of infection.eLife because it represents a major advance in our understanding of how immunity to malaria develops across a broad transmission spectrum. Improved understanding of the factors driving anti-malarial immunity is fundamental to investigate underlying biological mechanisms and to anticipate the impact of malaria control interventions. Careful analyses of longitudinal datasets, like this one, are required to fill existing gaps. Given its broad readership, we feel that eLife is the ideal forum for publication of these findings.As stated in our initial submission, we think that our paper should be considered for publication in Reviewer #2:This study analyses data from three longitudinal cohort studies from regions of Uganda with varying transmission intensity. The analysis is based on very detailed epidemiological data sets with data collected on P. falciparum parasite density, temperature, clinical episodes of malaria and EIR. In order to assess the statistical methods it is worthwhile to consider this analysis in the context of a previous analysis of Ugandan data by the same authors in an excellent paper published last year in The Journal of Infectious Diseases. The data utilised in this analysis is superior to that utilised in the previous paper in a number of ways: more participants; household measurements of EIR; individual level measurements of temperature and parasite density, etc. The absence of data on low density PCR-detectable infections however is a limitation. Although the statistical models utilised in this analysis are justifiable and robust, I feel that the methods have taken a step back compared to their previous methods.In their previous analysis the authors captured how previous exposure to malaria affects the probability that an infection will lead to a clinical episode . It appears to me that in this analysis that the rich data on an individuals' exposure history is not accounted for – and with a mean of 2 years' follow-up (over 3 years in some case) this is quite substantial data. Instead, the authors' models for temperature, parasite density and symptomatic malaria for visit k, depend only on measurements at visit k, and not on the individuals' malaria history at previous visits. I would like to see the authors utilise a method that accounts for malaria history at visits before k .We thank the reviewer for their thoughtful comments. There are significant differences between the previous (JID) and current datasets that guided the choice made around each analysis.First, the dataset used in the previous analysis involved data from a birth cohort that followed participants between 6 months and 5 years of age. This cohort was characterised by extremely frequent follow-up, with blood smears performed at least every month on every trial participant . Thus, in this dataset we were confident that we had observed nearly all symptomatic malaria infections experienced by these children since birth (as well as a fraction of asymptomatic infections), which allowed us to use the observed prior malaria history as a metric of prior malaria exposure. In contrast, the PRISM cohorts used in this analysis are not birth cohorts (children aged 6 months to 10 years were enrolled) and regular visits occurred every 3 months. For each individual we only observe a limited window of time, (that varies depending on the age at enrollment) and we therefore lack the full malaria history for most individuals.Second, a limitation of the approach used in the previous analysis is that as immunity develops, incidence of symptomatic malaria becomes a poor metric of past exposure, as a larger proportion of infections remain asymptomatic. Thus, the outcome of interest (immunity) directly affects the metric of exposure. This is particularly important in the PRISM study, as children were followed up to age 11 and had developed substantial immunity by then. An important strength of the PRISM study, used in the current analysis, is that it includes monthly mosquito collections, thus providing a metric of individual exposure  that is fully independent from the outcome of interest (immunity). The average entomological inoculation rate is the metric of exposure that we used for the analysis presented here.Third, while the dataset from the previous analysis only included data on 100 children living in a single district, the PRISM cohort followed over 900 kids across settings with different transmission. The richness of the PRISM dataset allowed us to go beyond simply modeling the probability of symptomatic disease upon infection (as done in the JID paper) and model anti-parasite and anti- disease immunity independently. Furthermore, we were able to model non-linear relationships between the predictors and outcomes of interest. Thus, the present analysis is a significant advance over our previous analysis.While it is true that in the current analysis we do not adjust directly for the cumulative number of episodes experienced by each individual , it does account for individual exposure histories in two ways:The models are adjusted for age, aEIR, and their interaction (the product of age and EIR can be thought of as a metric of cumulative exposure), and therefore explicitly allow for greater immunity in children that have been exposed more;The models contain random effects at the individual level, thus accounting for correlation between multiple observations of an individual.We want to underscore that we believe that the annual entomological inoculation rate (aEIR), used as the metric of individual exposure in this analysis is actually a major, unique strength of this study. While no metric of natural exposure is perfect, our frequent, household level mosquito captures could be considered the most proximal feasible metric to the ideal when modeling the effect of exposure (transmission intensity) on malaria immunity. It directly quantifies the extent of environmental exposure to malaria, it is completely independent from the outcome of interest (immunity), and has been shown to be correlated with the individual hazard of infection .Changes made:To show that the model does capture individual trajectories in immunity (in a similar way as the JID paper did), we have added a paragraph to the Results section and a supplementary figure showing the predicted trajectories of anti-parasite and anti-disease immunity for a subset of individuals .P. falciparum infections and our outcomes of interest.Furthermore, we have also performed an additional analysis where we use the rich data on recent exposure to malaria to assess whether recent exposure to malaria was associated with different levels of anti-parasite and anti-disease immunity, after adjusting for age and aEIR. These results are now presented in the Supplementary file 2 and Figure 5—figure supplement 3). We found no association between the number of recent Finally, we have included an additional figure to the supplement showing the output of models adjusted for age and cumulative aEIR (instead of just aEIR) . As stated in the text, these results are consistent with a strong effect of age that is independent of exposure.Reviewer #3:This article using 3 very interesting longitudinal data sets from Uganda to investigate how the acquisition of immunity is influenced by exposure and age. These are very pertinent questions. Unfortunately, the authors do not make good use of the excellent longitudinal data they have nor is the way they combine active and passive case detection samples in the definitions of anti-parasite and anti-disease very clear.We regret that the reviewer feels this way about our analysis but feel that they have not fully understood our methods. We have made efforts (detailed further below) to add clarity and reduce the probability that readers will have similar concerns. The analyses all explicitly consider that the datasets are longitudinal and include random effects at the individual and household levels. Furthermore, we were explicitly concerned about how to properly combine active and passive case detection samples and performed sensitivity around this (adjusting for the probability of observation). Below, we provide answers to their specific concerns.The authors treat all infections within a child as statistically independent. This is not strictly speaking correct.Firstly, infections within the same child are controlled by the same immune system and thus reflective of the same immune status. Appropriate analyses of these data would thus need to take into account the non-independence of samples within the same individual.We fully agree with the reviewer that samples of the same individual can’t be treated as independent and apologize if this is not clear in the paper. All of our models include a random effect for each individual to account for the lack of independence. Furthermore they also include a random effect for each household to account for potential lack of independence at this level.Changes made:i) and household (γi) levels”.We have changed the text both in the Materials and methods section and in the supplementary material to make this more clear. The equations now include both individual and household random effects. Furthermore, the text now reads “To account for lack of independence, all models included random effects at the individual .To further address this point, we have now performed an additional sensitivity analysis, were we only include “incident” asymptomatic infections, under the assumption that all subsequent asymptomatic samples represent a persistent (rather than a new infection) .Changes made:We have changed the text in the sensitivity analysis section as follows:“Our main analyses include data from all visits regardless of their type (routine vs. passive case detection). […] Results from these analyses were qualitatively identical to the main analysis reported here and are presented in the supplementary material .”We have included the results of the additional sensitivity analysis in the main text.In low transmission settings where few infections are acquired asymptomatic infections are likely to be longer lasting both the more limited number of treatments and the lack of superinfections that will result in higher parasitaemias and clinical symptoms in their early  growth phase. This factor could explain the overall higher proportion of asymptomatic infections and the lower parasitaemia at a given in age at low transmission.We agree with the reviewer that a lower rate of superinfections could explain why we observe higher “immunity” in lower transmission setting, particularly if coupled with lower parasite diversity. This is one of the hypothesis that we consider in our Discussion. To formally assess how the duration and complexity of infection affects clinical immunity, in our current studies we are genotyping all infections to follow them at the level of the individual strain.Changes made:For clarity, we have modified the paragraph discussing potential hypothesis surrounding this finding as follows:“Lower complexity of infection coupled with lower parasite diversity in Walukuba, for example, could cause this difference, as developing an effective immune response against fewer parasite strains may be much easier than developing immunity against a more diverse pool . Testing this hypothesis would require careful characterization of the complexity and diversity of infections in each of our cohort settings.”The authors have defined anti-disease immunity as difference in the mean objective temperature at a given parasitaemia. This may again be potentially impacted by the quite different numbers of observed symptomatic vs. asymptomatic detection samples.The reviewer is right in stating that the different numbers of observed symptomatic/asymptomatic infections may have an impact on our results. To explore this potential source of bias, we performed sensitivity analyses where we weighted each asymptomatic infection based on the expected number of infections for a given period of time. These weights were calculated using a time-to-event model that estimated hazards of infection for each individual. Details of the method used and results are provided in the text.From the Materials and methods section it is not clear how author dealt with children that reports having been febrile in the last 24hrs but did not have an objective fever. Were there many such children (and how to the relate to listed asymtomatic infections) and how were they treated in the analysis.All of the children captured through the passive surveillance system who reported fever in the last 24h hours were tested for malaria, but only a fraction had objective fever when the temperature was measured.The anti-disease model used objective temperature as the outcome, regardless of whether the child reported fever. While it is known that both parasite densities and temperature vary substantially over a 24h period, there is a very strong association between parasite density and temperature  and therefore we consider this to be a novel and appropriate outcome to assess anti-disease immunity.We do acknowledge that by not taking into account the history of fever, whilst allowing a more specific and objective definition, we are losing some information on subjective symptoms. That’s why we also fit the “overall immunity model”, that does take into account all symptomatic malaria episodes, independent of the objective temperature recorded at the time of the visit .Also did the proportion of such children differ with age and exposure in similar ways that the proportion of asymptomatic infections differs .We apologize but we do not fully understand the reviewer’s question. The prevalence of asymptomatic infections was highest in high transmission (nagongera) and lowest in moderate transmission as shown in Table 1 and Figure 1. Consistently, the proportion of smear positive children that had objective fever (at the time of the visit) was lowest in high transmission settings and highest in moderate transmission settings.The prevalence of asymptomatic infection and the proportion of children with objective fever were higher and lower, respectively in children living in low transmission than in those in moderate transmission. These findings are consistent with higher levels of “anti-parasite” and “anti-disease” immunity as suggested by Figures 4-6 in the paper.[Editors' note: the author responses to the re-review follow.]Essential revisions:This is a uniquely rich data set, that has the potential to yield important insights.However, all reviewers were highly skeptical about some of the findings (as outlined in the reviews) which challenge most current thinking about malaria and immunity. Some of these findings are so surprising that we think more effort to check their robustness is needed.We thank the reviewers and editors for their thorough and thoughtful review of our manuscript. When we planned this analysis, our main objective was to quantify the effects of age and exposure on the different types of immunity and we were also expecting to find a monotonic relationship between our exposures and outcomes of interest. We were equally (or more) surprised as the reviewers by the finding of the non-linearity uncovered by the analyses.Even though we don’t have any conclusive evidence to determine what is driving this observed non-linearity, we are confident that it is not an artifact of our analysis. Children living in the lowest transmission setting (aEIR <5), and particularly children living in Walukuba, present with lower parasite densities and tolerate higher parasite densities than children living in higher transmission settings. This is evident both in the raw data  and in the results from the model.While we are confident that this non-linearity exists in our data, as stated in the discussion we can’t rule out whether this finding reflects unmeasured differences between sites, as most of the observations of aEIR <5 come from a single site. Thus, it is possible, for example, that a lower parasite diversity in Walukuba could create this non-linearity. It is also possible that the children in the lowest transmission intensity are consistently experiencing less complex infections, that are ultimately easier to control than the more complex infections experienced in higher transmission settings. Additional potential explanations are presented in the Discussion.We want to underscore that while this non-linearity is certainly counterintuitive and intriguing, the main purpose of our paper was to quantify the independent association between age, exposure and the different types of immunity. These rich datasets, from three cohorts conducted in parallel, provide a unique opportunity to address this question. In an effort to emphasize these results (and as suggested by reviewer #2), we have added a table (Table 2) summarizing the results of linear models. We report results from models fitted to the full dataset as well as models fit to observations from settings in which aEIR ≥5, where the relationship does seem to be linear, and for aEIR <5.One of the biggest concerns was the grouping of active and passive case detection data without regard to the different data generating mechanisms. In particular there may be important biases operating .For these reasons we would like to see the following revisions:1a) Repeat the analysis just with the active case detection data (this should provide the basis for the most reliable inference).We disagree that the active case detection data provides the basis for the most reliable inference. Most malaria infections are symptomatic in this young population, and symptomatic infections are largely (>90%) captured by the passive surveillance system. The active surveillance system only captures symptomatic infections when the malaria episode happens to coincide with the already planned visit. Therefore, by excluding data from the passive surveillance system we would be excluding the vast majority of infections, and the most relevant outcomes for a study that aims to characterize immunity against symptomatic disease. Excluding the data from passive case detection would imply excluding >75% of observed infections in children <5 years and would bias our results towards lower density infections .It is true that an “ideal” study design would capture all infections soon after they occur and ascertain their outcome (symptomatic or not) by following them through time. However, this would probably require daily/weekly “active” sampling, particularly in the high transmission settings, which is not feasible. Our study design, by involving both passive and active case detection, aims to recreate this as closely as possible. Passive case detection is likely to capture the vast majority of infections that are symptomatic (>95% by self-report), while the active case detection captures whether an asymptomatic infection is present at the end of the period (this is more relevant as children develop immunity).We agree that, given the differences in the two systems, we are more likely to observe a symptomatic than an asymptomatic infection and this could generate some bias in our results. That’s why we have performed sensitivity analyses  where we weight the observations from the active vs. passive systems to compensate for differences in the observation probabilities. We have also performed sensitivity analysis that is restricted to “incident” infections , to assess bias potentially introduced by persistent (rather than new) asymptomatic infections. None of these sensitivity analyses changed our inference substantially.oC) captured by this system.The reviewers suggest repeating the analyses with just the active and passive data. However, the fact that the two systems capture different types of infections (symptomatic vs. asymptomatics) also means that this is not possible for several of the analyses presented here. For example, we can’t fit the model on “overall immunity against symptomatic malaria” with just the passive data because by definition all of these infections are symptomatic. Similarly, we can’t estimate the fever threshold (anti-disease immunity) using just active data because there are essentially no objective fevers  Compare 1a with the same analysis on passive case detection data.If 1a and 1b give essentially the same results this provides a useful confirmation – if the same results can been shown with data collected in two different ways that should lead to more confidence in the results. If results are different, then some thought about the reasons why are needed (though this in itself could be an interesting finding).It is only possible to repeat the analysis with just the active and just the passive data for the “anti-parasite” immunity models . As expeWe want to underscore that the active and passive surveillance systems do not represent two distinct data collection mechanisms. Passive and active case detection are complementary systems to ensure that we capture as many of the infections (both symptomatic and asymptomatic) as possible.2) The current models use a mean aEIR, but EIR can vary substantially over time (and there is clear evidence that it does vary greatly in this data set]. This means that the model is implicitly assuming that a person's immunity at one time point depends on what happens (to the EIR) in the future. This doesn't make a lot of sense. It should not be difficult to account for this temporal variation in the EIR in the analysis (i.e. considering cumulative EIR), and we consider this an essential revision.P. falciparum that participants have experienced over their life-time (and not just during the study period). Since we have no information about exposure prior to study enrollment, we chose to use the mean aEIR over the study period as a proxy for mean life-time yearly exposure. Thus, our analysis implicitly assumes that aEIR has been stable in the three study settings, beyond seasonal fluctuations. While this assumption seems to be reasonable for Nagongera and Kihihi, it is more questionable for Walukuba, where transmission declined considerably after 2011 (this is stated in the Discussion). Nevertheless, under this stability assumption, including “future” observations is not problematic and in fact improves our exposure metric, by accounting for the seasonal variation of aEIR over three calendar years.For our analysis, we wanted to use a metric of exposure that could capture the “average” exposure to just the observed cumulative aEIR would imply making arguably stronger assumptions. For example, if we model the data from the beginning of the study (August-December 2011) only considering the aEIRs measured during this period, we would implicitly be assuming that these (more noisy) aEIRs represent the exposure experienced by participants prior to August 2011.We fully agree that if we knew what the true cumulative exposure of each of the participants was at the time of enrollment, it would make sense to use the observed cumulative exposure in the analyses (rather than the average over the entire period) as suggested by the reviewers. However, in the absence of this data, using We want to emphasize that the main objective of our analysis was to characterize the independent effects of exposure and age on the development of anti-parasite and anti-disease immunity. In the absence of information about the exposure experienced by participants prior to study enrollment, we believe that using the average aEIR is the closest approximation to our metric of interest.Changes made:We have added a sentence to the Materials and methods section to explicitly state that our model (and our chosen metric of exposure) assumes that transmission has been stable at the three study sites. The text now reads:“We included the EIR as an average (time-invariant) covariate, as we were interested in modeling the impact of the average exposure to malaria over time on the development of clinical immunity. Therefore, our model implicitly assumes that malaria transmission has been relatively stable at these three sites.”As suggested by the reviewers, we have included an additional sensitivity analysis where, instead of using the average aEIR for the whole study period, we use the average up to the observation time-point (to avoid including future observations) .3) All non-linear models should be compared to their linear counterpart. In the current submission AP1 is the linear version of AP2, but there is no linear version of AP3 with the age/EIR interaction (similarly for the ADx models that consider temperature).We thank the reviewers for this suggestion. We have included a model with the linear interaction between age/EIR .4) Additional checking of model adequacy is needed e.g. plots of scaled residuals and predictive checks .We thank the reviewers for this suggestion. We have included some supplementary figures checking model adequacy .5) The evidence for the surprising non-monotonic relationships for acquired immunity predicted by the model would be greatly strengthened if the authors could present a plot clearly showing this signal in the data .We thank the reviewers for their observation. The non-monotonic relationship for acquired immunity captured by the model is certainly evident in the raw data, and this is one of the reasons why we are confident that this result is not an artifact of the analysis. Evidence for this signal is currently presented in one of the tables and two of the figures in the manuscript that summarize the raw data:- Table 1 shows that the prevalence of asymptomatic parasitemia was greater among children living in the lowest transmission setting  than in children living in the medium transmission setting (Kihihi).- Figure 1 is consistent with Table 1 and shows that the prevalence of asymptomatic parasitemia was greater in children 1-6 years old living in Walukuba (lowest transmission) than in children of the same age living in Kihihi.- Figure 3 (bottom right panel) shows the non-monotonicity most clearly. This figure shows that for a given parasite density, children living settings with the lowest aEIRs tend to develop lower objective temperatures than children living in slightly higher transmission setting. This is consistent with the non-monotonicity observed for anti-disease immunity. A similar trend is observed for parasite densities .To further show that the signal is present in the raw data, we have produced two additional figures to complement those presented in the manuscript. Reviewer #1:I reviewed an earlier submission of this manuscript which was rejected largely because of the consensus (following consultation between reviewers) that the analysis was not making the best of use of the data. In particular, not accounting for individual-level malaria history from previous visits was felt to be a big limitation.There have been a number of changes in the current submission which have undoubtedly improved the manuscript and addressed many substantive concerns. First, the provision of the code and data needed for the analysis is very welcome and helps clarify exactly what was done and makes it possible for others to verify the findings.Second, the revision has clarified that dependencies were accounted for (with a random effects term), and explained why more explicitly accounting for individual histories was not done . It has also clarified that individual exposure histories are being implicitly accounted for through adjustment for age, aEIR and through the random effects terms. In light of these clarifications, the modelling decisions seem more understandable.In addition to these clarifications there is some new material including individual immunity trajectories , additional models which did use data on recent exposure , but found no evidence that this recent exposure was associated with either anti-parasite or anti-disease immunity .There is also some additional sensitivity analysis e.g. adjusting for cumulative aEIR (rather than just aEIR) which suggests an effect of age independent of exposure.Finally, the authors have added figures showing confidence bounds for age and EIR-specific anti-parasite and anti-disease immunity. This were omitted from the original submission and are also a welcome addition.As the rebuttal letter makes clear, the authors do not have a clear explanation for the "provocative finding" that children exposed to the lowest transmission are developing immunity more effectively than those in more moderate transmission settings . Clearly, this finding goes against most preconceptions about how immunity in malaria works and I think the authors are therefore right to spend a lot of effort in sensitivity analyses to show that this is a robust finding and not an artefact. While the fact that same effect is seen for two different measures of immunity strengthens the case for this being a real effect, I am concerned that there are other possible reasons why this could still be an artefact which have not yet been ruled out. Two possibilities I can think of are:i) Is there a possibility that differences in measuring aEIR at different sites could account for this? The sensitivity analysis excluding Walukuba helps here . What about looking at Kihihi/Kanungu alone? This seems to have a big enough range of aEIRs that the effect should be seen if present. [note: following consultation this was not considered to be an essential revision].We do not think that differences in measuring aEIR could account for the difference, as all study procedures were standardized at all sites. The reviewer is right in pointing out that the non-linearity should be evident if the model is fit to just the data from Kihihi and Walukuba. Please see ii) Is there a possibility that there are edge effects in fitting that GAMs that introduce these effects? This could be checked, for example, by fitting the same models to simulated data under different assumptions. Is it possible get similar results  even when data are simulated under the assumption of a monotonic relationship between aEIR and the rate at which immunity develops? [note: following consultation this was not considered an essential revision].We thank the reviewer for their observation. As stated above  the fact that children in the lowest transmission setting are more immune is evident in the raw data and in all analyses. Therefore, we do not think it is an edge effect.When comparing the model fits (Supplementary file 1), the flexible GAM models  are compared with a single mixed model expressing a monotonic relationship (with temperature and log parasite density varying linearly with age and with log(aEIR)). Why not also consider other functional monotonic relationships between these measures of immunity and age and aEIR? [note: following consultation this was not considered an essential revision]We thank the reviewer for their observation. We have now included a model that includes a linear interaction between age and log(aEIR) . The models allowing for non-linear relationships consistently fit the data better.Finally, the mgcv packages allows a lot of flexibility when fitting GAMS/GAMMs including allowing for autocorrelated errors. Without diving into the code (which I haven't done) it is not clear what choices were made and why form the supplementary material alone. Are key results robust to modelling decisions made, and what diagnostics checks have been done?We thank the reviewer for their observation. As described above  we are confident that our finding is not an artifact of the analyses. The non-monotonicity in the association between aEIR and the outcomes of immunity is evident in the raw data and is also in the simplest of models (linear models stratified by aEIR).We have added some diagnostic plots to the supplementary figures.Reviewer #2:This is a data analysis exercise using cohort studies taken across the spectrum of Pf transmission in Africa. They use age and number of infectious bites per year to characterise how immunity develops over time. This is a very nice dataset and overall the paper is well written, and the plots are informative and clear. Code and data were provided online in order to reproduce the results.I have a few concerns in the following paragraphs.“aEIR as a metric of individual exposure”:The annual entomological inoculation rate (aEIR) is estimated from monthly mosquito household catch surveys. This estimated quantity is then plugged into the models  as the proxy for the total number of infectious bites per year. Given that in the lowest transmission setting, the median number of infectious bites is 2 per year, this implies that a median of 2 infectious mosquitoes were captured over the course of one year. What is the median denominator here, e.g. how many mosquitoes were captured? The uncertainty on these aEIR estimates must be much larger for the low transmission settings vs high transmission settings. This may explain why the R2 is also much lower when correlating log(aEIR) and hazard of infection . This may also explain the trends observed in Figure 3 (top right panel), where the individuals with lowest aEIR have lower parasite densities that those with medium aEIR.This potentially indicates that the aEIR is not a good estimate of the true number of infectious bites at very low transmission? If so, this means the conclusions drawn from the models cannot be taken at face value.See response above Model comparison:The online code was broken in parts and I had to spend an hour debugging it. This is quite annoying!My main question was to understand whether the more complex non-linear models (GAMs) were truly better than their linear counterparts. In particular whether the pattern shown in Figure 5B was not the result of over-fitting. If I understand Figure 5B correctly (probably the most important plot in the paper), a 2 year old with an aEIR of 2 infectious bites per year has on average the same anti-disease immunity as a 5 year old with an aEIR of ~200 infectious bites per year. This is very hard to believe and my prior on this being true would be very low. I believe this may be an artefact due to the problem highlighted above for the extremely low aEIRs.I ran a series of 50 random 10-fold cross-validation experiments in order to characterize the out-of-sample mean squared error of each of the models 1-3 and a fourth model: the linear equivalent of model 3 (interaction between age and log(aEIR) with random effects at the individual and household level). The author's model 2  performs best on average but the effect is very small. The fact that the non-linear model fits best the data is driving the surprising conclusions and I remain skeptical regarding the following line of the Abstract:"Our findings suggest a strong effect of age on both types of immunity, that is not explained by cumulative exposure. They also show a non-linear effect of transmission intensity, where children living in the lowest transmission intensity setting appear to develop immunity faster than those experiencing higher transmission."We are extremely thankful with the reviewer for taking the time to run our code and perform this cross-validation and apologize for the bugs in the code. As stated in our response to the Essential revisions (particularly #5) we are confident that the signal is present in the data. However, we agree that this finding is surprising and that’s why we have devoted a significant part of the discussion presenting different hypotheses that may explain this finding.Changes made:We have changed the wording of the Abstract as follows:“Our findings also show an independent effect of exposure, where children living in moderate and high transmission settings tend to develop immunity faster as transmission increases. Surprisingly, children living in the lowest transmission intensity setting appear to develop immunity more efficiently than those living in the moderate transmission setting.”Even if the underlying relationship is truly non-linear, it would be useful to report the conclusions of a linear model which are likely to be generalisable. This would be similar to what the authors have done , but for instance reported as: for a twofold increase in yearly inoculation, the pyrogenic densities decrease by X amount.We thank the reviewer for their observation. We fully agree that results from the linear model are useful and more interpretable. We have now included a table in the main text (Table 2) summarizing the results of the linear models . While a linear model makes the most sense for aEIR ≥5, we also report coefficients estimated when using the full dataset .Reviewer #3:It's tough to come out against this one as the authors have used some great data sets and innovative statistical modelling approaches to tackle a very hard question, namely how is immunity to malaria acquired in moderate to high transmission settings. My concern is that the design of the data, and the design of the model don't fit well together leading to some hard to explain results.Hard to explain results:There are at least two results which I would put in the 'hard to explain' category.Firstly, the authors have proposed biologically and epidemiologically well-informed hypotheses to explain the non-monotonic relationship with aEIR in Figure 7. However a simpler hypothesis is that this is an artefact of combining this particular model and this particular data set.Please see response to Essential revision #5.The second result is from Figure 6 where the fever threshold for 39C comes in and out of view as we increase from (a) aEIR = 2; (b) aEIR = 10; (c) aEIR = 50; to (d) aEIR = 200. This result would imply that a 2 year old with parasite density of 1e6 parasites/uL has fever > 39C when aEIR = 2; tolerates parasites better by having fever < 39C at aEIR = 10; then tolerates parasites worse by having fever > 39C when aEIR = 50; before finally switching back to better toleration of parasites with fever < 39C when aEIR = 200.oC) changes as a function of aEIR. Children living in a setting with aEIR=2 seem to tolerate higher parasite densities than children living in settings with aEIR of 10, 50 or 200 without developing objective temperature >38oC.We thank the reviewer for their observation. The main result that we want to highlight on Figure 6 is how the fever threshold .We really don’t have enough data to properly estimate the parasite densities associated with a temperature of 39Changes made:To avoid confusion we have removed the 39°C contour from the plot."They also show a non-linear effect of transmission intensity, where children living in the lowest transmission intensity setting appear to develop immunity faster than those experiencing higher transmission."In an Abstract, one has little choice but to read a statement literally. This implies that children living in the lowest transmission setting appear to develop immunity faster than those experiencing higher transmission. This flies in the face of conventional malaria epidemiology. Perhaps the authors are trying to say something more subtle like there is a diminishing contribution to the acquisition of immunity with subsequent infections.We thank the reviewer for their comment. We have modified the wording of the Abstract as follows:“Our findings also show an independent effect of exposure, where children living in moderate and high transmission settings tend to develop immunity faster as transmission increases. Surprisingly, children living in the lowest transmission intensity setting appear to develop immunity more efficiently than those living in the moderate transmission setting.”Model:The authors have provided a change in notation to emphasise the utilisation of random effects, but otherwise left the model and results unchanged. The random effects at the individual and household level will account for a substantial degree of the variation between children. However, within an individual the only piece of longitudinal information included is age, incremented by the index k for visit. Otherwise, incidence of symptomatic episodes are independent (and there can be up to 30 of them). For example, the probability of symptomatic malaria is the same for a child on their 1st and 10th episodes.st and 10th episodes unless they occurred on the same day.While it is true that age is the main longitudinal variable, the model includes an interaction between our metric of exposure (aEIR) and age, which implicitly accounts for cumulative exposure (a function of time exposed (or age in endemic settings) and aEIR). Thus, the probability of symptomatic malaria would not be the same for a child on their 1Furthermore, we did consider models that explicitly account for cumulative exposure and for recent exposure. These results are presented in Figure 5—figure supplements 2 and 3.It is notable that although age is updated at each visit, aEIR is not – instead being averaged over the duration of follow-up. Looking at Figure 5 of the original publication by Kamya et al., we see that there is a lot of time-dependent variation. For example, in Kihihi there is a huge spike in aEIR in 2013 towards the end of the study.Please see response to Essential revision #2.Some of the 'hard to explain' results could be arising from non-linearities and tensor interactions in the generalised additive models. Looking at models AP1-3, I note very little change in% deviance explained despite changes in the AIC. Looking at models SM1-3, I note that as model complexity increases, the% deviance explained actually decreases, despite the AIC appearing to favouring the more complex models.Data:I am concerned that the passively detected cases and routinely (every 3 months) detected cases are fundamentally incompatible.If I interpret things correctly, a passively detected case will by definition contribute 1 count of a symptomatic episode and 1 light-microscopy measurement of parasite density. These data provide no discriminatory power on whether an infection  becomes symptomatic, and no information on temperatures < 38°C.Please see response to Essential revision #1. The reviewer is right in saying that a passively detected case will, by definition, contribute 1 count of a symptomatic episode and 1 measurement of parasite density. However, it is not true that the data provide no information on temperatures <38°C. 1946/3788 passive visits had objective temperatures <38°C.By not having the precondition of treatment-seeking behaviour and fever >38°C, routinely detected cases arguably provide richer information. Although the majority of these measurements are parasite negative (by microscopy) and presumably excluded.oC is not a pre-condition of non-routine visits .Please see response to Essential revision #1. While it is true that routine visits do not have the pre-condition of treatment-seeking behavior, fever >38It is not right to think either that routine visits are unbiased or provide richer information. In this pediatric population, most of the malaria infections are symptomatic (particularly in children < 5 years), and these are largely captured by the passive system (>95% of febrile illnesses are captured by the passive system). Routine visits only capture symptomatic malaria when (by coincidence) the person becomes sick the day of the visit. Thus, by including only routine visits we would be excluding the majority of the data and of the outcomes of interest.In Table 1 there are reported to be 2447 + 1555 + 207 = 4209 symptomatic episodes versus 955 + 331 + 145 = 1431 asymptomatic parasitaemia episodes. This suggests that the passively detected cases are provided far more data points.The reviewer is right. As stated above and in response to Essential revision #1, the passive surveillance system captures most malaria infections in this populations, as the majority of infections are symptomatic.The authors have now adequately addressed all but one of the reviewers' main concerns.The one last point, which reviewer 3 noted the authors did not address in their previous response, was related to the unexpected result of% Deviance Explained as the complexity increases for the nested models for anti-parasite immunity and overall immunity against symptomatic malaria. From the previous review:"Looking at models AP1-3, I note very little change in% deviance explained despite changes in the AIC. Looking at models SM1-3, I note that as model complexity increases, the% deviance explained actually decreases, despite the AIC appearing to favouring the more complex models."This is an important point that requires a response.We thank the reviewer for their comment and apologize for not addressing this point before.While it is expected that AIC should correlate well with the% deviance explained, the correlation is not perfect particularly when the change in model fit is small. As the reviewer points out, when comparing models SM2 and SM4, the% deviance explained decreases while the AIC changes very little (from 5373 to 5369). This suggests that SM4 (the more complex model) is not really an improvement over SM2 (the model without the interaction). When comparing models AP1-AP4 the% deviance explained does not change much, while the changes in AIC are larger (from 14052 to 14032) and we interpret this as evidence of a better fit of the more complex model. Larger changes in both AIC and% deviance explained, as those observed comparing models AD1-AD4, do provide stronger support in favor of the more complex model for this particular outcome.Since the non-linear interaction models seem to fit the data better for both anti-disease and anti-parasite immunity models, we decided to present results from this model for all outcomes of interest in the paper. However, the main study findings are robust to model choice. The main results are presented in  for models AP2 and SM2.Changes made:Since our model choice relied on AIC more than on percent deviance explained, we have changed the text in the Materials and methods as follows:“Best fitting models were selected based on Akaike’s Information Criterion, but changes in the percent deviance explained are also presented.”In addition, we have added some text to the section “Overall immunity against symptomatic malaria” stating that model fit was similar for models SM2 and SM4.“Models allowing smooth relationships, with or without for two-way interactions, fit the data equally well.”Reviewer 2 also made the comment that It would be useful if the authors provided an extra variable in their data on github: passive versus active detection.We apologize if this is not clear in the data. All visits where the “visittype” variable is “Not routine” are from passive case detection. All other values  correspond to active detection.We have added this information to the data dictionary.