Modeling hospital length of stay and cost with heterogeneity