The impact of psychosocial and clinical variables on duration of inpatient treatment for depression