#Pupose of the project

The main aim of this analysis is to investigate on the possible causes of academic pressure amongst students.The analysis seeks to find out the sources of stress withing the academic environment by exploring the factors like gender, age and major as well as academic, financial, and psychological factors.The findings shall provide much needed information that will enable educators, administrators, as well as policymakers to fashion out ways and means of reducing pressure, assist in matters dealing with well-being, and ultimately improved student performance.

#Data Features

The data features in this project include: Academic Pressure, Gender, Age, Degree Major, Academic Workload, Study Satisfaction, Financial Concerns, Social Relationships, Depression, Anxiety, Isolation, and Future Insecurity.

library(readxl)
library(writexl)
library(ggplot2)
library(dplyr)
## 
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
#Loading the data
MentalHealthSurvey <- read_excel("C:/Users/HP/Desktop/DATA/MentalHealthSurvey.xlsx")
View(MentalHealthSurvey)

#Data Preparation

#Checking for missing values 
sum(is.na(MentalHealthSurvey))
## [1] 0
# Reversing some colums for easier interpretation
columns_to_reverse <- c("academic_workload", "academic_pressure", "financial_concerns", 
                        "depression", "anxiety", "isolation", "future_insecurity")

# Applying the reversal across the specified columns
MentalHealthSurvey[columns_to_reverse] <- apply(MentalHealthSurvey[columns_to_reverse], 2, function(x) 6 - x)

head(MentalHealthSurvey[columns_to_reverse])
## # A tibble: 6 × 7
##   academic_workload academic_pressure financial_concerns depression anxiety
##               <dbl>             <dbl>              <dbl>      <dbl>   <dbl>
## 1                 2                 1                  2          4       5
## 2                 2                 2                  5          3       3
## 3                 1                 1                  3          4       3
## 4                 1                 2                  2          1       1
## 5                 1                 1                  4          1       1
## 6                 1                 1                  3          1       1
## # ℹ 2 more variables: isolation <dbl>, future_insecurity <dbl>

#Average academic pressure by Gender

# Calculating the average academic pressure by gender
avg_pressure <- MentalHealthSurvey %>%
  group_by(gender) %>%
  summarise(mean_pressure = mean(academic_pressure, na.rm = TRUE))

# Generating a bar chart for academic pressure and gender
ggplot(avg_pressure, aes(x = gender, y = mean_pressure, fill = gender)) +
  geom_bar(stat = "identity", width = 0.6) +
  labs(title = "Average Academic Pressure by Gender",
       x = "Gender",
       y = "Average Academic_Pressure") +
  scale_fill_manual(values = c("Male" = "blue", "Female" = "pink")) +
  theme_minimal()

The data indicates that in average, female students tend to experience a lot of academic pressure when compared to their male counterparts.

#Average Academic Pressure by Age Group

# Creating age groups
MentalHealthSurvey <- MentalHealthSurvey %>%
  mutate(age_group = case_when(
    age >= 17 & age <= 19 ~ "17-19",
    age >= 20 & age <= 22 ~ "20-22",
    age >= 23 & age <= 26 ~ "23-26"
  ))

# Calculating the average academic pressure by age group
avg_pressure_by_age_group <- MentalHealthSurvey %>%
  group_by(age_group) %>%
  summarise(mean_pressure = mean(academic_pressure, na.rm = TRUE))

# Creating a bar graph for average academic pressure by age group
ggplot(avg_pressure_by_age_group, aes(x = age_group, y = mean_pressure, fill = age_group)) +
  geom_bar(stat = "identity", width = 0.6) +
  labs(title = "Average Academic Pressure by Age Group",
       x = "Age Group",
       y = "Average Academic Pressure") +
  scale_fill_manual(values = c("17-19" = "blue", "20-22" = "green", "23-26" = "red")) +
  theme_minimal()

According to the bar chart, the academic pressure level of the older students between 23-26 is low as a result of their high average value. Younger generation students especially those in the category of 17-19 and 20-22 year old seem to be pressured most in academics, the 17-19 year old being more pressured than the other age group.

#Average Academic Pressure by Degree Major

# Extracting unique degree majors from the 'degree_major' column
unique_degree_majors <- unique(MentalHealthSurvey$degree_major)

print(unique_degree_majors)
## [1] "Data Science"           "Computer Science"       "Software Engineering"  
## [4] "Information Technology"
# Defining the degree majors to use  
selected_majors <- c("Data Science", "Computer Science", "Software Engineering", "Information Technology")

# Filtering the dataset to include the selected degree majors
filtered_data <- MentalHealthSurvey %>%
  filter(degree_major %in% selected_majors)

# Calculating the average academic Pressure for each degree major
avg_pressure_by_major <- filtered_data %>%
  group_by(degree_major) %>%
  summarise(mean_pressure = mean(academic_pressure, na.rm = TRUE))

# Creating a bar graph to visualize the average academic pressure by degree major
ggplot(avg_pressure_by_major, aes(x = degree_major, y = mean_pressure, fill = degree_major)) +
  geom_bar(stat = "identity", width = 0.6) +
  labs(title = "Average Academic Pressure by Degree Major",
       x = "Degree Major",
       y = "Average Academic Pressure") +
  scale_fill_manual(values = c("Data Science" = "blue", "Computer Science" = "green", 
                               "Software Engineering" = "red", "Information Technology" = "purple")) +
  theme_minimal()

The outcomes of the analysis show that individuals studying software engineering tend to experience a lot of pressure when it comes to academics while those studying information technology experience the lowest academic pressure compared to the other courses. Those studying data science experience slightly less pressure unlike those studying computer science.

#Regression Analysis of Factors Influencing Academic Pressure

# Fitting a linear regression model with academic_pressure as the dependent variable
model_academic_pressure <- lm(academic_pressure ~ study_satisfaction + academic_workload + financial_concerns +
                                social_relationships + depression + anxiety + isolation + future_insecurity,
                              data = MentalHealthSurvey)

summary(model_academic_pressure)
## 
## Call:
## lm(formula = academic_pressure ~ study_satisfaction + academic_workload + 
##     financial_concerns + social_relationships + depression + 
##     anxiety + isolation + future_insecurity, data = MentalHealthSurvey)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -2.0779 -0.4992 -0.1389  0.5081  3.1049 
## 
## Coefficients:
##                       Estimate Std. Error t value Pr(>|t|)   
## (Intercept)           0.913783   0.535547   1.706  0.09194 . 
## study_satisfaction    0.002249   0.113312   0.020  0.98421   
## academic_workload     0.478604   0.140770   3.400  0.00107 **
## financial_concerns   -0.046973   0.084357  -0.557  0.57924   
## social_relationships -0.230860   0.115269  -2.003  0.04867 * 
## depression            0.148222   0.173657   0.854  0.39598   
## anxiety              -0.107953   0.160262  -0.674  0.50255   
## isolation             0.200166   0.132621   1.509  0.13526   
## future_insecurity     0.128518   0.093116   1.380  0.17147   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.987 on 78 degrees of freedom
## Multiple R-squared:  0.3019, Adjusted R-squared:  0.2303 
## F-statistic: 4.217 on 8 and 78 DF,  p-value: 0.0003081

Accounting to the above results, academic workload significantly increases academic pressure (p = 0.00107), while social relationships significantly decrease it (p = 0.04867). Other factors like study satisfaction and financial concerns are not significant. The model explains about 30% of the variability in academic pressure (R-squared = 0.3019).

#Conclusion

The analysis reveals that academic workload significantly increases academic pressure, while positive social relationships help alleviate it. Gender and age also play crucial roles: female students experience more academic pressure than their male counterparts, and younger students (ages 17-22) face higher pressure compared to older students (ages 23-26). Among degree majors, Software Engineering students encounter the highest academic pressure, while Information Technology students experience the lowest. Data Science students report slightly less pressure than those in Computer Science.

The regression model explains about 30% of the variance in academic pressure, indicating that while the studied factors provide valuable insights, additional elements likely influence academic pressure. These findings can guide educators, administrators, and policymakers in developing targeted strategies to reduce academic stress, enhance student well-being, and improve overall educational outcomes.