diff --git a/beer_per_student_linear_fit.png b/beer_per_student_linear_fit.png new file mode 100644 index 0000000..14f08c4 Binary files /dev/null and b/beer_per_student_linear_fit.png differ diff --git a/plot.py b/plot.py new file mode 100644 index 0000000..72598ba --- /dev/null +++ b/plot.py @@ -0,0 +1,26 @@ +import pandas as pd +import matplotlib.pyplot as plt +import numpy as np + +df = pd.read_csv("istherecorrelation.csv", sep=";", decimal=",") + +beer_per_student = (df.iloc[:, 2] / df.iloc[:, 1]) + +x = df["Year"].to_numpy(dtype=float) +y = beer_per_student.to_numpy(dtype=float) + +m, b = np.polyfit(x, y, 1) +y_hat = m * x + b + +r2 = 1 - np.sum((y - y_hat)**2) / np.sum((y - y.mean())**2) + +plt.figure(figsize=(8,5), dpi=150) +plt.plot(x, y, marker="o", label="Beer (hl) per 1000 WO students") +plt.plot(x, y_hat, linestyle="--", label=f"Linear fit (R²={r2:.3f})") +plt.xlabel("Year") +plt.ylabel("Hectoliters per 1000 students") +plt.title("Beer per 1000 WO Students (linear fit)") +plt.grid(True) +plt.legend() +plt.savefig("beer_per_student_linear_fit.png", dpi=300) +plt.show() diff --git a/solution_TimonJasarevic.md b/solution_TimonJasarevic.md new file mode 100644 index 0000000..057e0fc --- /dev/null +++ b/solution_TimonJasarevic.md @@ -0,0 +1,10 @@ +4. StudentID: 13432001 + +5. +-Fantastic yeasts and where to find them: the hidden diversity of dimorphic fungal pathogens. +-An analysis of the forces required to drag sheep over various surfaces. +-The neurocognitive effects of alcohol on adolescents and college students. + +![Beer per 1,000 WO Students](beer_per_student_linear_fit.png) + +The WO students are drinking less beer over the years. There is a linear correlation with 0.93 R squared. \ No newline at end of file