Research in the area of Computer Science (CS) education, has focused on identifying the reasons that students do not finish their studies in CS. Although there is increasing demand for CS professionals, there is not enough knowledge to explain the high dropout rates in CS education. This study aims to empirically examine how students' intention to complete their studies (retention) in CS is affected by variables playing a key role in higher education. By identifying which variables contribute to dropout in CS studies, we will be able to focus on how to improve aspects related with them in order to reduce dropout rates. To do so we identified the following variables: Year of studies, Gender, Age, Students' Effort, Absence from Classes, Expected Grade point average (GPA), and Current GPA, and tested their effect on retention, based on the responses collected from 241 CS student. Year of studies and Effort have positive effects on students' intention to finish their studies in CS. Interestingly, the expected GPA has a negative effect on students' intentions to finish their studies. The findings contribute to theory and practice, as they offer CS educators and policy makers insights that may aid towards increased student retention and reduced dropout rates.