The influence of sex, gender, age, and ethnicity on psychosocial factors and substance use throughout phases of the COVID-19 pandemic