Quality of life: relationship with sociodemographic and cognitive aspects in older people in community groups