Background: The quality of sleep has different physical and psychological consequences, and can affect students' academic achievement. Objectives: This study aimed to explore factors associated with sleep quality in university students using panel regression. Methods: This study was conducted based on the data from a longitudinal study, namely the “Health and Lifestyle of University Students”. The Pittsburgh Sleep Quality Index (PSQI), a self-administered questionnaire containing general information about sleep quality, Beck Anxiety Inventory (BAI), a questionnaire consisting of information about anxiety, Healthy Lifestyle Scale for University Students (HLSUS), and a questionnaire including information about lifestyle were completed by students during the first eight weeks of their first semester. The Panel linear regression and frontier model were used to assess the association of sleep quality with sex, unit, residency, marital status, teeth brushing, drug use, alcoholic drinks, age, anxiety, and healthy lifestyle. Results: A total of 706 individuals (46.8%) suffered from poor sleep quality. Between the two models of panel linear regression and frontier, the former (i.e., panel linear regression) was determined to be a more powerful model with the Akaike information criteria = 3790.68 and Bayesian information criteria = 3899.712, suggesting that the dormitory students with a high level of anxiety and low level of healthy lifestyle had significantly poor sleep quality. Conclusions: Residency, drug use, anxiety, and healthy lifestyle scale were found to be closely associated with sleep quality of university students by using panel linear regression model. Our finding may have been of valuable help to policymakers and planners in their effort to improve the sleep quality of university students.