It looks like they accounted for that or at least did as much as they could to account for that.
>In patients with no previous psychiatric history, a diagnosis of COVID-19 was associated with increased incidence of a first psychiatric diagnosis in the following 14 to 90 days compared with six other health events.
So it looks like they compared it to six other health events and it (anxiety, insomnia, dementia) was still higher with COVID, but they add "we cannot exclude possible residual confounding by socioeconomic factors."
>In patients with no previous psychiatric history, a diagnosis of COVID-19 was associated with increased incidence of a first psychiatric diagnosis in the following 14 to 90 days compared with six other health events.
So it looks like they compared it to six other health events and it (anxiety, insomnia, dementia) was still higher with COVID, but they add "we cannot exclude possible residual confounding by socioeconomic factors."
From: https://www.thelancet.com/journals/lanpsy/article/PIIS2215-0...
I hope it's not true, but it looks like more and longer-term studies need to be done.