A recent danish study  showed that infections can impair cognitive ability. In fact, ensuing infections can affect cognitive performance (as measured by an IQ test), long after the infection has resolved. This effect persists more than 15 years after the most recent infection, and is dose-dependent such that cumulative number of infections correlates with IQ decrements.
It is increasingly appreciated that infection and the immune response can activate immune cells in the brain. Previous studies have linked c-reactive protein (CRP), an inflammatory marker which is often elevated in the setting of herpes virus, HIV and hepatitis, with cognitive impairment. In particular, sepsis and encephalitis insidiously affect cognitive performance long after the infection has remitted. These observations raise the possibility that infections can incur persistent changes in brain function.
The neuroinflammation hypothesis of neurodegenerative disease and neuropsychiatric illness (e.g., depression), has also gained recent traction. Despite heterogenous triggering events, a common theme in neurodegenerative disease is chronic immune activation in the CNS. Activation of microglia, the resident macrophages of the brain, plays a particularly important role. (Macrophages are a type of white blood cell that engulfs and digests cellular debris and microbes.)
This nation-wide danish study, published in PLOS ONE on May 13, 2015, was extremely high-powered, enrolling 180,000 participants born in Denmark between 1976 and 1994 who were assessed between 2006 and 2012. The p-value (a function used for testing a statistical hypothesis) corresponding to these results was less than 0.001,
indicating that the probability that the findings were due to chance alone (or that the null hypothesis is true) is less than 0.1%. This p-value indicates that
IF the null hypothesis is true, there is only a 0.1% chance that we could get this much deviation (or more) from it due to chance.
The authors report that:
The number of hospital contacts with infection affected the cognitive ability in a dose-response relationship, where the group with 10 or more hospital contacts with infections were associated with a mean score of 5.54 units lower cognitive ability (95%CI: –7.20 to -3.89; corresponding to 0.37 SD; n = 351), compared to people without hospital contacts for infections (Table 2). The associations were greater when looking at individuals with hospital contacts for different types of infections, where individuals with 4 hospital contacts with different types of infections had a mean score of 6.84 units lower cognitive ability (95%CI: –8.17 to -5.50; n = 579) and individuals with 5 or more different types of infections, had a mean score of 9.44 units lower cognitive ability (95%CI: –13.20 to -5.69; corresponding to 0.63 SD; n = 85) (Fig 1). The dose-response relationship was also significant in the fully adjusted model (P<0.001).
The study uncovers what amounts to a “dose-dependent” effect, where the number of hospital visits was correlated to increasing decrements in cognitive ability, as measured by IQ tests between 2006 and 2012.In addition, the impact on cognitive ability increased with the temporal proximity of the last infection (p < 0.001), where a hospital visit within the last year was correlated with a mean score of 2.95 units lower in cognitive performance. However, the mean effect was significant even if the last infection had occurred in the time period more than 15 years before the cognitive test, indicating that the effect of infection on cognitive ability is long-lasting.
The authors consider the possibility that a reverse association may exist, whereby individuals with lower cognitive ability are more likely to become infected. However, the authors note that this reverse association could not account for the observed temporal correlations or the correlations with the severity of infection. Moreover, the correlation between infections and cognitive ability retained significance even after adjustment for other parameters known to influence general cognitive ability, such as gestational age, birthweight, and being later in sibship, which are also associated with socio-economic gradients.
 Benros ME, Sørensen HJ, Nielsen PR, Nordentoft M, Mortensen PB, Petersen L. The Association between Infections and General Cognitive Ability in Young Men – A Nationwide Study. PLoS ONE. 2015;10(5):e0124005.