It is a seductively simple idea: human traits, ranging from smoking to loneliness to obesity, are contagious, spreading through social networks like the flu.