Histograms
ggplot(data = data, aes(x = raisedhands)) + geom_histogram(color = "black") +
scale_x_continuous(breaks = seq(0,100,5)) +
labs(x = "Raised Hands", y = "Student Count")
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

ggplot(data = data, aes(x = VisITedResources)) + geom_histogram(color = "black") +
scale_x_continuous(breaks = seq(0,100,5)) +
labs(x = "Visited Resources", y = "Student Count")
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

ggplot(data = data, aes(x = AnnouncementsView)) + geom_histogram(color = "black") +
scale_x_continuous(breaks = seq(0,100,5)) +
labs(x = "Announcements View", y = "Student Count")
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

ggplot(data = data, aes(x = Discussion)) + geom_histogram(color = "black") +
scale_x_continuous(breaks = seq(0,100,5)) +
labs(x = "Discussion Participation", y = "Student Count")
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

Barplots
ggplot(data = data, aes(x = gender)) + geom_bar() +
labs(x = "Gender", y = "Student Count") +
scale_y_continuous(breaks = seq(0,300,30)) + coord_flip()

ggplot(data = data, aes(x = NationalITy)) + geom_bar() +
labs(x = "Nationality", y = "Student Count") +
scale_y_continuous(breaks = seq(0,200,20)) + coord_flip()

jordan and KW has highest no. of students
ggplot(data = data, aes(x = PlaceofBirth)) + geom_bar(aes(fill = NationalITy)) +
labs(x = "Birth Place", y = "Student Count") + coord_flip() # usa is a mix of nationalities

ggplot(data = data, aes(x = GradeID, fill = Class)) + geom_bar() +
labs(x = "Grade ID", y = "Student Count") + coord_flip() # g-06 has students with only low grades

ggplot(data = data, aes(x = GradeID, fill = gender)) + geom_bar() +
labs(x = "Grade ID", y = "Student Count") + coord_flip() # g-10 has no females

ggplot(data = data, aes(x = SectionID, fill = Topic)) + geom_bar() +
labs(x = "Section ID", y = "Student Count") +
coord_flip()

Class c has only IT and science students
ggplot(data = data, aes(x = Topic, fill = gender)) + geom_bar() +
labs(x = "Topic", y = "Student Count") +
scale_y_continuous(breaks = seq(0,100,4)) + coord_flip()

Spanish has worst male:female ratio whereas science, chemistry,
english and french have good ratio.
ggplot(data = data, aes(x = Topic, fill = NationalITy)) + geom_bar() +
labs(x = "Topic", y = "Student Count") + coord_flip() +
scale_y_continuous(breaks = seq(0,100,4))

IT has most people from KW. Chemistry has least diversity. French
has most diversity.
ggplot(data = data, aes(x = Topic, fill = StageID)) + geom_bar() +
labs(x = "Topic", y = "Student Count") + coord_flip() +
scale_y_continuous(breaks = seq(0,100,4))

geology, biology chemistry only middle school. fench has all low
level except one high level student.
ggplot(data = data, aes(x = Topic, fill = SectionID)) + geom_bar() +
labs(x = "Topic", y = "Student Count") + coord_flip() +
scale_y_continuous(breaks = seq(0,100,4))

section C only has spanish and IT students.
ggplot(data = data, aes(x = Topic, fill = Semester)) + geom_bar() +
labs(x = "Topic", y = "Student Count") + coord_flip() +
scale_y_continuous(breaks = seq(0,100,4))

IT mostly has students who are in first semester
ggplot(data = data, aes(x = Topic, fill = Relation)) + geom_bar() +
labs(x = "Topic", y = "Student Count") + coord_flip() +
scale_y_continuous(breaks = seq(0,100,4))

most french students have mom as gaurdian whereas most IT students
have fathers as gaurdian.
ggplot(data = data, aes(x = Topic, fill = Class)) + geom_bar() +
labs(x = "Topic", y = "Student Count") + coord_flip() +
scale_y_continuous(breaks = seq(0,100,4))

ggplot(data = data, aes(x = Topic, fill = Class)) + geom_bar(position = "fill") +
labs(x = "Topic", y = "Student Count") + coord_flip() +
scale_y_continuous(breaks = seq(0,100,4))

geology has no low class students
ggplot(data = data, aes(x = Semester)) + geom_bar() +
labs(x = "Semester", y = "Student Count")

ggplot(data = data, aes(x = Relation, fill = Semester)) + geom_bar() +
labs(x = "Gaurdian", y = "Student Count")

ggplot(data = data, aes(x = ParentAnsweringSurvey, fill = ParentschoolSatisfaction)) +
geom_bar() +
labs(x = "Does parent answer survey ?", y = "Student Count")

most of the parents who aren’t satisfied with the school do not
answer the survey.
ggplot(data = data, aes(x = ParentschoolSatisfaction)) +
geom_bar() +
labs(x = "Is the parent satified with the school ?", y = "Student Count")

ggplot(data = data, aes(x = StudentAbsenceDays)) + geom_bar() +
labs(x = "Is the student absent for more than seven days", y = "Student Count")

ggplot(data = data, aes(x = Class, fill = gender)) + geom_bar() +
labs(x = "Class", y = "Student Count")

very few girls in low class
ggplot(data = data, aes(x = Class, fill = Relation)) + geom_bar() +
labs(x = "Class", y = "Student Count")

the students who have moms as gaurdians have higher chances to get
high class marks.
ggplot(data = data, aes(x = Class, fill = ParentAnsweringSurvey)) + geom_bar() +
labs(x = "Class", y = "Student Count")

sudents whose parents answer the survey are the ones getting good
marks.
ggplot(data = data, aes(x = Class, fill = StudentAbsenceDays)) + geom_bar() +
labs(x = "Class", y = "Student Count")

student getting absent are the ones getting low marks.
Boxplots
ggplot(data = data, aes(x = gender, y = raisedhands)) + geom_boxplot()

girls have more hand raises
ggplot(data = data, aes(x = gender, y = VisITedResources)) + geom_boxplot()

girls visit more resources
ggplot(data = data, aes(x = NationalITy, y = raisedhands)) + geom_boxplot()

Jordan more hand raises than KW. lybia lowest. iraq and palestine
highest hand raises.
ggplot(data = data, aes(x = StageID, y = raisedhands)) + geom_boxplot()

more hand raises in middle schools.
ggplot(data = data, aes(x = StageID, y = Discussion)) + geom_boxplot()

more discussions in high schools.
ggplot(data = data, aes(x = GradeID, y = raisedhands)) + geom_boxplot()

grade 6 has most number of hand raises on an average.
ggplot(data = data, aes(x = SectionID, y = Discussion)) + geom_boxplot()

section C with lowest discussion
ggplot(data = data, aes(x = Topic, y = raisedhands)) + geom_boxplot()

IT has very few hand raises intersetingly although most students
study there.
ggplot(data = data, aes(x = Semester, y = raisedhands)) + geom_boxplot()

second sem –> more hand raises
ggplot(data = data, aes(x = Relation, y = raisedhands)) + geom_boxplot()

gaurdians moter -> more hand raises
ggplot(data = data, aes(x = ParentAnsweringSurvey, y = raisedhands)) + geom_boxplot()

survey answer-yes –> more hand raises
ggplot(data = data, aes(x = ParentAnsweringSurvey, y = VisITedResources)) + geom_boxplot()

ggplot(data = data, aes(x = ParentAnsweringSurvey, y = AnnouncementsView)) + geom_boxplot()

ggplot(data = data, aes(x = ParentAnsweringSurvey, y = Discussion)) + geom_boxplot()

ggplot(data = data, aes(x = ParentschoolSatisfaction, y = raisedhands)) + geom_boxplot()

satisfaction-good –> more hand raises
ggplot(data = data, aes(x = ParentschoolSatisfaction, y = VisITedResources)) + geom_boxplot()

ggplot(data = data, aes(x = ParentschoolSatisfaction, y = AnnouncementsView)) + geom_boxplot()

ggplot(data = data, aes(x = ParentschoolSatisfaction, y = Discussion)) + geom_boxplot()

ggplot(data = data, aes(x = StudentAbsenceDays, y = raisedhands)) + geom_boxplot()

more leaves less hand raises
ggplot(data = data, aes(x = StudentAbsenceDays, y = VisITedResources)) + geom_boxplot()

ggplot(data = data, aes(x = StudentAbsenceDays, y = AnnouncementsView)) + geom_boxplot()

ggplot(data = data, aes(x = StudentAbsenceDays, y = Discussion)) + geom_boxplot()

ggplot(data = data, aes(x = ParentAnsweringSurvey, y = raisedhands)) + geom_boxplot()

survy answer- yes –> more hand raises
ggplot(data = data, aes(x = ParentAnsweringSurvey, y = VisITedResources)) + geom_boxplot()

ggplot(data = data, aes(x = ParentAnsweringSurvey, y = AnnouncementsView)) + geom_boxplot()

ggplot(data = data, aes(x = ParentAnsweringSurvey, y = Discussion)) + geom_boxplot()

Scatterplots
ggplot(data = data, aes( x = raisedhands, y = VisITedResources)) + geom_point() +
geom_smooth(method = "lm")
## `geom_smooth()` using formula = 'y ~ x'

ggplot(data = data, aes( x = raisedhands, y = AnnouncementsView)) + geom_point() +
geom_smooth(method = "lm")
## `geom_smooth()` using formula = 'y ~ x'

ggplot(data = data, aes( x = raisedhands, y = Discussion)) + geom_point() +
geom_smooth(method = "lm")
## `geom_smooth()` using formula = 'y ~ x'

ggplot(data = data, aes( x = VisITedResources, y = AnnouncementsView)) + geom_point() +
geom_smooth(method = "lm")
## `geom_smooth()` using formula = 'y ~ x'

ggplot(data = data, aes( x = VisITedResources, y = Discussion)) + geom_point() +
geom_smooth(method = "lm")
## `geom_smooth()` using formula = 'y ~ x'

ggplot(data = data, aes( x = AnnouncementsView, y = Discussion)) + geom_point() +
geom_smooth(method = "lm")
## `geom_smooth()` using formula = 'y ~ x'

Density Plots
ggplot(data = data, aes(x = raisedhands, color = gender)) + geom_density()

ggplot(data = data, aes(x = raisedhands, color = Topic)) + geom_density()

ggplot(data = data, aes(x = raisedhands, color = SectionID)) + geom_density()

ggplot(data = data, aes(x = raisedhands, color = Semester)) + geom_density()

ggplot(data = data, aes(x = raisedhands, color = Class)) + geom_density()
