Factors associated with length of psychiatric hospitalization.