The analysis, which used a complex marketing database to compare an area's test results with its socioeconomic status, found that a pupil's peer group was the third most important factor in determining their success.
The first was previous test scores and the second, the socioeconomic make-up of their neighbourhood. The class and race of the child was less important. Disadvantaged children attending predominantly middle class schools achieved noticeably higher results than peers at schools dominated by low-income families, research found.
Conversely, middle class children at low-performing inner city schools under achieved. Last week, Mr Johnson said he wished to make poorer students "the most exciting recruits for the most ambitious schools". The remarks were part of a wider strategy of offering poorer pupils access to a middle class education by encouraging private schools to go public and expand their bursary schemes.
The strategy has for many signified a loss of faith in the mixed ability and mixed class comprehensive system. But it has been given statistical backing by this latest research, to be published in the Urban Studies journal in January. A culture of achievement, high expectations, low disruption and raised intellectual stimulation were likely to account for the disparity, researchers said.
"If people come from a background where there is a respect for learning and tangible benefits to be seen from it, it alters the way classes operate, almost irrespective of the teacher," said Professor Tim Butler, of King's college, London, the study's co-author.
Steve Patriarca, headteacher of William Hulme's grammar school, Manchester, agreed. He said: "We have children from the local academy coming here to do their A-levels and what's striking is the motivation. They are very appreciative of the education on offer."