Student academic performance is influenced by a variety of factors, including study habits, previous academic experiences, and school attendance. Understanding how these factors relate to academic achievement can provide insight into patterns in student performance and help identify areas that may deserve further investigation. Mathematics performance is particularly interesting to examine because students may experience different levels of difficulty depending on their academic preparation, study habits, and previous experiences.
For this project, I selected the Student Performance dataset from the UCI Machine Learning Repository. The dataset contains information about students from two Portuguese secondary schools. The information was collected through school reports and questionnaires and includes academic, demographic, social, and school-related variables. The repository provides separate datasets for mathematics and Portuguese language courses. This project focuses exclusively on the mathematics dataset, student-mat.csv, which contains 395 student records and 33 variables.
Although the original dataset includes many variables, this analysis focuses on six variables that are relevant to academic performance: weekly study time (studytime), number of school absences (absences), previous academic failures (failures), first-period grade (G1), second-period grade (G2), and final mathematics grade (G3). The final grade, G3, is the primary outcome examined throughout the project.
The goal of this analysis is to explore whether study habits and previous academic experiences are associated with final mathematics performance. Specifically, the project investigates three research questions:
Does weekly study time relate to mathematics performance? This question examines whether students who report spending more time studying tend to have higher final mathematics grades.
Are previous academic failures related to final mathematics grades? This question explores whether students with a greater number of previous academic failures tend to have lower final grades.
Are school absences associated with final mathematics grades? This question investigates whether students with more absences tend to have different mathematics outcomes and whether this relationship varies across study-time groups.
Through descriptive statistics, data visualization, and correlation analysis in R, this project aims to identify patterns and relationships among these variables. Rather than attempting to predict individual student outcomes or establish cause-and-effect relationships, the analysis focuses on exploring the data and interpreting associations. Ultimately, the goal is to better understand how selected academic behaviors and previous academic experiences relate to mathematics performance within this sample of students.
The original UCI Student Performance mathematics dataset contained 395 student records and 33 variables. The dataset was imported into RStudio using the read.csv() function. For this project, six variables were selected based on their relevance to mathematics performance: weekly study time (studytime), school absences (absences), previous academic failures (failures), first-period grade (G1), second-period grade (G2), and final mathematics grade (G3).
The dataset was examined for missing values and duplicate records. No missing values were identified among the variables, and no duplicate rows were found. Therefore, no observations needed to be removed because of missing or duplicated data.
The structure of the selected variables was also examined. All six variables were stored as integers, which was appropriate for the planned analyses. No data-type conversions were necessary.
Descriptive statistics were used to examine the ranges and distributions of the selected variables. Most students reported between zero and eight absences, although the maximum was 75. An additional investigation identified 15 students with more than 20 absences. Their mathematics grades varied, so these observations were retained rather than automatically classified as errors or removed.
Zero values in the final grade variable (G3) were also investigated. Because there was no evidence that these values were data-entry errors, they were retained in the analysis.
Finally, a smaller analysis dataset was created containing the six selected variables. This resulted in a dataset with 395 observations and six variables. No student records were removed during the cleaning process.
The analysis revealed a positive association between weekly study time and average mathematics performance across the first three study-time categories. Students who reported studying 5–10 hours per week had the highest average final mathematics grade (11.40), compared with students studying less than 2 hours (10.05) and those studying 2–5 hours (10.17). Interestingly, students reporting more than 10 hours of weekly study had a slightly lower average grade (11.26) than the 5–10-hour group. This suggests that the relationship between study time and mathematics performance may not be strictly linear. However, these results describe an association and do not establish causation.
A clear negative association emerged between the number of previous academic failures and final mathematics grades. Students with no previous failures had an average final grade of 11.25, compared with 8.12 for students with one previous failure, 6.24 for students with two previous failures, and 5.69 for students with three previous failures. The difference between students with no previous failures and those with three previous failures was approximately 5.56 grade points. These findings suggest that previous academic difficulties are associated with lower mathematics performance. However, the groups with two and three previous failures were relatively small, and the analysis does not establish causation.
The correlation between school absences and final mathematics grades was approximately 0.034, indicating an extremely weak positive linear relationship. This suggests that the number of absences alone was not meaningfully associated with final mathematics performance in this sample. Although attendance may influence academic outcomes in other contexts, this analysis did not identify a meaningful linear relationship between absences and final grades. Correlation does not establish causation, and other factors may be relevant to student performance.
Additional analysis examined the relationship between school absences and final mathematics grades across different study-time groups. The correlations were very weak for students studying less than two hours per week (r = 0.089), two to five hours (r = -0.0004), and five to ten hours (r = 0.089). Students studying more than ten hours per week had a somewhat stronger positive correlation (r = 0.288), although this relationship was still relatively weak. These findings suggest that the relationship between absences and mathematics performance varies slightly across study-time groups, but absences were not strongly associated with final grades in any group. The smallest study-time group contained only 27 students, so its result should be interpreted cautiously.
The distribution of final mathematics grades shows that most students received grades in the middle of the scale, while relatively fewer students received extremely low or extremely high grades. This suggests that the dataset is concentrated around moderate levels of mathematics performance rather than being dominated by either very high or very low scores.
The primary findings were:
Study time: Students studying 5–10 hours per week had the highest average final mathematics grade (11.40). Students studying more than 10 hours had a slightly lower average (11.26), suggesting the relationship was not strictly linear.
Previous academic failures: Students with no previous failures averaged 11.25, compared with 5.69 among students with three previous failures. This was the strongest relationship observed in the analysis.
School absences: The overall correlation between absences and final mathematics grades was approximately 0.034, indicating almost no linear relationship.
Additional analysis: Correlations between absences and grades remained relatively weak across the four study-time groups.
Several limitations should be considered when interpreting these findings:
The dataset contained 395 students, and some subgroups, particularly students reporting more than 10 hours of weekly study, were relatively small.
Study time was measured using four categories rather than exact weekly study hours.
The analyses examined associations and correlations, so they cannot establish that any of the selected factors directly cause changes in mathematics performance.
Other factors not examined in this project may also influence student achievement.
The findings are based on the mathematics portion of the dataset and should not automatically be generalized to all students or academic subjects.
Overall, previous academic failures showed the strongest relationship with final mathematics performance among the three factors examined. Weekly study time also showed a generally positive association with grades, while school absences had almost no overall linear relationship with final grades. These findings demonstrate that academic performance is influenced by multiple factors and that examining individual variables and student subgroups can provide a more detailed understanding of educational outcomes.
Cortez, P. (2008). Student Performance [Dataset]. UCI Machine Learning Repository. UCI Student Performance dataset