High School Student Performance Analysis

Understanding the Factors Influencing Final Grades in Mathematics

Andreas Sanches

Introduction

  • As a student, I understand the importance of having good grades and a great relationship with professors, classmates and family.
  • I’ll explore a dataset created by Professor Paulo Cortez on Portuguese high school students. He collected school reports, surveys, demographic details, social factors, parental information, and school-related characteristics to make his Dataset.

Data Overview

  • Focus on Mathematics students.
  • 34 variables, reduced to 18 relevant ones.
  • Data collected from “Gabriel Pereira” and “Mousinho de Silveira” high schools
  • 395 observations (395 students)

Research Question

  • How do family characteristics, and personal habits influence the final grades of high school students in mathematics?

Data Analysis Plan

  • See if there’s any relationship between the “Final Grades” variable (response variable) and other variables, which include personal habits, study hours, family relationship and absences (explanatory variables)

Load and open packages

library(tidyverse)
library(plotly)
library(viridis)
library(rmarkdown)
library(revealjs)

Loading the dataset I’ll use

setwd("/cloud/project/Data")
students_data <- read_csv("student_math_clean.csv")

Removing unecessary columns

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 <- NULL

Convert study_time to factor with ordered levels

students_data$study_time <- factor(students_data$study_time, 
                                    ordered = TRUE, 
                                    levels = c("<2 hours", "2 to 5 hours", "5 to 10 hours", ">10 hours"))

First visualization - Study Time vs. Final Grade

Second visualization - Family Relationship Quality vs. Final Grade

Third visualization - Family Relationship Quality vs. Final Grade

Let’s create a new column that shows the week alcohol consumption!

Since the original dataset has 2 different alcohol columns (one for weekdays and another for weekends)

students_data_new <- mutate(students_data, weekly_alcohol_consump = weekday_alcohol + weekend_alcohol)

Let’s create a new variable for alcohol consumption levels

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
  ))

Now, let’s create a scatterplot that illustrates this relation!

Conclusion

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.