The freshmen stage is a high incidence period for psychological issues. With the increasing gap between urban and rural areas in China, the mental problems of rural freshmen are more prominent in recent years due to the huge contrast of campus life with their growth environment and other reasons. The concern for the mental well-being of both rural and urban freshman students prompted our comprehensive five-year study (2018-2022) on psychological issues in a group of 12,564 first-year students from dozens of public universities in Shandong province. The investigation employed PPS (probability proportional to size) sampling and was conducted near the the end of the first semester. Using the data gathered, we analyzed and compared the indicators of psychological problems in rural and urban freshmen by Duncan's Multiple Range Test. We also conducted a canonical correlation analysis and pathway analysis to examine the psychological factors that contribute to anxiety and depression in both rural and urban freshmen. According to the findings, rural freshmen exhibit significantly higher levels of anxiety and depression than their urban counterparts. Inferiority, obsession, and internet addiction were identified as the primary influencing factors of anxiety and depression in both rural and urban freshmen. Social phobia was found to be a significant influencing factor for anxiety in rural freshmen, while bigotry was identified as a specific influencing factor for urban freshmen. Furthermore, the results of the path analysis suggest that anxiety plays a crucial role as a mediating factor between the main influencing factors and depression. These results substantially extend former research in this area and have important implications for the development of effective intervention strategies to address anxiety and depression. According to these results, policymakers should assess and intervene of anxiety and depression as a whole, and provide mental health education according to main effect factors of freshmen from rural and urban areas. Detailed policy recommendations are in discussion and conclusion.