A furry friend can do more than provide companionship for aging adults.