This is according to a new study considering factors like cost of living, health care access, safety, and social opportunities.