ObjectiveThe model uncertainty may result in inconsistency about the environmental factors of myopia among students, and the Bayesian model average (BMA) is an effective way to eliminate it. We aimed to explore the influencing factors of myopia in primary and middle school students by BMA.MethodsThe data came from the 2021 National Surveillance of Common Diseases and Health Influencing Factors of students. By stratified random cluster sampling, the physical and mental health status of students in Tianjin and the factors affecting their physical health, such as diet, exercise, mental stress, school bullying, sleep time, and internet use, were investigated. The sample consisted of 8,457 primary school students, 8,191 junior middle school students, and 5,901 senior middle school students. Besides the physical examination, we used computer optometry (non-ciliary paralysis) to screen myopia. And we used BMA to select the risk factors through the BMS package in R.ResultsThe exercise was the only factor that affected the eyesight of junior and senior middle schoolers by BMA, with the posterior probability of 0.9736 and 0.9762, but not for the primary students. And we failed to select variables that affected eyesight in grades 4–6 of primary school.ConclusionThe exercise was a strong influencing factor for the eyesight of students in Tianjin's junior and senior middle schools.