Understanding the Factors Influencing Final Grades in Mathematics
students_data$sex <- NULL
students_data$age <- NULL
students_data$address_type <- NULL
students_data$family_size <- NULL
students_data$parent_status <- NULL
students_data$mother_education <- NULL
students_data$father_education <- NULL
students_data$mother_job <- NULL
students_data$father_job <- NULL
students_data$reason <- NULL
students_data$guardian <- NULL
students_data$travel_time <- NULL
students_data$class_failures <- NULL
students_data$activities <- NULL
students_data$nursery_school <- NULL
students_data$extra_paid_classes <- NULL
students_data$internet_access <- NULLRows: 395
Columns: 18
$ student_id <dbl> 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 1…
$ school <chr> "GP", "GP", "GP", "GP", "GP", "GP", "GP", "GP", …
$ school_choice_reason <chr> "course", "course", "other", "home", "home", "re…
$ study_time <chr> "2 to 5 hours", "2 to 5 hours", "2 to 5 hours", …
$ school_support <chr> "yes", "no", "yes", "no", "no", "no", "no", "yes…
$ family_support <chr> "no", "yes", "no", "yes", "yes", "yes", "no", "y…
$ higher_ed <chr> "yes", "yes", "yes", "yes", "yes", "yes", "yes",…
$ romantic_relationship <chr> "no", "no", "no", "yes", "no", "no", "no", "no",…
$ family_relationship <dbl> 4, 5, 4, 3, 4, 5, 4, 4, 4, 5, 3, 5, 4, 5, 4, 4, …
$ free_time <dbl> 3, 3, 3, 2, 3, 4, 4, 1, 2, 5, 3, 2, 3, 4, 5, 4, …
$ social <dbl> 4, 3, 2, 2, 2, 2, 4, 4, 2, 1, 3, 2, 3, 3, 2, 4, …
$ weekday_alcohol <dbl> 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, …
$ weekend_alcohol <dbl> 1, 1, 3, 1, 2, 2, 1, 1, 1, 1, 2, 1, 3, 2, 1, 2, …
$ health <dbl> 3, 3, 3, 5, 5, 5, 3, 1, 1, 5, 2, 4, 5, 3, 3, 2, …
$ absences <dbl> 6, 4, 10, 2, 4, 10, 0, 6, 0, 0, 0, 4, 2, 2, 0, 4…
$ grade_1 <dbl> 5, 5, 7, 15, 6, 15, 12, 6, 16, 14, 10, 10, 14, 1…
$ grade_2 <dbl> 6, 5, 8, 14, 10, 15, 12, 5, 18, 15, 8, 12, 14, 1…
$ final_grade <dbl> 6, 6, 10, 15, 10, 15, 11, 6, 19, 15, 9, 12, 14, …
Since the original dataset has 2 different alcohol columns (one for weekdays and another for weekends)
students_data_new <- students_data_new |>
mutate(alcohol_level = case_when(
weekly_alcohol_consump >= 0 & weekly_alcohol_consump <= 4 ~ "Drink little",
weekly_alcohol_consump >= 5 & weekly_alcohol_consump <= 6 ~ "Drink regularly",
weekly_alcohol_consump >= 7 & weekly_alcohol_consump <= 10 ~ "Drink a lot",
TRUE ~ "Unknown" # Add a default category for other values
))The visualizations yielded surprising results. Weekly study time and final grades exhibited minimal differences, challenging assumptions about study habits. Family relationship quality showed no significant impact on performance, contradicting expectations. Fewer absences correlated with higher grades, supporting intuitive expectations. Contrary to assumptions, increased alcohol consumption did not significantly affect academic performance. Overall, these findings emphasize the role of attendance factor in academic success, challenging common beliefs about the influence of study time and alcohol consumption.
P. Cortez and A. Silva. Using Data Mining to Predict Secondary School Student Performance. In A. Brito and J. Teixeira Eds., Proceedings of 5th FUture BUsiness TEChnology Conference (FUBUTEC 2008) pp. 5-12, Porto, Portugal, April, 2008, EUROSIS, ISBN 978-9077381-39-7. https://www.kaggle.com/datasets/dillonmyrick/high-school-student-performance-and-demographics?select=student_math_clean.csv