We study the factors that influence the health of a person and human longevity with methods of mathematical modeling. We pay special attention to the use of modern data analysis methods that take into account the effects of heterogeneity in the considered groups of people due to genetic, behavioral differences, and presence of concomitant diseases that affect the condition of a person differently. We study the relationship between mortality due to causes and diseases that the person had at the end of his or her life.