Stilesians were asked:
On a scale of 1-10: On average, how connected have you felt to other people in the Stiles community during each time period? (1 = very disconnected, 10 = very connected.) Just answer to your best estimation/memory. First-years, it’s ok if your answers are very low for the periods before Fall semester :).
Also note that the remainder of the year, from November 21 through December, is just assumed to be constant.
# Load data
t <- "20201227_235052"
data.connectedness <- read.csv(paste("data/connectedness_", t, ".csv", sep="")) %>%
mutate(Housing.F20=factor(Housing.F20, c("Stiles", "Old Campus", "Off-Campus", "Remote"))) %>%
mutate(Enrolled.F20=case_when(
Enrolled.F20 ~ "Enrolled",
!Enrolled.F20 ~ "Not Enrolled"
)) %>%
mutate(Year=as.factor(Year))
# "Jitter" values just a little bit, so it's easier to see overlapping points
c_jitter <- data.connectedness %>%
mutate(Day=jitter(Day, factor=1)) %>% # x
mutate(Connectedness=jitter(Connectedness, factor=.5)) # y
g_all <- (
ggplot(c_jitter %>% filter(!is.na(Housing.F20) & !is.na(Enrolled.F20) & !is.na(Year)),
aes(x=Day, y=Connectedness, color=Year, group=ID)) +
geom_line(alpha=0.5) +
geom_point(alpha=0.6) +
scale_y_continuous(breaks=1:10) +
scale_x_continuous(breaks=unique(data.connectedness$Day)) +
scale_color_colorblind() +
facet_grid(Housing.F20 ~ Enrolled.F20) +
theme_minimal()
) %>% ggplotly()
g_all
Note that you can selectively view graduation years, or groups of graduation years, by clicking on the legend above.
Focus on the Fall semester of 2020: what’s going on in Day 327?
Timeline review:
Epoch (t= value) |
Time frame | Date range (2020) | Day of Year (Starting) |
---|---|---|---|
t1 |
Before Spring Break | < 3/7 | 13 |
t2 |
Spring Break | 3/7 - 3/22 | 67 |
t3 |
Remainder of the Spring semester | 3/23 - 5/6 | 83 |
t4 |
Summer | 5/7 - Late August | 128 |
t5 |
Fall semester, before Break | 8/31 - 11/21 | 244 |
t6 |
Remainder of the Fall semester | 11/22 - 2020 | 327 |
On summary statistics (means and standard errors).
data.summ.yr <- data.connectedness %>%
filter(!is.na(Housing.F20) & !is.na(Enrolled.F20) & !is.na(Year)) %>%
group_by(Year, Day) %>%
summarize(mean_se(Connectedness), N..Responses=n()) %>%
mutate(Connectedness=y)
dodge <- position_dodge(12)
g <- ggplot(data.summ.yr, aes(x=Day, y=Connectedness, color=Year, text=N..Responses)) +
geom_line(position=dodge) +
geom_errorbar(aes(ymin=ymin, ymax=ymax), position=dodge, width=10) +
scale_y_continuous(breaks=1:10) +
scale_x_continuous(breaks=unique(data.connectedness$Day)) +
scale_color_colorblind() +
theme_minimal()
ggplotly(g)
Note that setting tooltips with geom_line is funky.1
data.summ.yr <- data.connectedness %>%
filter(!is.na(Housing.F20) & !is.na(Enrolled.F20) & !is.na(Year)) %>%
group_by(Housing.F20, Day) %>%
summarize(mean_se(Connectedness), N..Responses=n()) %>%
mutate(Connectedness=y)
dodge <- position_dodge(12)
g <- ggplot(data.summ.yr, aes(x=Day, y=Connectedness, color=Housing.F20, text=N..Responses)) +
geom_line(position=dodge) +
geom_errorbar(aes(ymin=ymin, ymax=ymax), position=dodge, width=10) +
scale_y_continuous(breaks=1:10) +
scale_x_continuous(breaks=unique(data.connectedness$Day)) +
scale_color_colorblind() +
theme_minimal()
ggplotly(g)
data.summ.yr <- data.connectedness %>%
filter(!is.na(Housing.F20) & !is.na(Enrolled.F20) & !is.na(Year)) %>%
group_by(Enrolled.F20, Day) %>%
summarize(mean_se(Connectedness), N..Responses=n()) %>%
mutate(Connectedness=y)
dodge <- position_dodge(12)
g <- ggplot(data.summ.yr, aes(x=Day, y=Connectedness, color=Enrolled.F20, text=N..Responses)) +
geom_line(position=dodge) +
geom_errorbar(aes(ymin=ymin, ymax=ymax), position=dodge, width=10) +
scale_y_continuous(breaks=1:10) +
scale_x_continuous(breaks=unique(data.connectedness$Day)) +
scale_color_colorblind() +
theme_minimal()
ggplotly(g)
The following plots offer a more granular look at Stiles-connectivity through time from the perspective of each of the following factors: graduation year, proximity to campus in the Fall, and enrollment status in the Fall.
g_year <- (
ggplot(c_jitter %>% filter(!is.na(Year)),
aes(x=Day, y=Connectedness, color=Year, group=ID)) +
geom_line(alpha=0.25) +
geom_point(alpha=0.35) +
scale_y_continuous(breaks=1:10) +
scale_x_continuous(breaks=unique(data.connectedness$Day)) +
scale_color_colorblind() +
theme_minimal()
) %>% ggplotly()
g_proximity <- (
ggplot(c_jitter %>% filter(!is.na(Housing.F20)),
aes(x=Day, y=Connectedness, color=Housing.F20, group=ID)) +
geom_line(alpha=0.15) +
geom_point(alpha=0.35) +
scale_y_continuous(breaks=1:10) +
scale_x_continuous(breaks=unique(data.connectedness$Day)) +
scale_color_brewer(palette="Spectral") +
theme_minimal()
) %>% ggplotly()
g_enrollment <- (
ggplot(c_jitter %>% filter(!is.na(Enrolled.F20)),
aes(x=Day, y=Connectedness, color=Enrolled.F20, shape=Enrolled.F20, group=ID)) +
geom_line(alpha=0.25) +
geom_point(alpha=0.35) +
scale_y_continuous(breaks=1:10) +
scale_x_continuous(breaks=unique(data.connectedness$Day)) +
scale_color_colorblind() +
theme_minimal()
) %>% ggplotly()
# https://stackoverflow.com/questions/36227482/r-ggplot-dodging-geom-lines
# https://ggplot2.tidyverse.org/reference/scale_brewer.html
# subplot(g_year, g_proximity, g_enrollment, shareX=T, nrows=3)
g_year
g_proximity
g_enrollment