“Student Alcohol Consumption”

“Project 2”

“Julian HEATH 480382056; Mulan ZHONG 470415520; Helena KE 470427198; Mikayla KIM 450404999”

“University of Sydney | MATH1005 | September 2018”

Executive Summary

The aim of this report is to detect if there is any correlation between high school students environmental and personal factors and the likeability of these students to consume alcohol. Our method of analysis was done by implementing a cross examination using qualitative variables such as sex, age, internet, parent occupation/ education of Portuguese high school students and the students likeability to consume alcohol. Subsequently, this report aims to see the impact of student alcohol consumption on their overall examination performance, if these students were to drink during the weekday, rather than the weekend. The results gathered by this report would be most useful for parents, teachers, and students because it provides insight into any underlying or non-direct causes of underage drinking. As an outcome of this research, more efficient teaching and parenting can be developed, improving the quality of education for students overall.

The main discoveries are that there is a larger difference in numbers between female and male students consuming alcohol, with around 150 more female students drinking than their male counterparts. Furthermore, both genders showed to have a larger demographic of drinkers at ages 16 and 17, which means that there is a large quantity of students illegally drinking underage. (Portugals drinking age is 18). We also discovered that the socioeconomic background of most of the students were decent enough for 80% of students to have paid internet access at home but weren’t able to pay for additional educational classes at school.

Analysis showed that there was no direct correlation between parent’s education or occupation on the student’s level of alcohol consumption. We must consider that we purely used an average of the level of consumption in accordance to parent occupation and education so any outliers should be helpful in indicating whether certain jobs had a larger influence on a student’s likeability to consume alcohol.

Finally, our results also showed that there was a negative correlation between exam performance and alcohol consumption, meaning that the more likely the student consumed alcohol, meant that they were more likely to achieve a score that was lower compared to students that abstained from alcohol consumption. Furthermore, our results aimed to discover if alcohol consumption affected the amount of time students dedicate to study, which would overall have an influence on exam performance. Our data suggests that an increase in alcohol consumption within the category of students that do not usually drink actually had a larger influence on their study time in comparison to those who usually consumed a comparatively larger amount of alcohol.

Full Report

Initial Data Analysis (IDA)

  • The Student Alcohol Consumption dataset comes from …
# Read data from folder into R
student = read.csv("data/student-mat.csv",header=T)

Quick look at top 5 rows of data

##   school sex age address famsize Pstatus Medu Fedu     Mjob     Fjob
## 1     GP   F  18       U     GT3       A    4    4  at_home  teacher
## 2     GP   F  17       U     GT3       T    1    1  at_home    other
## 3     GP   F  15       U     LE3       T    1    1  at_home    other
## 4     GP   F  15       U     GT3       T    4    2   health services
## 5     GP   F  16       U     GT3       T    3    3    other    other
## 6     GP   M  16       U     LE3       T    4    3 services    other
##       reason guardian traveltime studytime failures schoolsup famsup paid
## 1     course   mother          2         2        0       yes     no   no
## 2     course   father          1         2        0        no    yes   no
## 3      other   mother          1         2        3       yes     no  yes
## 4       home   mother          1         3        0        no    yes  yes
## 5       home   father          1         2        0        no    yes  yes
## 6 reputation   mother          1         2        0        no    yes  yes
##   activities nursery higher internet romantic famrel freetime goout Dalc
## 1         no     yes    yes       no       no      4        3     4    1
## 2         no      no    yes      yes       no      5        3     3    1
## 3         no     yes    yes      yes       no      4        3     2    2
## 4        yes     yes    yes      yes      yes      3        2     2    1
## 5         no     yes    yes       no       no      4        3     2    1
## 6        yes     yes    yes      yes       no      5        4     2    1
##   Walc health absences G1 G2 G3
## 1    1      3        6  5  6  6
## 2    1      3        4  5  5  6
## 3    3      3       10  7  8 10
## 4    1      5        2 15 14 15
## 5    2      5        4  6 10 10
## 6    2      5       10 15 15 15
##  [1] "school"     "sex"        "age"        "address"    "famsize"   
##  [6] "Pstatus"    "Medu"       "Fedu"       "Mjob"       "Fjob"      
## [11] "reason"     "guardian"   "traveltime" "studytime"  "failures"  
## [16] "schoolsup"  "famsup"     "paid"       "activities" "nursery"   
## [21] "higher"     "internet"   "romantic"   "famrel"     "freetime"  
## [26] "goout"      "Dalc"       "Walc"       "health"     "absences"  
## [31] "G1"         "G2"         "G3"
## [1] "data.frame"

Size of data

## [1] 395  33
sapply(student, class)
##     school        sex        age    address    famsize    Pstatus 
##   "factor"   "factor"  "integer"   "factor"   "factor"   "factor" 
##       Medu       Fedu       Mjob       Fjob     reason   guardian 
##  "integer"  "integer"   "factor"   "factor"   "factor"   "factor" 
## traveltime  studytime   failures  schoolsup     famsup       paid 
##  "integer"  "integer"  "integer"   "factor"   "factor"   "factor" 
## activities    nursery     higher   internet   romantic     famrel 
##   "factor"   "factor"   "factor"   "factor"   "factor"  "integer" 
##   freetime      goout       Dalc       Walc     health   absences 
##  "integer"  "integer"  "integer"  "integer"  "integer"  "integer" 
##         G1         G2         G3 
##  "integer"  "integer"  "integer"


  • The data came from (source of data)… Data came from two different assessable sources:
  1. Research paper on data mining to predict secondary school student performance


The initial data was collected by university of Minho professor Paulo Cortez and secondary school educator, Alice Maria Goncalves Silva. Their data was collected during the 2005- 2006 school year from two public schools from the Alentejo region of Portugal. The database was built from school reports, based on paper sheets, and questionnaires. The data was collected from 788 students and this was used to predict secondary school exam performance. The source of data offers a higher level of validity as variables that were used were assessed by school professional and were subsequently assessed on a smaller sample size of 15 students for feedback. The data results are practical to a degree, because it was only collected from two different schools in the same vicinity of Portugal. We must consider factors such as the area’s socioeconomic level as well as the quality of education. If the data had been collected from a larger variety of schools in different areas, we would be considering to cater to a larger variety of potential confounding variables. Furthermore, having only assessed the students in two subject areas- maths and Portuguese limits the accuracy of the results.

  1. Fabio Panott’s research on Prediction of Secondary School Students’ Alcohol Addiction Using Random Forest


This research paper was produced by professors of the College of Engineering, located in India and can be found in the International Journal of Computer Applications. It refers to the research data done by Paulo Cortez and Alice Silva, as mentioned above. The research data mentions how the entries that didn’t reveal enough information by the students were discarded so as to improve the reliability of the data and was final processing of the information was done so that any inaccurate information or inconsistent information was also discarded. The data collected were anonymous, meaning that there is less likely for the researchers to have incorporated bias.

  • Stakeholders? people interested in the results of this data would primarily be those who work in the education system as well as parents and students. This information would be useful in predicting whether certain life factors have a direct influence on causing underage individuals to drink, and see if there are any correlations between underage drinking and exam performance. It could also aid in seeing seeing failure rates amongst students. Furthermore, this data would be capable of assisting in government research into the commonness of underage drinking in the country of Portugal. Finally, the results could also aid in improvement of education quality and the quality of social/ environmental factors for high school students so that they may achieve high grades.

  • Domain knowledge? Studies have already shown for e.g.https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3843305/ that there is a positive association between alcohol consumption and decreased academic performance for students between 18 and 29. This research furthers into explaining the importance of alcohol prevention activities so that students may abstain from heavy or consistent drinking. Further research has indicated that high levels of alcohol consumption is evident by the underage demographic, with students as young as year 9 having consumed alcohol on a regular basis. https://www.jrf.org.uk/report/young-people-alcohol-and-influences Our research into the variables and their possible correlation with alcohol consumption may provide answers to questions that ask, what might be the underlying causes of alcohol consumption amongst high school students, and what might be the impact of drinking to their academic achievements?

Research Question 1 - Do the biological factors and socioeconomic status of a student influence alcohol consumption?

VARIABLES: Student alcohol consumption dependent, qualitative, ordinal Sex independent, nominal, qualitative Age independent, quantitative Internet independent, nominal Paid independent, nominal

Consider 1 qualitative variable sex

sex = student$sex # Isolate the variable sex.  
## [1] "factor"
## sex
##   F   M 
## 208 187

Consider 1 quantitative variable

age = student$age # Isolate the variable age 
## [1] "integer"
ageN = as.numeric(age) # convert age into a numeric vector and label as ageN
## [1] "numeric"
hist(ageN, main = "Alcohol Consumption", xlab = "age") # create a histogram for alcohol consumption frequencies by age
mean(ageN) # calculate the mean age that consumes alcohol
## [1] 16.6962
median(ageN) # calculate the median age that consumes alcohol
## [1] 17
abline(v = mean(ageN), col = "light blue") # label mean on histogram
abline(v = median(ageN), col = "purple") # label median on histogram

boxplot(ageN, main = "Alcohol Consumption") # create a boxplot
abline(h = mean(ageN), col = "light blue") # label mean on boxplot 
abline(h = median(ageN), col = "purple") # label median on boxplot 

Consider 1 quantitative variable divided by 1 qualitative variable

Control for sex

ageNF = ageN[student$sex == "F"]
ageNM = ageN[student$sex == "M"]
par(mfrow = c(2,1))
boxplot(ageNF,horizontal=T, col="light blue") #create a boxplot for female students 
boxplot(ageNM,horizontal=T) #create a boxplot for male students

Consider 1 qualitative variable

internet = student$internet  # Isolate the variable internet
## [1] "factor"
## internet
##  no yes 
##  66 329
## internet
##        no       yes 
## 0.1670886 0.8329114

Consider 1 qualitative variable

paid = student$paid # Isolate the variable paid
## paid
##  no yes 
## 214 181

## paid
##        no       yes 
## 0.5417722 0.4582278


The results from the study show that more younger students (ages 16-17) consume alcohol. Gender was discovered to not play a role in influencing alcohol consumption. Lastly assumptions can be made from the study that students that consume would majorly have a middle socioeconomic status.

Sex - there was a sample size of 395 students, and out of these there were: 208 females 187 males

Due to there being a small difference of only 21, there is therefore no apparent correlation between alcohol consumption and gender based on the dataset. However this study could have been improved by analysing the entire cohort (non-drinkers and drinkers), to see whether there is a larger amount of females than males in the year group, to accurately determine whether there is no link.

Age - By analysing the histogram, it is made apparent that 16 to 17 year olds most commonly consume alcohol. The mean and median was then calculated which showed that:

Mean age = 16.7 Median age = 17

Further study through a box plot revealed that 50% of students that drink are between the ages of 16 to 18. Considering the dataset ranged from 15 year olds to 22, it is apparent that more younger students are consuming alcohol.

Correlations between sex and age were then analysed. After observing the boxplots side by side for female and male students, with the exception of an outlier in the male group, their interquartile range is the same (16 to 18). However what was unexpected was that the boxplot of males show that the median sits on the lower quartile, indicative of a skewed male dataset.

Next broadly delving into socioeconomic status by seeing which student homes pay for internet and extended education (paid) it can be seen that with internet:

0.83 (83%) have accessibility to the internet at home, whilst 0.17 (17%) do not.

Whilst for extended paid learning:

0.54 (54%) opt not to pay for extra education whilst 46% do.

By reviewing these results an assumption can be made that the students that consume alcohol have a middle socioeconomic status. Results on socioeconomic status are expected due to the consideration of whether the students could afford alcoholic beverages however the method and analysis would most certainly be improved if more specific addresses (e.g. suburb), or whether the students were employed, were included in the dataset.

Research Question 3: Does an increased level of alcohol consumption cause a decrease in exam performance?

By comparing (1) the level of alcohol consumption with exam performance (2) the level of alcohol consumption with hours of study and (3) hours of study with exam performance, it can be determined whether: Firstly, there is a negative correlation between exam performance and alcohol consumption, and secondly whether study is a confounding variable. If the relationship between alcohol consumption and study time matches the relationship between study time and exam performance it could be said that students who drink more study less, and this leads to poor results. However, if the relationships do not completely align it may be that case that the effect of alcohol consumption directly affects a student’s exam performance.

Is there a negative correlation between level of alcohol consumption and exam performance?

Boxplot of the distribution of exam marks at different alcohol consumption levels for each of the three exams:

boxplot(student$G1 ~ student$Walc, ylab = "First Exam Mark", xlab = "Alcohol Consumption")

boxplot(student$G2 ~ student$Walc, ylab = "Second Exam Mark", xlab = "Alcohol Consumption")

boxplot(student$G3 ~ student$Walc, ylab = "Final Exam Mark", xlab = "Alcohol Consumption")


In the first exam, students who marked their consumption at 1 or 2 achieved a median result above 50%, while those who marked themselves at a 3-5 had a median just below 50%. It should also be noted that an increased level of drinking correlated with a decrease in the mark of the 75th percentile. However, the mark at the 25th percentile stays stable. The interquartile range also shrinks at a consumption level of 4-5 with the box plot becoming skewed to the right. It seems there is some negative correlation between alcohol consumption and exam performance in the first exam, but the trend is not very strong.

In the second exam there is a more linear correlation between the level of alcohol consumption and the median mark in the exam. This trend points to a much more clear, negative, correlation between drinking exam performance. Similarly, the mark at the 75% percentile also trends down from an alcohol consumption level of 1-4. Even though this trend is not followed at the 5th level of consumption, this boxplot is skewed with the spread of the lower quartile group (from the 25th to 50th percentile) much more clustered than the upper quartile.

In the Final exam the trend is quite similar to that of the first exam, with a noticeable decrease in median mark between students who drink at a level of 1-2 and then those who drink more. It appears the impact on performance becomes more prominent over this threshold. The mark at the 75th percentile also decreases with an increased consumption from levels 1-4 further supporting this correlation.

While increased alcohol consumption negatively correlates exam performance it could be that the confounding variable of study time is more of a factor. Potentially students who drink less study more and thus the impact on exam performance is more directly caused by study.

Is there a negative correlation between the level of alcohol consumption and hours studied?

Boxplot of the hours studied at different alcohol consumption levels:

boxplot(student$studytime ~ student$Walc, xlab = "alcohol consumption", ylab = "hours of study")


There appears to be a strong negative correlation between alcohol consumption and study time. While the median study time remains stable at 2 hours, and the interquartile range also consistently spans two hours, the skew of the plot changes dramatically between a consumption level of 1 and 2. At an alcohol consumption level of 1, the median and 25th percentile are the same value of 2 hours of study. This means 25% of students study for two hours, while 50% study more. While there is a clear skew to the right in the middle 50%, there is a normal distribution at both ends.

However, an increase in alcohol consumption level from 1-2 leads to a very significant change in the distribution of study time. While the median and interquartile range remains the same, the box shifts to upper quartile decreases to the median while the lower quartile decreases to 1 hour of study. This is a strong skew to the right with 75% of students studying less than 2 hours. Students with an alcohol consumption level of 1 studied a maximum of 4 hours while students with a higher alcohol consumption studied a maximum of 3 hours.

An increase in alcohol consumption from 2-5 causes no change in the distribution of study. Thus, an increase in alcohol consumption from 1 to 2 correlates with a significant decrease in study, but any further increase in consumption has no correlation.

Is there a correlation between study time and exam performance?

Boxplot of the distribution of exam marks with different amounts of study:

boxplot(student$G1 ~ student$studytime, xlab = "hours of study", ylab = "final exam results")

boxplot(student$G2 ~ student$studytime, xlab = "hours of study", ylab = "final exam results")

boxplot(student$G3 ~ student$studytime, xlab = "hours of study", ylab = "final exam results")


Across all three exams there is almost no difference in the distribution of marks for students who studied 1-2 hours. However, for students who study more than 2 hours, the median score, lower quartile and upper quartile mark are all higher across the board. There doesn’t seem to be a clear trend between 3 and 4 hours of study.


  1. A comparison between an alcohol level of 1 or higher

Students who consume the lowest level of alcohol study more than those who consume any more. If hours of study were a confounding variable and the main cause of exam results this would imply a clear difference in the results of alcohol consumers in this lowest bracket from the others. This is not the case however, as the marks from an increased consumption to level 2 have little correlation with exam performance. However, students who study for 3-4 hours appear to perform better and these students all consume in the lowest bracket. It could be that another confounding variable like personality or intelligence is a factor. High IQ students tend to avoid alcohol (thus are in the lowest bracket) and more likely to study. It is not the case that students who drink the least study the most and thus outperform the others, who all study the same amount.

  1. A comparison between an alcohol level from 2-5

75% of students who consume alcohol at a level of 2 or higher study 2 hours or less. When comparing hours of study with exam performance there is no difference in the distribution of marks from 1 to 2 hours of study. It may be the case that this level of study has too negligible an impact on a student’s knowledge to improve exam performance. However, if study was a confounding variable and there was no causation between alcohol consumption and exam results, it would be expected that all students who consumed 2-5 levels of alcohol would achieve a similar distribution of results. This is not the case. In fact, there is a clear negative correlation between in increased consumption at those levels and exam performance. For students who consume alcohol at a level of 2 or higher, the level of consumption has a greater correlation with performance than study time. This implies that there may be a causal link between consumption at these higher levels and performance in exams.

In conclusion, small levels of alcohol consumption have some degree of correlation with improved exam marks but are not a clear causal factor. On the other hand, a high level of alcohol consumption causes a decrease in exam marks. It could be that low levels of alcohol consumption promote a lifestyle suited to high school performance, while high levels directly harm a student’s ability to perform.


Style: APA Ansari, W. Stock C. Mills, C. (October 2013) Is Alcohol Consumption Associated with Poor Academic Achievement in University Students? International Journal of Preventive Medicine 4(10): 1175-1188

Bremner, P., Burnett, J. Nunney, F., Ravat, M., Mistral, W. (June 2011). Young People, Alcohol, and Influences. Retrieved from https://www.jrf.org.uk/report/young-people-alcohol-and-influences

Coretz, P. Silva, A. (April 2008) Using Data Mining to Predict Secondary School Student Performance. Retrieved from https://repositorium.sdum.uminho.pt/bitstream/1822/8024/1/student.pdf

Hariharan, B. Krithivasan, R. Deborah, A (September 2016) Prediction of Secondary School Students’ Alcohol Addiction using Random Forest. International Journal of Computer Applications. Volume 149(6): 0975-8887

UCI Machine Learning. (2016). Student Alcohol Consumption. Retrieved from https://www.kaggle.com/uciml/student-alcohol-consumption

Personal reflection on group work

We each collaborated at the beginning to collectively find a dataset and to delegate roles to one another and continued to support each other throughout the timeframe via group chat. From this project I learnt that group work was about working together to collate opinions and minds towards solving the same problem effectively. Personally I also gained communication, statistical, problem-solving and teamwork skills. This project was overall valuable as it was a practical way for me to learn and work with peers.