Correction to: Nature Human Behaviour https://doi.org/10.1038/s41562-021-01195-5, published online 7 October 2021.

In the version of this Comment initially published, the median age of onset of depression was erroneously reported to be 20.5 years. In actuality, median age of onset of depression is 31 years; 20.5 years is the peak age at onset (per ref. 2). The html and pdf versions of the article have been corrected to report accurate median and peak ages at onset for both anxiety and depression.