Functional capacity and associated factors in the elderly: a population study