Children who are top of the class in primary school are likely to do better in exams later on because they are more confident, research suggests.
The Centre for Economic Performance at the London School of Economics analysed test data of more than two million pupils in England for the research.
They also conducted a survey on confidence among 15,000 young people.
The survey asked pupils to rate how good they thought they were in English, maths and science.
The researchers concluded that those children who were ranked highly academically at primary school did better in secondary school, partly because their academic success early on had made them more confident in their abilities.
They conclude that "rank position within primary school has significant effects on later achievement, conditional on end-of-primary national test scores".
The study also finds pupils' ranking in primary school has more of an impact on boys than on girls.
"Male confidence in a subject is five times more affected by their local rank compared to females.
"Accordingly, we find that male students gains four times more in later test scores from being top of class compared to a comparable female students."
The study also concludes that the effect of confidence on exam results was specific to subjects - so a child that had a high ranking in maths early on, and was confident in it, was more likely to get good results in the subject later in their schooling.
Study author Richard Murphy said: "While we cannot make every pupil top of class, our research highlights the importance of confidence in order to succeed.
"It is human nature for us to compare ourselves against others. A kid being the best in their street at football would become more confident and spend more time playing and so further improve."
Study co-author Dr Felix Weinhardt said: "Our findings go against the common assumption that having better peers is always the best for children.
"Our study suggests that there are situations where your child will be better off from not going to the school with high-performing peers, especially for boys."