Google Presentation

Author

Sierra Semko Krouse

Published

January 9, 2024

Libraries

library(psych)
library(tidyverse)

ggplot Theme

library(showtext)
font_add_google(name="Poppins", family="Poppins")
font_add_google(name="DM Serif Text", family="DM Serif Text")

theme_ssk <- function() {
    ggplot2::theme_bw() +
    ggplot2::theme(
    axis.text = element_text(colour = "#0c4846",  family = "Poppins", size = 12),
    axis.title = element_text(colour = "#0c4846", family = "DM Serif Text", size = 14),
    legend.title = element_text(colour = "#0c4846", family = "Poppins", size = 13),
    legend.text = element_text(colour = "#0c4846", family = "Poppins", size = 12),
    plot.title = element_text(colour = "#0c4846", family = "Poppins", size = 13, face = "bold"),
    plot.subtitle = element_text(colour = "#0c4846", family = "Poppins", size = 13, face = "italic"),
    strip.text = element_text(colour = "#0c4846", family = "Poppins", size = 13)) +
    ggplot2::theme(panel.background = element_rect(fill = "#fffbef", color = "#0e0d0d"),
                   plot.background = element_rect(fill = "#fffbef"))
}

stat_sum_df <- function(fun, geom="crossbar", ...) {
  stat_summary(fun.data=fun, colour="black", geom=geom, width=.5,  ...)
}

Data

teachers <- read.csv("../Teacher Intervention Pilot/combined-data_20240107.csv")

staff <- read.csv("../Intervention-Workplace/workplace-data_20240105.csv")

Classroom Intervention

summary(lm(burnout2Reverse ~ Condition, teachers))

Call:
lm(formula = burnout2Reverse ~ Condition, data = teachers)

Residuals:
    Min      1Q  Median      3Q     Max 
-1.6594 -0.6594 -0.1854  0.3406  3.8146 

Coefficients:
                   Estimate Std. Error t value Pr(>|t|)    
(Intercept)         2.65942    0.09371  28.379  < 2e-16 ***
ConditionTreatment -0.47399    0.12964  -3.656 0.000304 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Residual standard error: 1.101 on 287 degrees of freedom
  (108 observations deleted due to missingness)
Multiple R-squared:  0.0445,    Adjusted R-squared:  0.04117 
F-statistic: 13.37 on 1 and 287 DF,  p-value: 0.0003045
ggplot(data=teachers, aes(factor(Condition), burnout2Reverse, fill=factor(Condition))) + 
  geom_bar(stat="summary", fun.y="mean", position="dodge") +
  stat_sum_df("mean_cl_boot", geom = "errorbar", position= position_dodge(.9), conf.int=.68, width=0.2) +
  scale_y_continuous(breaks=c(1:6)) +
  coord_cartesian(ylim=c(1,6)) +
  labs(x = "Intervention Condition",
       y = "Anticipated Burnout") +
  scale_fill_manual(values = c("#facdcd", "#f48382")) +
  theme_ssk() +
  theme(legend.position="none")

Workplace Intervention

summary(lm(burnout ~ Condition, staff))

Call:
lm(formula = burnout ~ Condition, data = staff)

Residuals:
     Min       1Q   Median       3Q      Max 
-3.03226 -1.04545 -0.03226  0.96774  2.96774 

Coefficients:
                   Estimate Std. Error t value Pr(>|t|)    
(Intercept)          4.0323     0.2754  14.641   <2e-16 ***
ConditionTreatment  -0.9868     0.4275  -2.308   0.0251 *  
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Residual standard error: 1.533 on 51 degrees of freedom
  (59 observations deleted due to missingness)
Multiple R-squared:  0.0946,    Adjusted R-squared:  0.07685 
F-statistic: 5.329 on 1 and 51 DF,  p-value: 0.02506
ggplot(staff, aes(Condition, burnout, fill=Condition)) + 
  geom_bar(stat="summary", fun.y="mean", position="dodge") +
    stat_sum_df("mean_cl_boot", geom = "errorbar", position= position_dodge(.9), conf.int=.68, width=0.2) +
  scale_y_continuous(breaks=c(1:8)) +
  coord_cartesian(ylim=c(1,8)) +
  labs(x = "Intervention Condition",
       y = "") +
  scale_fill_manual(values = c("#ffeec1", "#FFC931")) +
  theme_ssk() +
  theme(legend.position="none")