Factors associated with vulnerability and fragility in the elderly: a cross-sectional study