Functions to analyze hospital data