Correction to: Nature Medicine https://doi.org/10.1038/s41591-021-01556-7, published online 25 October 2021.

In the version of this Article initially published online, there were errors in the author affiliations shown for authors Xue W. Mei, Sharon Dixon, Carol A. C. Coupland and Julia Hippisley-Cox. They are affiliated with the Nuffield Department of Primary Health Care Sciences, University of Oxford, Oxford, UK (affiliation 1), not the Nuffield Department of Clinical Neurosciences (affiliation 2). The changes have been made to the online version of the Article.