Factors associated with hospital closure and merger