Dogs mirror the personalities of their human companions, according to research.