---
title: "Do higher positive emotions in discussion board responses lead to a higher grade?"
output:
flexdashboard::flex_dashboard:
theme:
version: 4
bootswatch: pulse
source_code: embed
---
```{r setup, include=FALSE}
library(flexdashboard)
library(tidyverse)
library(janitor)
course_data <- read_csv("data/course-data.csv") |>
clean_names()
liwc_data <- read_csv("data/liwc-data.csv") |>
clean_names()
course_text <- read_csv("data/course-text.csv") |>
clean_names()
course_data_join <- course_data |>
full_join(liwc_data, by = "student_id")
data_to_viz <- course_data_join |>
full_join(course_text, by = "student_id") |>
select(student_id, subject, final_grade.x, posemo.x) |>
mutate(subject = recode(subject,
"AnPhA" = "Anatomy",
"BioA" = "Biology",
"FrScA" = "Forensics",
"OcnA" = "Oceanography",
"PhysA" = "Physics"))
data_to_viz
```
## Inputs {.sidebar}
Yes.. to an extent, but not as significant.
Each point in the scatterplot indicates the responses of positive emotions in a discussion board and their final grade. For each subject, there is a positive relationship between positive emotions and their course grade. There is a cluster of responses between 2 - 8 in the higher range of final grades. The positive emotion responses seem to level off around 5.
The boxplot and histogram in the two smaller boxes show distributions of positive emotions and final grades for all course offerings in each subject. On average, students had a wider range of positive emotions in Biology, but positive emotions were pretty average and almost the same for each subject. Forensics had many outliers in positive emotions that resulted in lower grades. The average positive emotion response was about 5. Forensics may need more attention.
## Column {data-width="600"}
### Relationship Between Positive Emotions and Final Grade
```{r}
data_to_viz %>%
ggplot() +
geom_point(mapping = aes(x = posemo.x,
y = final_grade.x,
color = subject),
alpha = .5) +
geom_smooth(mapping = aes(x = posemo.x,
y = final_grade.x,
# color = subject,
weight = .5),
color = "gray",
method = loess,
se = FALSE) +
ylim(0, 100) +
xlim(0, 150) +
# facet_wrap(~subject, ncol = 3) +
labs(
title = "Do higher positive emotions in discussion board responses lead to a higher grade?",
y = "Final Grade",
x = "Positive Emotions",
) +
theme_minimal() +
theme(legend.position = "right",
panel.grid.minor = element_blank()) +
scale_color_brewer(palette = "Set1",
name = "Subject") +
scale_x_continuous(breaks = seq(0, 20, by = 2)) +
scale_y_continuous(breaks = seq(0, 100, by = 10))
```
## Column {data-width="400"}
### Quartiles, Median, and Outliers for Positive Emotions
```{r}
data_to_viz %>%
ggplot() +
geom_boxplot(mapping = aes(x = posemo.x,
#y = subject,
color = subject),
alpha = .25) +
facet_wrap(~subject, ncol = 1) +
labs(#title = "Will spending more time in an online course land me a better grade?",
y = "Course Subject",
x = "Positive Emotions"
) +
theme_void() +
theme(legend.position = "none",
axis.text.y=element_blank(),
axis.ticks.y=element_blank(),
axis.title.x = element_text(),
axis.text.x = element_text()) +
scale_color_brewer(palette = "Set1",
name = "Subject") +
scale_x_continuous(breaks = seq(0, 20, by = 2))
# scale_y_discrete(limits=rev)
```
### Distribution of Final Grades by Number of Students
```{r}
data_to_viz |>
ggplot() +
geom_histogram(mapping = aes(
x = final_grade.x,
#y = stat(count/sum(count)),
color = subject),
fill = NA
) +
facet_wrap(~subject, ncol = 1) +
labs(# title = "Will spending more time in an online course land me a better grade?",
y = "% of Students",
x = "Final Grade"
) +
theme_void() +
theme(legend.position = "none",
axis.text.y=element_blank(),
axis.ticks.y=element_blank(),
axis.title.x = element_text(),
axis.text.x = element_text()) +
scale_color_brewer(palette = "Set1",
name = "Subject") +
scale_x_continuous(breaks = seq(0, 100, by = 10))
```