High school students who perform well in school, have better test scores and complete higher-level classes are more likely to move to and work in markets where there are more college-educated people in the workforce, according to a new study.

In the report, presented at the 111th Annual Meeting of the American Sociological Association, researchers looked at data from 14,825 sophomores in more than 1,000 U.S. high schools who were first surveyed in 1980, then four more times until 2014, when they were about 50 years old. The researchers wanted to understand how cognitive skills, school performance and college preparation influenced where people moved between high school and middle age.

Overall, 36% of the people moved between high school and midlife. The researchers found that high schoolers who took advanced math classes, scored higher on tests and had higher GPAs in high school were more likely to move to job markets where there were more college-educated people. People who had a college degree were also more likely to move to these markets.

Get our Health Newsletter. Sign up to receive the latest health and science news, plus answers to wellness questions and expert tips. Please enter a valid email address. Sign Up Now Check the box if you do not wish to receive promotional offers via email from TIME. You can unsubscribe at any time. By signing up you are agreeing to our Terms of Use and Privacy Policy . This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply. Thank you! For your security, we've sent a confirmation email to the address you entered. Click the link to confirm your subscription and begin receiving our newsletters. If you don't get the confirmation within 10 minutes, please check your spam folder.

Students who held the belief that they could control their own destiny were also more likely to move, but not necessarily to places where there were more college-educated workers. The researchers say that this supports the idea that “opportunity and migration today involves cognitive skills and education.”

“Although the data do not allow us to establish whether early skills and education cause migration and living in a labor market with a better economy, the evidence is consistent with the possibility,” said lead study author Chandra Muller, a University of Texas at Austin sociology professor, in a statement.

Studying movement within the United States can provide insight into job opportunities, the researchers argue. Areas where there are more college-educated people in the workforce can benefit from innovation and economic growth, which in turn attracts even greater numbers of highly educated workers.

Contact us at letters@time.com.