RQ #2: How is the relationship between STEM practices and perceptions of challenge, relevance, learning, and affect moderated by youth characteristics at program entry?

This is what we know:

  • Males are associated with challenge and relevance
  • Interest is less predictive but predicts positive affect
  • Females report higher challenge when STEM-SB is supported
  • Creating products is more relevant when students have higher pre-intereset
  • When agency is supported and students have higher pre-interest, they repory higher positive affect

This is what we still need to figure out:

  • How robust are interactions?
  • Is using p < .05 to determine what interactions to focus on the best idea?

How this document is organized

  • The outcomes are numbered 1 - 4 (challenge, relevance, learning, and positive affect)
  • Within the section for each outcome, three models are specified (just main effects [basic skills, creating products, support for agency, and support for STEM-SB], main effects X gender interactions, and main effects X pre-interest interactions)
library(tidyverse)
library(lme4)
library(corrr)
library(jmRtools)
library(sjPlot)
esm <- read_csv("/Volumes/SCHMIDTLAB/PSE/data/STEM-IE/STEM-IE-esm.csv")
pre_survey_data_processed <- read_csv("/Volumes/SCHMIDTLAB/PSE/data/STEM-IE/STEM-IE-pre-survey.csv")
post_survey_data_partially_processed <- read_csv("/Volumes/SCHMIDTLAB/PSE/data/STEM-IE/STEM-IE-post-survey.csv")
video <- read_csv("/Volumes/SCHMIDTLAB/PSE/data/STEM-IE/STEM-IE-video.csv")
pqa <- read_csv("/Volumes/SCHMIDTLAB/PSE/data/STEM-IE/STEM-IE-pqa.csv")
attendance <- read_csv("/Volumes/SCHMIDTLAB/PSE/data/STEM-IE/STEM-IE-attendance.csv")
class_data <- read_csv("/Volumes/SCHMIDTLAB/PSE/data/STEM-IE/STEM-IE-class-video.csv")
demographics <- read_csv("/Volumes/SCHMIDTLAB/PSE/data/STEM-IE/STEM-IE-demographics.csv")
pm <- read_csv("/Volumes/SCHMIDTLAB/PSE/Data/STEM-IE/STEM-IE-program-match.csv")
load("~/Desktop/all-data.Rdata")
attendance <- rename(attendance, participant_ID = ParticipantID)
attendance <- mutate(attendance, prop_attend = DaysAttended / DaysScheduled, 
                     participant_ID = as.integer(participant_ID))
attendance <- select(attendance, participant_ID, prop_attend)

demographics <- filter(demographics, participant_ID!= 7187)
demographics <- left_join(demographics, attendance)

esm$overall_engagement <- jmRtools::composite_mean_maker(esm, hard_working, concentrating, enjoy, interest)
df <- left_join(esm, pre_survey_data_processed, by = "participant_ID") # df & post-survey
df <- left_join(df, video, by = c("program_ID", "response_date", "sociedad_class", "signal_number")) # df & video
df <- left_join(df, demographics, by = c("participant_ID", "program_ID")) # df and demographics
pqa <- mutate(pqa, 
              active = active_part_1 + active_part_2,
              ho_thinking = ho_thinking_1 + ho_thinking_2 + ho_thinking_3,
              belonging = belonging_1 + belonging_2,
              agency = agency_1 + agency_2 + agency_3 + agency_4,
              youth_development_overall = active_part_1 + active_part_2 + ho_thinking_1 + ho_thinking_2 + ho_thinking_3 + belonging_1 + belonging_2 + agency_1 + agency_2 + agency_3 + agency_4,
              making_observations = stem_sb_8,
              data_modeling = stem_sb_2 + stem_sb_3 + stem_sb_9,
              interpreting_communicating = stem_sb_6,
              generating_data = stem_sb_4,
              asking_questions = stem_sb_1)

# pqa <- rename(pqa, sixth_math_sociedad = sixth_math)
# pqa <- rename(pqa, seventh_math_sociedad = seventh_math)
# pqa <- rename(pqa, eighth_math_sociedad = eighth_math)
# pqa <- rename(pqa, dance_sociedad = dance)
# pqa <- rename(pqa, robotics_sociedad = robotics)

pqa$sociedad_class <- ifelse(pqa$eighth_math == 1, "8th Math",
                             ifelse(pqa$seventh_math == 1, "7th Math",
                                    ifelse(pqa$sixth_math == 1, "6th Math",
                                           ifelse(pqa$robotics == 1, "Robotics",
                                                  ifelse(pqa$dance == 1, "Dance", NA)))))

pqa <- rename(pqa, 
              program_ID = SiteIDNumeric,
              response_date = resp_date,
              signal_number = signal)

pqa$program_ID <- as.character(pqa$program_ID)

df <- left_join(df, pqa, by = c("response_date", "program_ID", "signal_number", "sociedad_class"))
df <- df %>% 
    mutate(youth_activity_three = case_when(
        youth_activity_rc == "Creating Product" ~ "Creating Product",
        youth_activity_rc == "Basic Skills Activity" ~ "Basic Skills Activity",
        TRUE ~ "Other"
    ))

df$youth_activity_three <- fct_relevel(df$youth_activity_three, 
                                       "Other")
df <- df %>% 
    mutate(ho_thinking_dummy = ifelse(sum_ho_thinking > 0, 1, 0),
           agency_dummy = ifelse(sum_agency > 0, 1, 0),
           active_dummy = ifelse(sum_ap > 0, 1, 0),
           belonging_dummy = ifelse(sum_belonging > 0, 1, 0),
           stem_sb_dummy = ifelse(sum_stem_sb > 0, 1, 0))

Correlations

df %>% 
    select(sum_agency, sum_stem_sb, overall_pre_interest) %>% 
    correlate() %>% 
    shave() %>% 
    fashion() %>% 
    knitr::kable()
rowname sum_agency sum_stem_sb overall_pre_interest
sum_agency
sum_stem_sb .39
overall_pre_interest .08 .02
df$gender <- as.factor(df$gender)

1. Challenge

1A: Just main effects of select activities / STEM-SB and pre interest and gender

m <- lmer(challenge ~ 
              youth_activity_three +
              agency_dummy +
              stem_sb_dummy + 
              
              overall_pre_interest + 
              gender + 
              (1|program_ID) + (1|participant_ID) + (1|beep_ID_new),
          data = df)

sjPlot::sjt.lmer(m, p.kr = T, show.re.var = F, show.ci = F, show.se = T)
    challenge
    B std. Error p
Fixed Parts
(Intercept)   1.98 0.24 <.001
youth_activity_three (Basic Skills Activity)   0.13 0.06 .034
youth_activity_three (Creating Product)   0.33 0.07 <.001
agency_dummy   0.08 0.06 .206
stem_sb_dummy   0.02 0.07 .795
overall_pre_interest   0.01 0.07 .936
gender (M)   0.25 0.11 .027
Random Parts
Nbeep_ID_new   236
Nparticipant_ID   180
Nprogram_ID   9
ICCbeep_ID_new   0.049
ICCparticipant_ID   0.379
ICCprogram_ID   0.042
Observations   2549
R2 / Ω02   .530 / .523

1B: Adding interactions with gender

m <- lmer(challenge ~ 
              youth_activity_three*gender +
              agency_dummy*gender +
              stem_sb_dummy*gender + 
              overall_pre_interest + 
              (1|program_ID) + (1|participant_ID) + (1|beep_ID_new),
          data = df)

sjPlot::sjt.lmer(m, p.kr = T, show.re.var = F, show.ci = F, show.se = T)
    challenge
    B std. Error p
Fixed Parts
(Intercept)   1.86 0.25 <.001
youth_activity_threeBasic Skills Activity   0.15 0.07 .045
youth_activity_threeCreating Product   0.33 0.08 <.001
genderM   0.52 0.15 <.001
agency_dummy   0.11 0.08 .150
stem_sb_dummy   0.13 0.08 .107
overall_pre_interest   0.01 0.07 .927
youth_activity_threeBasic Skills Activity:genderM   -0.03 0.09 .707
youth_activity_threeCreating Product:genderM   0.01 0.10 .880
genderM:agency_dummy   -0.08 0.09 .408
genderM:stem_sb_dummy   -0.25 0.10 .012
Random Parts
Nbeep_ID_new   236
Nparticipant_ID   180
Nprogram_ID   9
ICCbeep_ID_new   0.048
ICCparticipant_ID   0.380
ICCprogram_ID   0.042
Observations   2549
R2 / Ω02   .531 / .524
sjp.int(m)

1C: Adding interactions with pre-interest

m <- lmer(challenge ~ 
              youth_activity_three*overall_pre_interest + 
              agency_dummy*overall_pre_interest +
              stem_sb_dummy*overall_pre_interest + 
              gender +
              (1|program_ID) + (1|participant_ID) + (1|beep_ID_new),
          data = df)

sjPlot::sjt.lmer(m, p.kr = T, show.re.var = F, show.ci = F, show.se = T)
    challenge
    B std. Error p
Fixed Parts
(Intercept)   1.66 0.29 <.001
youth_activity_threeBasic Skills Activity   0.18 0.17 .278
youth_activity_threeCreating Product   0.50 0.20 .015
overall_pre_interest   0.12 0.09 .195
agency_dummy   0.21 0.18 .232
stem_sb_dummy   0.23 0.19 .214
genderM   0.25 0.11 .026
youth_activity_threeBasic Skills Activity:overall_pre_interest   -0.01 0.05 .782
youth_activity_threeCreating Product:overall_pre_interest   -0.05 0.06 .404
overall_pre_interest:agency_dummy   -0.05 0.05 .400
overall_pre_interest:stem_sb_dummy   -0.08 0.06 .201
Random Parts
Nbeep_ID_new   236
Nparticipant_ID   180
Nprogram_ID   9
ICCbeep_ID_new   0.051
ICCparticipant_ID   0.379
ICCprogram_ID   0.042
Observations   2549
R2 / Ω02   .532 / .525
sjp.int(m)

2. Affect

2A: Just main effects of select activities / STEM-SB and pre interest and gender

m <- lmer(relevance ~ 
              youth_activity_three +
              agency_dummy +
              stem_sb_dummy + 
              
              overall_pre_interest + 
              gender + 
              (1|program_ID) + (1|participant_ID) + (1|beep_ID_new),
          data = df)

sjPlot::sjt.lmer(m, p.kr = T, show.re.var = F, show.ci = F, show.se = T)
    relevance
    B std. Error p
Fixed Parts
(Intercept)   2.10 0.21 <.001
youth_activity_three (Basic Skills Activity)   0.04 0.04 .269
youth_activity_three (Creating Product)   0.12 0.04 .004
agency_dummy   -0.05 0.04 .187
stem_sb_dummy   0.11 0.04 .011
overall_pre_interest   0.10 0.06 .125
gender (M)   0.24 0.11 .030
Random Parts
Nbeep_ID_new   236
Nparticipant_ID   180
Nprogram_ID   9
ICCbeep_ID_new   0.012
ICCparticipant_ID   0.519
ICCprogram_ID   0.011
Observations   2549
R2 / Ω02   .594 / .592

2B: Adding interactions with gender

m <- lmer(relevance ~ 
              youth_activity_three*gender +
              agency_dummy*gender +
              stem_sb_dummy*gender + 
              overall_pre_interest + 
              (1|program_ID) + (1|participant_ID) + (1|beep_ID_new),
          data = df)

sjPlot::sjt.lmer(m, p.kr = T, show.re.var = F, show.ci = F, show.se = T)
    relevance
    B std. Error p
Fixed Parts
(Intercept)   2.03 0.21 <.001
youth_activity_threeBasic Skills Activity   0.08 0.05 .124
youth_activity_threeCreating Product   0.18 0.06 .002
genderM   0.37 0.13 .006
agency_dummy   -0.05 0.05 .323
stem_sb_dummy   0.16 0.05 .004
overall_pre_interest   0.10 0.06 .125
youth_activity_threeBasic Skills Activity:genderM   -0.07 0.07 .277
youth_activity_threeCreating Product:genderM   -0.11 0.08 .154
genderM:agency_dummy   -0.01 0.07 .891
genderM:stem_sb_dummy   -0.11 0.07 .144
Random Parts
Nbeep_ID_new   236
Nparticipant_ID   180
Nprogram_ID   9
ICCbeep_ID_new   0.012
ICCparticipant_ID   0.520
ICCprogram_ID   0.011
Observations   2549
R2 / Ω02   .595 / .592
sjp.int(m)

2C: Adding interactions with pre-interest

m <- lmer(relevance ~ 
              youth_activity_three*overall_pre_interest + 
              agency_dummy*overall_pre_interest +
              stem_sb_dummy*overall_pre_interest + 
              gender +
              (1|program_ID) + (1|participant_ID) + (1|beep_ID_new),
          data = df)

sjPlot::sjt.lmer(m, p.kr = T, show.re.var = F, show.ci = F, show.se = T)
    relevance
    B std. Error p
Fixed Parts
(Intercept)   2.11 0.24 <.001
youth_activity_threeBasic Skills Activity   0.04 0.12 .727
youth_activity_threeCreating Product   -0.24 0.15 .122
overall_pre_interest   0.09 0.08 .217
agency_dummy   -0.03 0.13 .790
stem_sb_dummy   0.15 0.14 .287
genderM   0.24 0.11 .028
youth_activity_threeBasic Skills Activity:overall_pre_interest   0.00 0.04 .969
youth_activity_threeCreating Product:overall_pre_interest   0.11 0.05 .016
overall_pre_interest:agency_dummy   -0.01 0.04 .865
overall_pre_interest:stem_sb_dummy   -0.01 0.04 .779
Random Parts
Nbeep_ID_new   236
Nparticipant_ID   180
Nprogram_ID   9
ICCbeep_ID_new   0.013
ICCparticipant_ID   0.518
ICCprogram_ID   0.012
Observations   2549
R2 / Ω02   .595 / .593
sjp.int(m)

3. Affect

3A: Just main effects of select activities / STEM-SB and pre interest and gender

m <- lmer(learning ~ 
              youth_activity_three +
              agency_dummy +
              stem_sb_dummy + 
              
              overall_pre_interest + 
              gender + 
              (1|program_ID) + (1|participant_ID) + (1|beep_ID_new),
          data = df)

sjPlot::sjt.lmer(m, p.kr = T, show.re.var = F, show.ci = F, show.se = T)
    learning
    B std. Error p
Fixed Parts
(Intercept)   2.35 0.19 <.001
youth_activity_three (Basic Skills Activity)   0.15 0.05 .003
youth_activity_three (Creating Product)   0.04 0.05 .435
agency_dummy   0.03 0.05 .578
stem_sb_dummy   0.10 0.05 .054
overall_pre_interest   0.08 0.06 .171
gender (M)   0.07 0.10 .522
Random Parts
Nbeep_ID_new   236
Nparticipant_ID   180
Nprogram_ID   9
ICCbeep_ID_new   0.008
ICCparticipant_ID   0.354
ICCprogram_ID   0.000
Observations   2548
R2 / Ω02   .417 / .411

3B: Adding interactions with gender

m <- lmer(learning ~ 
              youth_activity_three*gender +
              agency_dummy*gender +
              stem_sb_dummy*gender + 
              overall_pre_interest + 
              (1|program_ID) + (1|participant_ID) + (1|beep_ID_new),
          data = df)

sjPlot::sjt.lmer(m, p.kr = T, show.re.var = F, show.ci = F, show.se = T)
    learning
    B std. Error p
Fixed Parts
(Intercept)   2.27 0.20 <.001
youth_activity_threeBasic Skills Activity   0.21 0.06 .001
youth_activity_threeCreating Product   0.06 0.07 .402
genderM   0.23 0.14 .118
agency_dummy   0.08 0.07 .254
stem_sb_dummy   0.12 0.07 .080
overall_pre_interest   0.08 0.06 .160
youth_activity_threeBasic Skills Activity:genderM   -0.14 0.09 .118
youth_activity_threeCreating Product:genderM   -0.04 0.10 .684
genderM:agency_dummy   -0.10 0.09 .268
genderM:stem_sb_dummy   -0.05 0.10 .618
Random Parts
Nbeep_ID_new   236
Nparticipant_ID   180
Nprogram_ID   9
ICCbeep_ID_new   0.008
ICCparticipant_ID   0.355
ICCprogram_ID   0.000
Observations   2548
R2 / Ω02   .418 / .412
sjp.int(m)

3C: Adding interactions with pre-interest

m <- lmer(learning ~ 
              youth_activity_three*overall_pre_interest + 
              agency_dummy*overall_pre_interest +
              stem_sb_dummy*overall_pre_interest + 
              gender +
              (1|program_ID) + (1|participant_ID) + (1|beep_ID_new),
          data = df)

sjPlot::sjt.lmer(m, p.kr = T, show.re.var = F, show.ci = F, show.se = T)
    learning
    B std. Error p
Fixed Parts
(Intercept)   2.29 0.25 <.001
youth_activity_threeBasic Skills Activity   0.26 0.15 .100
youth_activity_threeCreating Product   -0.00 0.20 .991
overall_pre_interest   0.10 0.08 .207
agency_dummy   -0.08 0.16 .632
stem_sb_dummy   0.26 0.18 .146
genderM   0.07 0.10 .516
youth_activity_threeBasic Skills Activity:overall_pre_interest   -0.04 0.05 .475
youth_activity_threeCreating Product:overall_pre_interest   0.01 0.06 .839
overall_pre_interest:agency_dummy   0.04 0.05 .501
overall_pre_interest:stem_sb_dummy   -0.05 0.06 .375
Random Parts
Nbeep_ID_new   236
Nparticipant_ID   180
Nprogram_ID   9
ICCbeep_ID_new   0.009
ICCparticipant_ID   0.354
ICCprogram_ID   0.000
Observations   2548
R2 / Ω02   .418 / .412
sjp.int(m)

4. Affect

4A: Just main effects of select activities / STEM-SB and pre interest and gender

m <- lmer(positive_affect ~ 
              youth_activity_three +
              agency_dummy +
              stem_sb_dummy + 
              
              overall_pre_interest + 
              gender + 
              (1|program_ID) + (1|participant_ID) + (1|beep_ID_new),
          data = df)

sjPlot::sjt.lmer(m, p.kr = T, show.re.var = F, show.ci = F, show.se = T)
    positive_affect
    B std. Error p
Fixed Parts
(Intercept)   1.94 0.25 <.001
youth_activity_three (Basic Skills Activity)   0.02 0.05 .748
youth_activity_three (Creating Product)   -0.05 0.05 .360
agency_dummy   0.17 0.05 .002
stem_sb_dummy   -0.04 0.05 .422
overall_pre_interest   0.20 0.07 .007
gender (M)   0.16 0.11 .160
Random Parts
Nbeep_ID_new   236
Nparticipant_ID   180
Nprogram_ID   9
ICCbeep_ID_new   0.027
ICCparticipant_ID   0.432
ICCprogram_ID   0.074
Observations   2549
R2 / Ω02   .587 / .583

4B: Adding interactions with gender

m <- lmer(positive_affect ~ 
              youth_activity_three*gender +
              agency_dummy*gender +
              stem_sb_dummy*gender + 
              overall_pre_interest + 
              (1|program_ID) + (1|participant_ID) + (1|beep_ID_new),
          data = df)

sjPlot::sjt.lmer(m, p.kr = T, show.re.var = F, show.ci = F, show.se = T)
    positive_affect
    B std. Error p
Fixed Parts
(Intercept)   1.92 0.26 <.001
youth_activity_threeBasic Skills Activity   0.02 0.06 .771
youth_activity_threeCreating Product   -0.10 0.07 .133
genderM   0.20 0.14 .173
agency_dummy   0.20 0.06 .003
stem_sb_dummy   -0.04 0.07 .509
overall_pre_interest   0.20 0.07 .006
youth_activity_threeBasic Skills Activity:genderM   0.00 0.08 .991
youth_activity_threeCreating Product:genderM   0.11 0.09 .199
genderM:agency_dummy   -0.07 0.08 .391
genderM:stem_sb_dummy   -0.00 0.09 .980
Random Parts
Nbeep_ID_new   236
Nparticipant_ID   180
Nprogram_ID   9
ICCbeep_ID_new   0.027
ICCparticipant_ID   0.431
ICCprogram_ID   0.074
Observations   2549
R2 / Ω02   .587 / .583
sjp.int(m)

4C: Adding interactions with pre-interest

m <- lmer(positive_affect ~ 
              youth_activity_three*overall_pre_interest + 
              agency_dummy*overall_pre_interest +
              stem_sb_dummy*overall_pre_interest + 
              gender +
              (1|program_ID) + (1|participant_ID) + (1|beep_ID_new),
          data = df)

sjPlot::sjt.lmer(m, p.kr = T, show.re.var = F, show.ci = F, show.se = T)
    positive_affect
    B std. Error p
Fixed Parts
(Intercept)   1.96 0.29 <.001
youth_activity_threeBasic Skills Activity   0.04 0.15 .802
youth_activity_threeCreating Product   -0.23 0.18 .207
overall_pre_interest   0.19 0.09 .032
agency_dummy   -0.12 0.15 .417
stem_sb_dummy   0.24 0.16 .149
genderM   0.16 0.11 .162
youth_activity_threeBasic Skills Activity:overall_pre_interest   -0.01 0.05 .887
youth_activity_threeCreating Product:overall_pre_interest   0.05 0.05 .323
overall_pre_interest:agency_dummy   0.10 0.05 .047
overall_pre_interest:stem_sb_dummy   -0.09 0.05 .086
Random Parts
Nbeep_ID_new   236
Nparticipant_ID   180
Nprogram_ID   9
ICCbeep_ID_new   0.026
ICCparticipant_ID   0.432
ICCprogram_ID   0.074
Observations   2549
R2 / Ω02   .587 / .583
sjp.int(m)