Researchers analyzed brain scans from more than 5,800 children and compared them with their social lives two years later.