Influence of pain on the functional capacity of elderly nursing home residents and elderly participants in social group associations