Loading, setting up

library(tidyverse)
# library(plyr)
library(lubridate)
library(janitor)
library(lme4)
library(sjPlot)
library(brms)

esm <- read_csv("spring_2022.csv") %>% clean_names()

pre_survey <- read_csv("data/surveys/spring 2022 intro bio week 1 survey_July 19, 2022_14.45.csv") %>% 
  clean_names()

pre_survey_brewton <- read_csv("data/surveys/spring 2022 intro bio pre-survey_BREWTON.csv") %>% 
  clean_names()

pre_survey
## # A tibble: 922 × 56
##    start_date     end_d…¹ status ip_ad…² progr…³ durat…⁴ finis…⁵ recor…⁶ respo…⁷
##    <chr>          <chr>   <chr>  <chr>   <chr>   <chr>   <chr>   <chr>   <chr>  
##  1 "Start Date"   "End D… "Resp… "IP Ad… "Progr… "Durat… "Finis… "Recor… "Respo…
##  2 "{\"ImportId\… "{\"Im… "{\"I… "{\"Im… "{\"Im… "{\"Im… "{\"Im… "{\"Im… "{\"Im…
##  3 "2022-01-26 1… "2022-… "1"     <NA>   "100"   "27"    "1"     "2022-… "R_2xz…
##  4 "2022-01-27 1… "2022-… "1"     <NA>   "100"   "33"    "1"     "2022-… "R_Qd1…
##  5 "2022-01-27 1… "2022-… "1"     <NA>   "100"   "61"    "1"     "2022-… "R_2zr…
##  6 "2022-01-27 1… "2022-… "1"     <NA>   "100"   "23"    "1"     "2022-… "R_3J4…
##  7 "2022-01-27 1… "2022-… "0"    "192.2… "100"   "53"    "1"     "2022-… "R_2Tz…
##  8 "2022-01-27 1… "2022-… "0"    "216.9… "100"   "196"   "1"     "2022-… "R_28U…
##  9 "2022-01-27 1… "2022-… "0"    "75.12… "100"   "250"   "1"     "2022-… "R_2dK…
## 10 "2022-01-27 1… "2022-… "0"    "192.2… "100"   "143"   "1"     "2022-… "R_2uP…
## # … with 912 more rows, 47 more variables: recipient_last_name <chr>,
## #   recipient_first_name <chr>, recipient_email <chr>,
## #   external_reference <chr>, location_latitude <chr>,
## #   location_longitude <chr>, distribution_channel <chr>, user_language <chr>,
## #   q_recaptcha_score <chr>, q2 <chr>, q3 <chr>, q4 <chr>, q5_1 <chr>,
## #   q5_2 <chr>, q5_3 <chr>, q5_4 <chr>, q5_5 <chr>, q5_6 <chr>, q5_7 <chr>,
## #   q6 <chr>, q7_1 <chr>, q8 <chr>, q9 <chr>, q10_1 <chr>, q10_2 <chr>, …
## # ℹ Use `print(n = ...)` to see more rows, and `colnames()` to see all variable names
pre_survey_brewton # missing the q10 questions and one other
## # A tibble: 193 × 47
##    start_date     end_d…¹ status ip_ad…² progr…³ durat…⁴ finis…⁵ recor…⁶ respo…⁷
##    <chr>          <chr>   <chr>  <chr>   <chr>   <chr>   <chr>   <chr>   <chr>  
##  1 "Start Date"   "End D… "Resp… "IP Ad… "Progr… "Durat… "Finis… "Recor… "Respo…
##  2 "{\"ImportId\… "{\"Im… "{\"I… "{\"Im… "{\"Im… "{\"Im… "{\"Im… "{\"Im… "{\"Im…
##  3 "2022-01-20 1… "2022-… "0"    "68.57… "100"   "105"   "1"     "2022-… "R_3rZ…
##  4 "2022-01-20 1… "2022-… "1"     <NA>   "100"   "38"    "1"     "2022-… "R_1Ns…
##  5 "2022-01-20 1… "2022-… "0"    "68.57… "100"   "24"    "1"     "2022-… "R_A1G…
##  6 "2022-01-23 1… "2022-… "0"    "174.1… "100"   "162"   "1"     "2022-… "R_d0w…
##  7 "2022-01-23 1… "2022-… "0"    "192.2… "100"   "264"   "1"     "2022-… "R_1la…
##  8 "2022-01-23 1… "2022-… "0"    "174.2… "100"   "221"   "1"     "2022-… "R_3Jl…
##  9 "2022-01-23 1… "2022-… "0"    "153.3… "100"   "247"   "1"     "2022-… "R_1mV…
## 10 "2022-01-23 1… "2022-… "0"    "216.9… "100"   "262"   "1"     "2022-… "R_3Rg…
## # … with 183 more rows, 38 more variables: recipient_last_name <chr>,
## #   recipient_first_name <chr>, recipient_email <chr>,
## #   external_reference <chr>, location_latitude <chr>,
## #   location_longitude <chr>, distribution_channel <chr>, user_language <chr>,
## #   q_recaptcha_score <chr>, q2 <chr>, q3 <chr>, q4 <chr>, q5_1 <chr>,
## #   q5_2 <chr>, q5_3 <chr>, q5_4 <chr>, q5_5 <chr>, q5_6 <chr>, q5_7 <chr>,
## #   q6 <chr>, q7_1 <chr>, q8 <chr>, q74 <chr>, q11_1 <chr>, q12 <chr>, …
## # ℹ Use `print(n = ...)` to see more rows, and `colnames()` to see all variable names
post_survey <- read_csv("data/surveys/spring 2022 intro bio week 14 survey_July 19, 2022_14.49.csv") %>% 
  clean_names()

joining data

pre_survey_all <- pre_survey %>% 
  bind_rows(pre_survey_brewton)

pre_survey_all <- pre_survey_all %>% 
  rename(netid = net_id)

esm_joined <- esm %>% 
  left_join(pre_survey_all, by = "netid")

esm_joined <- esm_joined %>% 
  mutate(q7_1 = as.numeric(q7_1))

RQ2: How do features of instructors and courses relate to students’ anxiety?

Specific course (dummy code for course)?

  • prof.: q16
  • specific combo of lecture and lab: bio_lecture, bio_lab, code (both combined)
  • Perception of instructor supportiveness: q7 (q10?)
m4 <- lmer(content ~ 1 + 
             week*mean_survey_anxiety + 
             q16 + # prof dummy code
             (1|number), data = esm_joined)
tab_model(m4) 
  content
Predictors Estimates CI p
(Intercept) 1.48 0.91 – 2.04 <0.001
week 0.02 0.00 – 0.03 0.040
mean survey anxiety 0.41 0.32 – 0.49 <0.001
q16 [11] 0.27 -0.29 – 0.84 0.343
q16 [12] 0.44 -0.35 – 1.24 0.276
q16 [13] 0.58 -0.03 – 1.20 0.064
q16 [2] 0.09 -0.29 – 0.47 0.646
q16 [6] 0.88 0.27 – 1.49 0.005
week * mean survey
anxiety
-0.01 -0.01 – -0.00 <0.001
Random Effects
σ2 1.00
τ00 number 1.96
ICC 0.66
N number 278
Observations 6482
Marginal R2 / Conditional R2 0.146 / 0.712

similar story with prof added

m4 <- lmer(content ~ 1 + 
             week*mean_survey_anxiety + 
             q16 + # prof dummy code 
             q7_1 + # instructor supportiveness
             (1|number), data = esm_joined)
tab_model(m4) 
  content
Predictors Estimates CI p
(Intercept) 2.11 1.27 – 2.95 <0.001
week 0.02 0.00 – 0.03 0.040
mean survey anxiety 0.39 0.30 – 0.48 <0.001
q16 [11] 0.55 -0.08 – 1.18 0.085
q16 [12] 0.77 -0.08 – 1.63 0.076
q16 [13] 0.85 0.18 – 1.51 0.013
q16 [2] 0.41 -0.08 – 0.90 0.101
q16 [6] 1.11 0.46 – 1.76 0.001
q7 1 -0.10 -0.19 – -0.00 0.046
week * mean survey
anxiety
-0.01 -0.01 – -0.00 <0.001
Random Effects
σ2 1.00
τ00 number 1.94
ICC 0.66
N number 278
Observations 6482
Marginal R2 / Conditional R2 0.153 / 0.711

single item measure of instructor supportiveness is negatively related to ESM anxiety; higher support, lower anxiety

m5 <- lmer(content ~ 1 + 
             week*mean_survey_anxiety + 
             q16 + # prof dummy code 
             mean_survey_anxiety*q7_1 + # instructor supportiveness X initial anxiety
             (1|number), data = esm_joined)
tab_model(m5) 
  content
Predictors Estimates CI p
(Intercept) 3.79 1.56 – 6.03 0.001
week 0.02 0.00 – 0.03 0.040
mean survey anxiety 0.09 -0.29 – 0.47 0.648
q16 [11] 0.20 -0.56 – 0.96 0.612
q16 [12] 0.43 -0.52 – 1.38 0.372
q16 [13] 0.50 -0.29 – 1.29 0.213
q16 [2] 0.08 -0.56 – 0.72 0.804
q16 [6] 0.75 -0.03 – 1.54 0.059
q7 1 -0.25 -0.46 – -0.04 0.020
week * mean survey
anxiety
-0.01 -0.01 – -0.00 <0.001
mean survey anxiety * q7
1
0.03 -0.01 – 0.08 0.110
Random Effects
σ2 1.00
τ00 number 1.93
ICC 0.66
N number 278
Observations 6482
Marginal R2 / Conditional R2 0.162 / 0.714

when we interact initial anxiety and perceptions of support measured at the pre-survey, no interaction; probably need the post-survey measure

RQ3: How do their students’ momentary anxiety experiences relate to end of course outcomes (anxiety and course achievement, intent to stay in major or science/persistence)?

  • Longitudinal ESM predicting changes in anxiety: q5 (pre and post anxiety) Mean levels or longitudinal predicting achievement — variation

holding off on these for now