Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions correlation_plot.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import pandas as pd
import matplotlib.pyplot as plt

data = pd.read_csv("istherecorrelation.csv", sep=";", decimal=",")

print(data)
year = data.iloc[:,0]
students = data.iloc[:,1]
beer = data.iloc[:,2]

fig, axs = plt.subplots(1,3,figsize=(18,8))
axs[0].plot(year, beer, 'ro')
axs[0].set_xlabel("Year", fontsize=14)
axs[0].set_ylabel("Beer consumption [x1000 hectoliter]", fontsize=14)
axs[0].set_title("Beer consumption of students", fontsize=14)

axs[1].plot(year, beer/students, 'go')
axs[1].set_xlabel("Year", fontsize=14)
axs[1].set_ylabel("Beer consumption per student [hectoliter]", fontsize=14)
axs[1].set_title("Average beer consumption of a student", fontsize=14)

fig.suptitle("Dutch WO student beer consumption increasing or not?", fontsize=16)

axs[2].plot(students, beer, 'yo')
axs[2].set_xlabel("Number of students [x1000]", fontsize=14)
axs[2].set_ylabel("Beer consumption [x1000 hectoliters]", fontsize=14)
axs[2].set_title("Beer consumption vs students", fontsize=14)
plt.tight_layout()
plt.savefig("correlationquestion.png")
plt.show()
Binary file added correlationquestion.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions solution_.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# CS Assignment
Floor Clarisse - 11035757
## The following paper titles are pivotal to our knowledge
- Fantastic yeasts and where to find them: the hidden diversity of dimorphic fungal pathogens. [1]
- An analysis of the forces required to drag sheep over various surfaces. [2]
- The neurocognitive effects of alcohol on adolescents and college students. [3]

## Is there correlation?
After loading the istherecorrelation.csv file into pyhton using pandas, the following figure was created. The left plot shows total beer consumption of WO students over the years, which shows an increase. However the middle plot shows average beer consumption per WO student, which shows a decrease. This is because there is an increase in WO students as well. The left plot shows the beer consumption plotted against the number of students in the corresponding year, suggesting beer consumption is dependent variable of number of students. Statistical tests will have to indicate whether there really is a correlation between (average) beer consumption and number of WO students.
![correlationimage](correlationquestion.png "The left plot shows total beer consumption of WO students over the years, which shows an increase. However the middle plot shows average beer consumption per WO student, which shows a decrease. The right plot shows the beer consumption as a dependent variable of number of students")
## References


1. Van Dyke, M. C. C., Teixeira, M. M., & Barker, B. M. (2019). Fantastic yeasts and where to find them: the hidden diversity of dimorphic fungal pathogens. _Current opinion in microbiology_, 52, 55-63.
2. Harvey, J. T., Culvenor, J., Payne, W., Cowley, S., Lawrance, M., Stuart, D., & Williams, R. (2002). An analysis of the forces required to drag sheep over various surfaces. _Applied ergonomics_, 33(6), 523-531.
3. Zeigler, D. W., Wang, C. C., Yoast, R. A., Dickinson, B. D., McCaffree, M. A., Robinowitz, C. B., & Sterling, M. L. (2005). The neurocognitive effects of alcohol on adolescents and college students. _Preventive medicine_, 40(1), 23-32.