A new large-scale longitudinal study has found a clear link between episodes of depression and anxiety experienced by adults in their twenties, thirties and forties, with a decrease in memory function by the time they are in their fifties.