This is analysis associated with the first RQ for the STEM-IE project.

Joining Community Space data set

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

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



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

community_space$response_date <- format(as.Date(community_space$response_date, format = "%m/%d/%Y"), "%Y-%m-%d")
## Warning in strptime(x, format, tz = "GMT"): unknown timezone 'zone/tz/
## 2018c.1.0/zoneinfo/America/Detroit'
community_space <- mutate(community_space, response_date = as.character(response_date))
df <- mutate(df, response_date = as.character(response_date))

df <- left_join(df, community_space, by = c("response_date", "program_ID", "signal_number", "sociedad_class"))

Joining Value data set

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

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

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

value$response_date <- format(as.Date(value$response_date, format = "%m/%d/%Y"), "%Y-%m-%d")

value <- mutate(value, response_date = as.character(response_date))

df <- left_join(df, value, by = c("response_date", "program_ID", "signal_number", "sociedad_class"))

Creating variables for value

df$all_value_sum <- df$V01.01.HighUtility_sum + df$V01.03.HighIntrinsic_sum + df$V01.05.HighAttainment_sum
df$control <- jmRtools::composite_mean_maker(df, in_control, concentrating, learning, good_at)
df$value <- jmRtools::composite_mean_maker(df, important, future_goals)

Null Models

M0 <- lmer(control ~
             (1|program_ID) + 
             (1|participant_ID) + 
             (1|beep_ID_new),
           data = df)
summary(M0)
## Linear mixed model fit by REML ['lmerMod']
## Formula: 
## control ~ (1 | program_ID) + (1 | participant_ID) + (1 | beep_ID_new)
##    Data: df
## 
## REML criterion at convergence: 5846.1
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -4.4201 -0.4504  0.0882  0.5452  3.3410 
## 
## Random effects:
##  Groups         Name        Variance Std.Dev.
##  beep_ID_new    (Intercept) 0.01836  0.1355  
##  participant_ID (Intercept) 0.28203  0.5311  
##  program_ID     (Intercept) 0.00000  0.0000  
##  Residual                   0.34018  0.5832  
## Number of obs: 2970, groups:  
## beep_ID_new, 248; participant_ID, 203; program_ID, 9
## 
## Fixed effects:
##             Estimate Std. Error t value
## (Intercept)  2.84533    0.04027   70.66
sjstats::icc(M0)
## 
## Linear mixed model
##  Family: gaussian (identity)
## Formula: control ~ (1 | program_ID) + (1 | participant_ID) + (1 | beep_ID_new)
## 
##      ICC (beep_ID_new): 0.028660
##   ICC (participant_ID): 0.440285
##       ICC (program_ID): 0.000000
M01 <- lmer(value ~
             (1|program_ID) + 
             (1|participant_ID) + 
             (1|beep_ID_new),
           data = df)
summary(M01)
## Linear mixed model fit by REML ['lmerMod']
## Formula: 
## value ~ (1 | program_ID) + (1 | participant_ID) + (1 | beep_ID_new)
##    Data: df
## 
## REML criterion at convergence: 6925
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -3.7755 -0.5366  0.0545  0.6020  3.5370 
## 
## Random effects:
##  Groups         Name        Variance Std.Dev.
##  beep_ID_new    (Intercept) 0.018641 0.13653 
##  participant_ID (Intercept) 0.476102 0.69000 
##  program_ID     (Intercept) 0.005928 0.07699 
##  Residual                   0.488635 0.69902 
## Number of obs: 2970, groups:  
## beep_ID_new, 248; participant_ID, 203; program_ID, 9
## 
## Fixed effects:
##             Estimate Std. Error t value
## (Intercept)  2.56689    0.05782    44.4
sjstats::icc(M01)
## 
## Linear mixed model
##  Family: gaussian (identity)
## Formula: value ~ (1 | program_ID) + (1 | participant_ID) + (1 | beep_ID_new)
## 
##      ICC (beep_ID_new): 0.018843
##   ICC (participant_ID): 0.481249
##       ICC (program_ID): 0.005992
M02 <- lmer(happy ~
             (1|program_ID) + 
             (1|participant_ID) + 
             (1|beep_ID_new),
           data = df)
summary(M02)
## Linear mixed model fit by REML ['lmerMod']
## Formula: 
## happy ~ (1 | program_ID) + (1 | participant_ID) + (1 | beep_ID_new)
##    Data: df
## 
## REML criterion at convergence: 7605.5
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -3.4665 -0.4019  0.0595  0.5188  3.2445 
## 
## Random effects:
##  Groups         Name        Variance Std.Dev.
##  beep_ID_new    (Intercept) 0.0189   0.1375  
##  participant_ID (Intercept) 0.5047   0.7105  
##  program_ID     (Intercept) 0.1043   0.3230  
##  Residual                   0.6229   0.7893  
## Number of obs: 2969, groups:  
## beep_ID_new, 248; participant_ID, 203; program_ID, 9
## 
## Fixed effects:
##             Estimate Std. Error t value
## (Intercept)    2.799      0.121   23.14
sjstats::icc(M02)
## 
## Linear mixed model
##  Family: gaussian (identity)
## Formula: happy ~ (1 | program_ID) + (1 | participant_ID) + (1 | beep_ID_new)
## 
##      ICC (beep_ID_new): 0.015110
##   ICC (participant_ID): 0.403504
##       ICC (program_ID): 0.083398
M03 <- lmer(excited ~
             (1|program_ID) + 
             (1|participant_ID) + 
             (1|beep_ID_new),
           data = df)
summary(M03)
## Linear mixed model fit by REML ['lmerMod']
## Formula: 
## excited ~ (1 | program_ID) + (1 | participant_ID) + (1 | beep_ID_new)
##    Data: df
## 
## REML criterion at convergence: 8101.7
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -3.2302 -0.5459  0.0673  0.5932  3.1045 
## 
## Random effects:
##  Groups         Name        Variance Std.Dev.
##  beep_ID_new    (Intercept) 0.02962  0.1721  
##  participant_ID (Intercept) 0.54034  0.7351  
##  program_ID     (Intercept) 0.11483  0.3389  
##  Residual                   0.73599  0.8579  
## Number of obs: 2969, groups:  
## beep_ID_new, 248; participant_ID, 203; program_ID, 9
## 
## Fixed effects:
##             Estimate Std. Error t value
## (Intercept)   2.6018     0.1268   20.51
sjstats::icc(M03)
## 
## Linear mixed model
##  Family: gaussian (identity)
## Formula: excited ~ (1 | program_ID) + (1 | participant_ID) + (1 | beep_ID_new)
## 
##      ICC (beep_ID_new): 0.020847
##   ICC (participant_ID): 0.380310
##       ICC (program_ID): 0.080823
M04 <- lmer(frustrated ~
             (1|program_ID) + 
             (1|participant_ID) + 
             (1|beep_ID_new),
           data = df)
summary(M04)
## Linear mixed model fit by REML ['lmerMod']
## Formula: 
## frustrated ~ (1 | program_ID) + (1 | participant_ID) + (1 | beep_ID_new)
##    Data: df
## 
## REML criterion at convergence: 7789.7
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -2.9657 -0.5174 -0.1433  0.3808  3.3343 
## 
## Random effects:
##  Groups         Name        Variance Std.Dev.
##  beep_ID_new    (Intercept) 0.008871 0.09418 
##  participant_ID (Intercept) 0.503086 0.70929 
##  program_ID     (Intercept) 0.041607 0.20398 
##  Residual                   0.675877 0.82212 
## Number of obs: 2969, groups:  
## beep_ID_new, 248; participant_ID, 203; program_ID, 9
## 
## Fixed effects:
##             Estimate Std. Error t value
## (Intercept)  1.89567    0.08705   21.78
sjstats::icc(M04)
## 
## Linear mixed model
##  Family: gaussian (identity)
## Formula: frustrated ~ (1 | program_ID) + (1 | participant_ID) + (1 | beep_ID_new)
## 
##      ICC (beep_ID_new): 0.007215
##   ICC (participant_ID): 0.409199
##       ICC (program_ID): 0.033842
M05 <- lmer(bored ~
             (1|program_ID) + 
             (1|participant_ID) + 
             (1|beep_ID_new),
           data = df)
summary(M05)
## Linear mixed model fit by REML ['lmerMod']
## Formula: 
## bored ~ (1 | program_ID) + (1 | participant_ID) + (1 | beep_ID_new)
##    Data: df
## 
## REML criterion at convergence: 8288.4
## 
## Scaled residuals: 
##      Min       1Q   Median       3Q      Max 
## -2.97201 -0.61796 -0.09737  0.48698  3.08594 
## 
## Random effects:
##  Groups         Name        Variance Std.Dev.
##  beep_ID_new    (Intercept) 0.03174  0.1782  
##  participant_ID (Intercept) 0.53709  0.7329  
##  program_ID     (Intercept) 0.08910  0.2985  
##  Residual                   0.78770  0.8875  
## Number of obs: 2969, groups:  
## beep_ID_new, 248; participant_ID, 203; program_ID, 9
## 
## Fixed effects:
##             Estimate Std. Error t value
## (Intercept)    2.155      0.115   18.74
sjstats::icc(M05)
## 
## Linear mixed model
##  Family: gaussian (identity)
## Formula: bored ~ (1 | program_ID) + (1 | participant_ID) + (1 | beep_ID_new)
## 
##      ICC (beep_ID_new): 0.021959
##   ICC (participant_ID): 0.371529
##       ICC (program_ID): 0.061631