Loading packages
library(dplyr)
##
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
##
## filter, lag
## The following objects are masked from 'package:base':
##
## intersect, setdiff, setequal, union
library(tidyverse)
## ── Attaching packages ─────────────────────────────────────────────────────────────────────── tidyverse 1.2.1 ──
## ✔ ggplot2 2.2.1 ✔ readr 1.1.1
## ✔ tibble 1.4.2 ✔ purrr 0.2.5
## ✔ tidyr 0.8.1 ✔ stringr 1.3.1
## ✔ ggplot2 2.2.1 ✔ forcats 0.3.0
## ── Conflicts ────────────────────────────────────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag() masks stats::lag()
library(lme4)
## Loading required package: Matrix
##
## Attaching package: 'Matrix'
## The following object is masked from 'package:tidyr':
##
## expand
library(lmerTest)
##
## Attaching package: 'lmerTest'
## The following object is masked from 'package:lme4':
##
## lmer
## The following object is masked from 'package:stats':
##
## step
library(sjstats)
library(jmRtools)
library(MuMIn)
Loading data
SciMo_esm <- read_csv("/Volumes/SCHMIDTLAB/PSE/Data/SciMo/Sci-Mo-esm.csv")
## Parsed with column specification:
## cols(
## .default = col_double(),
## stud_ID = col_character(),
## teacher_ID = col_integer(),
## subject = col_integer(),
## month = col_integer(),
## day = col_integer(),
## year = col_integer(),
## pager = col_integer(),
## Wave = col_integer(),
## part_stat = col_integer(),
## gender = col_integer(),
## race = col_integer(),
## grade = col_integer(),
## age = col_integer(),
## beep = col_integer(),
## lecture = col_integer(),
## lab = col_integer(),
## manage = col_integer(),
## present = col_integer(),
## seat = col_integer(),
## test = col_integer()
## # ... with 3 more columns
## )
## See spec(...) for full column specifications.
SciMo_student_survey <- read_csv("/Volumes/SCHMIDTLAB/PSE/Data/SciMo/Sci-Mo-student-survey.csv")
## Parsed with column specification:
## cols(
## .default = col_double(),
## stud_ID = col_character(),
## FirstQuar_2010 = col_integer(),
## SecondQuar_2010 = col_integer(),
## ThirdQuar_2010 = col_character(),
## FourthQuar_2010 = col_character(),
## ExploreComp_2010 = col_integer(),
## PlanComp_2010 = col_integer(),
## ACTComp_2010 = col_integer(),
## Grad_2010 = col_integer(),
## FirstQuar_2011 = col_integer(),
## SecondQuar_2011 = col_integer(),
## ThirdQuar_2011 = col_character(),
## FourthQuar_2011 = col_integer(),
## ExloreComp2011 = col_integer(),
## ExploreSciComp_2011 = col_integer(),
## PlanComp_2011 = col_integer(),
## PlanSciComp_2011 = col_integer(),
## ACTComp_2011 = col_integer(),
## ACTSciComp_2011 = col_integer(),
## Grad_2011 = col_integer()
## )
## See spec(...) for full column specifications.
Creating variables
SciMo_student_survey$female <- ifelse(SciMo_student_survey$gender == 2, 1, 0)
SciMo_student_survey$minority <- ifelse(SciMo_student_survey$race == 4, 0, 1)
SciMo_esm$engagement_three <- composite_mean_maker(SciMo_esm, enjoy, conc, hardwk)
fix_missing <- function(x) {
x[x == NA] <- 0
x
}
SciMo_esm$ch_who[is.na(SciMo_esm$ch_who)] <- 0
SciMo_esm$ch_howdo[is.na(SciMo_esm$ch_howdo)] <- 0
SciMo_esm$ch_mat[is.na(SciMo_esm$ch_mat)] <- 0
SciMo_esm$ch_time[is.na(SciMo_esm$ch_time)] <- 0
SciMo_esm$ch_doing[is.na(SciMo_esm$ch_doing)] <- 0
SciMo_esm$ch_topic[is.na(SciMo_esm$ch_topic)] <- 0
SciMo_esm$ch_defin[is.na(SciMo_esm$ch_defin)] <- 0
SciMo_esm$ch_other[is.na(SciMo_esm$ch_other)] <- 0
SciMo_esm$ch_none[is.na(SciMo_esm$ch_none)] <- 0
SciMo_esm$ch_none <- ifelse(((SciMo_esm$ch_who == 0 & SciMo_esm$ch_howdo == 0 & SciMo_esm$ch_mat == 0 & SciMo_esm$ch_time == 0 & SciMo_esm$ch_doing == 0 &
SciMo_esm$ch_defin == 0 & SciMo_esm$ch_topic == 0 & SciMo_esm$ch_other == 0) & SciMo_esm$ch_none == 0), 1, SciMo_esm$ch_none)
SciMo_esm$ch_none <- ifelse(((SciMo_esm$ch_who == 1 | SciMo_esm$ch_howdo == 1 | SciMo_esm$ch_mat == 1 | SciMo_esm$ch_time == 1 | SciMo_esm$ch_doing |
SciMo_esm$ch_defin == 1 | SciMo_esm$ch_topic == 1 | SciMo_esm$ch_other == 1) & SciMo_esm$ch_none == 1), 0, SciMo_esm$ch_none)
SciMo_esm$ch_framing <- ifelse(SciMo_esm$ch_defin == 1 | SciMo_esm$ch_topic == 1 | SciMo_esm$ch_doing, 1, 0)
SciMo_esm$anychoice <- ifelse(SciMo_esm$ch_mat == 1 | SciMo_esm$ch_howdo == 1 | SciMo_esm$ch_topic == 1 | SciMo_esm$ch_doing == 1 |SciMo_esm$ch_time == 1 |
SciMo_esm$ch_who == 1 | SciMo_esm$ch_defin == 1 | SciMo_esm$ch_other == 1, 1, 0)
Join data
SciMo_All <- left_join(SciMo_student_survey, SciMo_esm, by = "stud_ID")
Creating new beep_id variable for cross classification
SciMo_All<- SciMo_All %>%
dplyr::mutate(beep_id = stringr::str_c(signal, teacher_ID1, month, day, year))
Creating scaled interest variable
SciMo_All$interest_c <- scale(SciMo_All$interest)
SciMo_All$interest_fun_c <- scale(SciMo_All$interesfun1, scale = FALSE)
Null engagement model
M0 <- lmer(engagement_three ~
(1|stud_ID) +
(1|teacher_ID1) +
(1|beep_id),
data = SciMo_All)
summary(M0)
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula:
## engagement_three ~ (1 | stud_ID) + (1 | teacher_ID1) + (1 | beep_id)
## Data: SciMo_All
##
## REML criterion at convergence: 8114.4
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -3.9105 -0.6118 0.0359 0.6346 2.9412
##
## Random effects:
## Groups Name Variance Std.Dev.
## beep_id (Intercept) 0.04092 0.2023
## stud_ID (Intercept) 0.22587 0.4753
## teacher_ID1 (Intercept) 0.01347 0.1160
## Residual 0.36318 0.6026
## Number of obs: 4000, groups: beep_id, 246; stud_ID, 232; teacher_ID1, 12
##
## Fixed effects:
## Estimate Std. Error df t value Pr(>|t|)
## (Intercept) 1.63992 0.04887 9.22780 33.55 5.84e-11 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
sjstats::icc(M0)
##
## Linear mixed model
## Family: gaussian (identity)
## Formula: engagement_three ~ (1 | stud_ID) + (1 | teacher_ID1) + (1 | beep_id)
##
## ICC (beep_id): 0.063598
## ICC (stud_ID): 0.351039
## ICC (teacher_ID1): 0.020929
Null positive affect model
M00 <- lmer(posaffect ~
(1|stud_ID) +
(1|teacher_ID1) +
(1|beep_id),
data = SciMo_All)
summary(M00)
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: posaffect ~ (1 | stud_ID) + (1 | teacher_ID1) + (1 | beep_id)
## Data: SciMo_All
##
## REML criterion at convergence: 8239.3
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -3.5318 -0.6251 -0.1032 0.5371 3.8401
##
## Random effects:
## Groups Name Variance Std.Dev.
## beep_id (Intercept) 1.500e-02 1.225e-01
## stud_ID (Intercept) 3.327e-01 5.768e-01
## teacher_ID1 (Intercept) 1.840e-14 1.356e-07
## Residual 3.842e-01 6.199e-01
## Number of obs: 3981, groups: beep_id, 246; stud_ID, 232; teacher_ID1, 12
##
## Fixed effects:
## Estimate Std. Error df t value Pr(>|t|)
## (Intercept) 1.05458 0.04008 247.04400 26.32 <2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
sjstats::icc(M00)
##
## Linear mixed model
## Family: gaussian (identity)
## Formula: posaffect ~ (1 | stud_ID) + (1 | teacher_ID1) + (1 | beep_id)
##
## ICC (beep_id): 0.020490
## ICC (stud_ID): 0.454562
## ICC (teacher_ID1): 0.000000
Null negative affect model
M000 <- lmer(negaffect ~
(1|stud_ID) +
(1|teacher_ID1) +
(1|beep_id),
data = SciMo_All)
summary(M000)
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: negaffect ~ (1 | stud_ID) + (1 | teacher_ID1) + (1 | beep_id)
## Data: SciMo_All
##
## REML criterion at convergence: 7881.3
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -2.5607 -0.5353 -0.1661 0.3600 4.5185
##
## Random effects:
## Groups Name Variance Std.Dev.
## beep_id (Intercept) 0.01678 0.1295
## stud_ID (Intercept) 0.19936 0.4465
## teacher_ID1 (Intercept) 0.01915 0.1384
## Residual 0.35730 0.5977
## Number of obs: 3979, groups: beep_id, 246; stud_ID, 232; teacher_ID1, 12
##
## Fixed effects:
## Estimate Std. Error df t value Pr(>|t|)
## (Intercept) 0.57816 0.05145 10.16721 11.24 4.66e-07 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
sjstats::icc(M000)
##
## Linear mixed model
## Family: gaussian (identity)
## Formula: negaffect ~ (1 | stud_ID) + (1 | teacher_ID1) + (1 | beep_id)
##
## ICC (beep_id): 0.028319
## ICC (stud_ID): 0.336415
## ICC (teacher_ID1): 0.032314
Null learning model
M0000 <- lmer(learning ~
(1|stud_ID) +
(1|teacher_ID1) +
(1|beep_id),
data = SciMo_All)
summary(M0000)
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: learning ~ (1 | stud_ID) + (1 | teacher_ID1) + (1 | beep_id)
## Data: SciMo_All
##
## REML criterion at convergence: 10202
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -3.1959 -0.6187 0.0672 0.6805 2.7706
##
## Random effects:
## Groups Name Variance Std.Dev.
## beep_id (Intercept) 0.06630 0.2575
## stud_ID (Intercept) 0.24948 0.4995
## teacher_ID1 (Intercept) 0.02262 0.1504
## Residual 0.63593 0.7975
## Number of obs: 3980, groups: beep_id, 246; stud_ID, 232; teacher_ID1, 12
##
## Fixed effects:
## Estimate Std. Error df t value Pr(>|t|)
## (Intercept) 1.68250 0.05866 9.77007 28.68 9.28e-11 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
sjstats::icc(M0000)
##
## Linear mixed model
## Family: gaussian (identity)
## Formula: learning ~ (1 | stud_ID) + (1 | teacher_ID1) + (1 | beep_id)
##
## ICC (beep_id): 0.068049
## ICC (stud_ID): 0.256050
## ICC (teacher_ID1): 0.023213
Engagement
M1 <- lmer(engagement_three ~
interest_c +
anychoice +
(1|stud_ID) +
(1|teacher_ID1) +
(1|beep_id),
data = SciMo_All)
summary(M1, ddf="Kenward-Roger")
## Linear mixed model fit by REML. t-tests use Kenward-Roger's method [
## lmerModLmerTest]
## Formula: engagement_three ~ interest_c + anychoice + (1 | stud_ID) + (1 |
## teacher_ID1) + (1 | beep_id)
## Data: SciMo_All
##
## REML criterion at convergence: 6883.6
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -3.4682 -0.6178 0.0269 0.6466 3.9273
##
## Random effects:
## Groups Name Variance Std.Dev.
## beep_id (Intercept) 0.01583 0.1258
## stud_ID (Intercept) 0.10332 0.3214
## teacher_ID1 (Intercept) 0.01338 0.1157
## Residual 0.29460 0.5428
## Number of obs: 3883, groups: beep_id, 246; stud_ID, 232; teacher_ID1, 12
##
## Fixed effects:
## Estimate Std. Error df t value Pr(>|t|)
## (Intercept) 1.585e+00 4.345e-02 1.300e+01 36.48 1.77e-14 ***
## interest_c 3.755e-01 1.091e-02 3.753e+03 34.42 < 2e-16 ***
## anychoice 8.947e-02 2.254e-02 3.837e+03 3.97 7.32e-05 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Correlation of Fixed Effects:
## (Intr) intrs_
## interest_c 0.017
## anychoice -0.292 -0.059
sjstats::icc(M1)
##
## Linear mixed model
## Family: gaussian (identity)
## Formula: engagement_three ~ interest_c + anychoice + (1 | stud_ID) + (1 | teacher_ID1) + (1 | beep_id)
##
## ICC (beep_id): 0.037059
## ICC (stud_ID): 0.241888
## ICC (teacher_ID1): 0.031325
Positive Affect
M2 <- lmer(posaffect ~
interest_c +
anychoice +
(1|stud_ID) +
(1|teacher_ID1) +
(1|beep_id),
data = SciMo_All)
summary(M2, ddf="Kenward-Roger")
## Linear mixed model fit by REML. t-tests use Kenward-Roger's method [
## lmerModLmerTest]
## Formula:
## posaffect ~ interest_c + anychoice + (1 | stud_ID) + (1 | teacher_ID1) +
## (1 | beep_id)
## Data: SciMo_All
##
## REML criterion at convergence: 7540.9
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -4.0085 -0.6229 -0.0944 0.5446 4.3372
##
## Random effects:
## Groups Name Variance Std.Dev.
## beep_id (Intercept) 0.0034603 0.05882
## stud_ID (Intercept) 0.2713181 0.52088
## teacher_ID1 (Intercept) 0.0004677 0.02163
## Residual 0.3467685 0.58887
## Number of obs: 3872, groups: beep_id, 246; stud_ID, 232; teacher_ID1, 12
##
## Fixed effects:
## Estimate Std. Error df t value Pr(>|t|)
## (Intercept) 1.020e+00 3.906e-02 1.330e+01 26.11 8.07e-13 ***
## interest_c 2.674e-01 1.172e-02 3.354e+03 22.81 < 2e-16 ***
## anychoice 6.480e-02 2.446e-02 3.671e+03 2.65 0.0081 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Correlation of Fixed Effects:
## (Intr) intrs_
## interest_c 0.018
## anychoice -0.346 -0.048
sjstats::icc(M2)
##
## Linear mixed model
## Family: gaussian (identity)
## Formula: posaffect ~ interest_c + anychoice + (1 | stud_ID) + (1 | teacher_ID1) + (1 | beep_id)
##
## ICC (beep_id): 0.005563
## ICC (stud_ID): 0.436193
## ICC (teacher_ID1): 0.000752
Negative Affect
M3 <- lmer(negaffect ~
interest_c +
anychoice +
(1|stud_ID) +
(1|teacher_ID1) +
(1|beep_id),
data = SciMo_All)
summary(M3, ddf="Kenward-Roger")
## Linear mixed model fit by REML. t-tests use Kenward-Roger's method [
## lmerModLmerTest]
## Formula:
## negaffect ~ interest_c + anychoice + (1 | stud_ID) + (1 | teacher_ID1) +
## (1 | beep_id)
## Data: SciMo_All
##
## REML criterion at convergence: 7657
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -2.6520 -0.5392 -0.1693 0.3573 4.6164
##
## Random effects:
## Groups Name Variance Std.Dev.
## beep_id (Intercept) 0.01511 0.1229
## stud_ID (Intercept) 0.19998 0.4472
## teacher_ID1 (Intercept) 0.01904 0.1380
## Residual 0.35501 0.5958
## Number of obs: 3872, groups: beep_id, 246; stud_ID, 232; teacher_ID1, 12
##
## Fixed effects:
## Estimate Std. Error df t value Pr(>|t|)
## (Intercept) 5.819e-01 5.330e-02 1.254e+01 10.917 9.08e-08 ***
## interest_c -7.660e-02 1.209e-02 3.693e+03 -6.334 2.68e-10 ***
## anychoice -8.341e-03 2.500e-02 3.852e+03 -0.334 0.739
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Correlation of Fixed Effects:
## (Intr) intrs_
## interest_c 0.014
## anychoice -0.263 -0.053
sjstats::icc(M3)
##
## Linear mixed model
## Family: gaussian (identity)
## Formula: negaffect ~ interest_c + anychoice + (1 | stud_ID) + (1 | teacher_ID1) + (1 | beep_id)
##
## ICC (beep_id): 0.025647
## ICC (stud_ID): 0.339439
## ICC (teacher_ID1): 0.032322
Learning
M4 <- lmer(learning ~
interest_c +
anychoice +
(1|stud_ID) +
(1|teacher_ID1) +
(1|beep_id),
data = SciMo_All)
summary(M4, ddf="Kenward-Roger")
## Linear mixed model fit by REML. t-tests use Kenward-Roger's method [
## lmerModLmerTest]
## Formula:
## learning ~ interest_c + anychoice + (1 | stud_ID) + (1 | teacher_ID1) +
## (1 | beep_id)
## Data: SciMo_All
##
## REML criterion at convergence: 9296.9
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -3.6911 -0.6150 0.0329 0.6511 3.0100
##
## Random effects:
## Groups Name Variance Std.Dev.
## beep_id (Intercept) 0.03256 0.1804
## stud_ID (Intercept) 0.12624 0.3553
## teacher_ID1 (Intercept) 0.02394 0.1547
## Residual 0.56441 0.7513
## Number of obs: 3868, groups: beep_id, 246; stud_ID, 232; teacher_ID1, 12
##
## Fixed effects:
## Estimate Std. Error df t value Pr(>|t|)
## (Intercept) 1.634e+00 5.621e-02 1.332e+01 29.070 1.94e-13 ***
## interest_c 3.948e-01 1.493e-02 3.644e+03 26.451 < 2e-16 ***
## anychoice 8.196e-02 3.079e-02 3.668e+03 2.662 0.0078 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Correlation of Fixed Effects:
## (Intr) intrs_
## interest_c 0.020
## anychoice -0.309 -0.064
sjstats::icc(M4)
##
## Linear mixed model
## Family: gaussian (identity)
## Formula: learning ~ interest_c + anychoice + (1 | stud_ID) + (1 | teacher_ID1) + (1 | beep_id)
##
## ICC (beep_id): 0.043582
## ICC (stud_ID): 0.168960
## ICC (teacher_ID1): 0.032036
Engagement
M1a <- lmer(engagement_three ~
interest_c +
ch_who +
ch_howdo +
ch_mat +
ch_time +
ch_other +
ch_framing +
(1|stud_ID) +
(1|teacher_ID1) +
(1|beep_id),
data = SciMo_All)
summary(M1a, ddf="Kenward-Roger")
## Linear mixed model fit by REML. t-tests use Kenward-Roger's method [
## lmerModLmerTest]
## Formula: engagement_three ~ interest_c + ch_who + ch_howdo + ch_mat +
## ch_time + ch_other + ch_framing + (1 | stud_ID) + (1 | teacher_ID1) +
## (1 | beep_id)
## Data: SciMo_All
##
## REML criterion at convergence: 6886.5
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -3.4267 -0.6108 0.0268 0.6408 3.9302
##
## Random effects:
## Groups Name Variance Std.Dev.
## beep_id (Intercept) 0.01474 0.1214
## stud_ID (Intercept) 0.10410 0.3226
## teacher_ID1 (Intercept) 0.01298 0.1139
## Residual 0.29368 0.5419
## Number of obs: 3883, groups: beep_id, 246; stud_ID, 232; teacher_ID1, 12
##
## Fixed effects:
## Estimate Std. Error df t value Pr(>|t|)
## (Intercept) 1.59540 0.04245 12.30285 37.584 4.51e-14 ***
## interest_c 0.37387 0.01090 3749.04937 34.288 < 2e-16 ***
## ch_who -0.01965 0.03431 3366.17147 -0.573 0.566962
## ch_howdo 0.07245 0.02809 3823.77051 2.580 0.009924 **
## ch_mat 0.06898 0.03300 3860.75524 2.090 0.036665 *
## ch_time 0.10604 0.03056 3857.22413 3.470 0.000526 ***
## ch_other -0.02283 0.02962 3798.55708 -0.771 0.440882
## ch_framing 0.02679 0.02850 3836.19461 0.940 0.347286
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Correlation of Fixed Effects:
## (Intr) intrs_ ch_who ch_hwd ch_mat ch_tim ch_thr
## interest_c 0.018
## ch_who -0.046 -0.002
## ch_howdo -0.082 -0.027 -0.110
## ch_mat -0.052 -0.060 -0.136 -0.228
## ch_time -0.065 -0.010 -0.136 -0.152 -0.107
## ch_other -0.143 -0.039 0.010 0.029 0.041 0.024
## ch_framing -0.111 -0.016 -0.059 -0.063 -0.057 -0.017 0.058
sjstats::icc(M1a)
##
## Linear mixed model
## Family: gaussian (identity)
## Formula: engagement_three ~ interest_c + ch_who + ch_howdo + ch_mat + ch_time + ch_other + ch_framing + (1 | stud_ID) + (1 | teacher_ID1) + (1 | beep_id)
##
## ICC (beep_id): 0.034639
## ICC (stud_ID): 0.244650
## ICC (teacher_ID1): 0.030501
Positive Affect
M2a <- lmer(posaffect ~
interest_c +
ch_who +
ch_howdo +
ch_mat +
ch_time +
ch_other +
ch_framing +
(1|stud_ID) +
(1|teacher_ID1) +
(1|beep_id),
data = SciMo_All)
summary(M2a, ddf="Kenward-Roger")
## Linear mixed model fit by REML. t-tests use Kenward-Roger's method [
## lmerModLmerTest]
## Formula: posaffect ~ interest_c + ch_who + ch_howdo + ch_mat + ch_time +
## ch_other + ch_framing + (1 | stud_ID) + (1 | teacher_ID1) +
## (1 | beep_id)
## Data: SciMo_All
##
## REML criterion at convergence: 7558
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -4.0220 -0.6179 -0.0988 0.5432 4.2920
##
## Random effects:
## Groups Name Variance Std.Dev.
## beep_id (Intercept) 0.0033028 0.05747
## stud_ID (Intercept) 0.2715190 0.52107
## teacher_ID1 (Intercept) 0.0002614 0.01617
## Residual 0.3466757 0.58879
## Number of obs: 3872, groups: beep_id, 246; stud_ID, 232; teacher_ID1, 12
##
## Fixed effects:
## Estimate Std. Error df t value Pr(>|t|)
## (Intercept) 1.024e+00 3.808e-02 1.228e+01 26.898 2.73e-12 ***
## interest_c 2.666e-01 1.175e-02 3.375e+03 22.692 < 2e-16 ***
## ch_who 9.416e-02 3.614e-02 2.712e+03 2.606 0.00922 **
## ch_howdo 6.610e-03 3.059e-02 3.771e+03 0.216 0.82891
## ch_mat 3.289e-02 3.566e-02 3.666e+03 0.922 0.35636
## ch_time 3.159e-02 3.312e-02 3.748e+03 0.954 0.34025
## ch_other 5.100e-02 3.253e-02 3.835e+03 1.568 0.11702
## ch_framing 6.128e-03 3.129e-02 3.833e+03 0.196 0.84473
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Correlation of Fixed Effects:
## (Intr) intrs_ ch_who ch_hwd ch_mat ch_tim ch_thr
## interest_c 0.019
## ch_who -0.045 0.001
## ch_howdo -0.098 -0.023 -0.113
## ch_mat -0.061 -0.070 -0.136 -0.235
## ch_time -0.079 0.000 -0.142 -0.149 -0.104
## ch_other -0.173 -0.029 0.002 0.030 0.044 0.023
## ch_framing -0.134 -0.010 -0.063 -0.057 -0.053 -0.012 0.062
sjstats::icc(M2a)
##
## Linear mixed model
## Family: gaussian (identity)
## Formula: posaffect ~ interest_c + ch_who + ch_howdo + ch_mat + ch_time + ch_other + ch_framing + (1 | stud_ID) + (1 | teacher_ID1) + (1 | beep_id)
##
## ICC (beep_id): 0.005312
## ICC (stud_ID): 0.436695
## ICC (teacher_ID1): 0.000420
Engagement
M3a <- lmer(negaffect ~
interest_c +
ch_who +
ch_howdo +
ch_mat +
ch_time +
ch_other +
ch_framing +
(1|stud_ID) +
(1|teacher_ID1) +
(1|beep_id),
data = SciMo_All)
summary(M3a, ddf="Kenward-Roger")
## Linear mixed model fit by REML. t-tests use Kenward-Roger's method [
## lmerModLmerTest]
## Formula: negaffect ~ interest_c + ch_who + ch_howdo + ch_mat + ch_time +
## ch_other + ch_framing + (1 | stud_ID) + (1 | teacher_ID1) +
## (1 | beep_id)
## Data: SciMo_All
##
## REML criterion at convergence: 7672
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -2.5976 -0.5471 -0.1670 0.3577 4.7035
##
## Random effects:
## Groups Name Variance Std.Dev.
## beep_id (Intercept) 0.01369 0.1170
## stud_ID (Intercept) 0.20153 0.4489
## teacher_ID1 (Intercept) 0.01847 0.1359
## Residual 0.35532 0.5961
## Number of obs: 3872, groups: beep_id, 246; stud_ID, 232; teacher_ID1, 12
##
## Fixed effects:
## Estimate Std. Error df t value Pr(>|t|)
## (Intercept) 0.57691 0.05227 11.99904 11.037 1.22e-07 ***
## interest_c -0.07740 0.01210 3680.15527 -6.395 1.81e-10 ***
## ch_who -0.03959 0.03770 3186.99150 -1.050 0.2937
## ch_howdo 0.01307 0.03112 3781.78232 0.420 0.6746
## ch_mat 0.02833 0.03651 3800.86182 0.776 0.4379
## ch_time 0.06595 0.03382 3804.77447 1.950 0.0513 .
## ch_other -0.05806 0.03304 3859.53222 -1.757 0.0789 .
## ch_framing -0.00924 0.03175 3844.33132 -0.291 0.7711
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Correlation of Fixed Effects:
## (Intr) intrs_ ch_who ch_hwd ch_mat ch_tim ch_thr
## interest_c 0.016
## ch_who -0.039 -0.001
## ch_howdo -0.075 -0.023 -0.108
## ch_mat -0.048 -0.062 -0.136 -0.229
## ch_time -0.059 -0.008 -0.138 -0.148 -0.106
## ch_other -0.129 -0.033 0.007 0.030 0.042 0.023
## ch_framing -0.101 -0.013 -0.063 -0.058 -0.055 -0.012 0.061
sjstats::icc(M3a)
##
## Linear mixed model
## Family: gaussian (identity)
## Formula: negaffect ~ interest_c + ch_who + ch_howdo + ch_mat + ch_time + ch_other + ch_framing + (1 | stud_ID) + (1 | teacher_ID1) + (1 | beep_id)
##
## ICC (beep_id): 0.023247
## ICC (stud_ID): 0.342154
## ICC (teacher_ID1): 0.031362
Learning
M4a <- lmer(learning ~
interest_c +
ch_who +
ch_howdo +
ch_mat +
ch_time +
ch_other +
ch_framing +
(1|stud_ID) +
(1|teacher_ID1) +
(1|beep_id),
data = SciMo_All)
summary(M4a, ddf="Kenward-Roger")
## Linear mixed model fit by REML. t-tests use Kenward-Roger's method [
## lmerModLmerTest]
## Formula: learning ~ interest_c + ch_who + ch_howdo + ch_mat + ch_time +
## ch_other + ch_framing + (1 | stud_ID) + (1 | teacher_ID1) +
## (1 | beep_id)
## Data: SciMo_All
##
## REML criterion at convergence: 9320.4
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -3.6846 -0.6131 0.0350 0.6562 2.9827
##
## Random effects:
## Groups Name Variance Std.Dev.
## beep_id (Intercept) 0.03248 0.1802
## stud_ID (Intercept) 0.12624 0.3553
## teacher_ID1 (Intercept) 0.02256 0.1502
## Residual 0.56554 0.7520
## Number of obs: 3868, groups: beep_id, 246; stud_ID, 232; teacher_ID1, 12
##
## Fixed effects:
## Estimate Std. Error df t value Pr(>|t|)
## (Intercept) 1.65993 0.05429 12.54423 30.577 3.69e-13 ***
## interest_c 0.39523 0.01497 3653.73119 26.396 < 2e-16 ***
## ch_who -0.04327 0.04750 3456.90897 -0.911 0.3624
## ch_howdo 0.03307 0.03867 3818.50050 0.855 0.3926
## ch_mat 0.03239 0.04547 3835.27243 0.712 0.4763
## ch_time -0.01686 0.04207 3854.49148 -0.401 0.6887
## ch_other 0.07543 0.04046 3560.62557 1.864 0.0624 .
## ch_framing 0.01711 0.03904 3702.76969 0.438 0.6612
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Correlation of Fixed Effects:
## (Intr) intrs_ ch_who ch_hwd ch_mat ch_tim ch_thr
## interest_c 0.021
## ch_who -0.051 -0.001
## ch_howdo -0.086 -0.028 -0.111
## ch_mat -0.055 -0.060 -0.136 -0.231
## ch_time -0.068 -0.013 -0.137 -0.158 -0.107
## ch_other -0.153 -0.042 0.012 0.029 0.041 0.023
## ch_framing -0.117 -0.021 -0.057 -0.071 -0.063 -0.021 0.056
sjstats::icc(M4a)
##
## Linear mixed model
## Family: gaussian (identity)
## Formula: learning ~ interest_c + ch_who + ch_howdo + ch_mat + ch_time + ch_other + ch_framing + (1 | stud_ID) + (1 | teacher_ID1) + (1 | beep_id)
##
## ICC (beep_id): 0.043492
## ICC (stud_ID): 0.169040
## ICC (teacher_ID1): 0.030204
Any choice predicting engagement
M1_1 <- lmer(engagement_three ~ interest_fun_c +
interest_c +
anychoice +
interest_c*anychoice +
interest_fun_c*anychoice +
female +
minority +
(1|stud_ID) + (1|teacher_ID1) + (1|beep_id), data = SciMo_All)
summary(M1_1, ddf="Kenward-Roger")
## Linear mixed model fit by REML. t-tests use Kenward-Roger's method [
## lmerModLmerTest]
## Formula: engagement_three ~ interest_fun_c + interest_c + anychoice +
## interest_c * anychoice + interest_fun_c * anychoice + female +
## minority + (1 | stud_ID) + (1 | teacher_ID1) + (1 | beep_id)
## Data: SciMo_All
##
## REML criterion at convergence: 6848.5
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -3.3607 -0.6155 0.0288 0.6424 4.0077
##
## Random effects:
## Groups Name Variance Std.Dev.
## beep_id (Intercept) 0.01601 0.1265
## stud_ID (Intercept) 0.09053 0.3009
## teacher_ID1 (Intercept) 0.01025 0.1012
## Residual 0.29444 0.5426
## Number of obs: 3867, groups: beep_id, 246; stud_ID, 231; teacher_ID1, 12
##
## Fixed effects:
## Estimate Std. Error df t value Pr(>|t|)
## (Intercept) 1.66461 0.05343 38.15819 31.157 < 2e-16
## interest_fun_c 0.13903 0.03206 343.61634 4.336 1.91e-05
## interest_c 0.39871 0.01559 3837.93155 25.576 < 2e-16
## anychoice 0.08443 0.02254 3787.71798 3.746 0.000183
## female -0.03043 0.04470 222.29682 -0.681 0.496699
## minority -0.09235 0.04803 224.97017 -1.923 0.055779
## interest_c:anychoice -0.05179 0.01992 3787.15889 -2.600 0.009372
## interest_fun_c:anychoice 0.02695 0.02811 3714.50829 0.959 0.337615
##
## (Intercept) ***
## interest_fun_c ***
## interest_c ***
## anychoice ***
## female
## minority .
## interest_c:anychoice **
## interest_fun_c:anychoice
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Correlation of Fixed Effects:
## (Intr) intr__ intrs_ anychc female minrty intr_:
## intrst_fn_c 0.014
## interest_c 0.037 -0.121
## anychoice -0.216 -0.051 -0.065
## female -0.364 0.098 -0.009 -0.001
## minority -0.540 -0.043 -0.017 -0.043 -0.047
## intrst_c:ny -0.029 0.073 -0.710 0.040 0.014 0.003
## intrst_fn_: -0.018 -0.444 0.098 0.033 -0.012 -0.011 -0.163
ranova(M1_1, ddf="Kenward-Roger")
## ANOVA-like table for random-effects: Single term deletions
##
## Model:
## engagement_three ~ interest_fun_c + interest_c + anychoice +
## female + minority + (1 | stud_ID) + (1 | teacher_ID1) + (1 |
## beep_id) + interest_c:anychoice + interest_fun_c:anychoice
## npar logLik AIC LRT Df Pr(>Chisq)
## <none> 12 -3424.2 6872.5
## (1 | stud_ID) 11 -3689.4 7400.8 530.34 1 < 2.2e-16 ***
## (1 | teacher_ID1) 11 -3426.5 6875.1 4.57 1 0.03246 *
## (1 | beep_id) 11 -3448.2 6918.3 47.83 1 4.645e-12 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
sjstats::icc(M1_1)
##
## Linear mixed model
## Family: gaussian (identity)
## Formula: engagement_three ~ interest_fun_c + interest_c + anychoice + interest_c * anychoice + interest_fun_c * anychoice + female + minority + (1 | stud_ID) + (1 | teacher_ID1) + (1 | beep_id)
##
## ICC (beep_id): 0.038939
## ICC (stud_ID): 0.220147
## ICC (teacher_ID1): 0.024916
sjPlot::sjp.int(M1_1, type = "eff", swap.pred = TRUE)
## Warning: 'sjPlot::sjp.int' is deprecated.
## Use 'plot_model' instead.
## See help("Deprecated")
#konfound::konfound(M1_1, `interest*choice`)
M1_1r<-r2glmm::r2beta(M1_1, method = "nsj")
M1_1r
## Effect Rsq upper.CL lower.CL
## 1 Model 0.306 0.329 0.285
## 3 interest_c 0.139 0.159 0.120
## 2 interest_fun_c 0.014 0.022 0.007
## 6 minority 0.005 0.010 0.001
## 4 anychoice 0.004 0.009 0.001
## 7 interest_c:anychoice 0.002 0.005 0.000
## 5 female 0.001 0.003 0.000
## 8 interest_fun_c:anychoice 0.000 0.002 0.000
MuMIn::r.squaredGLMM(M1_1)
## Warning: 'r.squaredGLMM' now calculates a revised statistic. See the help
## page.
## R2m R2c
## [1,] 0.3063495 0.503347
plot(M1_1r)
Any choice predicting positive affect
M2_2 <- lmer(posaffect ~ interest_fun_c +
interest_c +
anychoice +
interest_c*anychoice +
interest_fun_c*anychoice +
female +
minority +
(1|stud_ID) + (1|teacher_ID1) + (1|beep_id), data = SciMo_All)
summary(M2_2, ddf="Kenward-Roger")
## Linear mixed model fit by REML. t-tests use Kenward-Roger's method [
## lmerModLmerTest]
## Formula:
## posaffect ~ interest_fun_c + interest_c + anychoice + interest_c *
## anychoice + interest_fun_c * anychoice + female + minority +
## (1 | stud_ID) + (1 | teacher_ID1) + (1 | beep_id)
## Data: SciMo_All
##
## REML criterion at convergence: 7529.7
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -3.9753 -0.6137 -0.0919 0.5488 4.3577
##
## Random effects:
## Groups Name Variance Std.Dev.
## beep_id (Intercept) 3.245e-03 5.696e-02
## stud_ID (Intercept) 2.653e-01 5.151e-01
## teacher_ID1 (Intercept) 1.350e-13 3.674e-07
## Residual 3.477e-01 5.897e-01
## Number of obs: 3856, groups: beep_id, 246; stud_ID, 231; teacher_ID1, 12
##
## Fixed effects:
## Estimate Std. Error df t value Pr(>|t|)
## (Intercept) 1.00760 0.06841 71.78645 14.729 < 2e-16
## interest_fun_c 0.10603 0.04811 271.23985 2.204 0.02839
## interest_c 0.24960 0.01677 3538.07152 14.884 < 2e-16
## anychoice 0.06410 0.02458 3648.54307 2.608 0.00914
## female -0.07512 0.07169 226.88372 -1.048 0.29581
## minority 0.07739 0.07520 198.41024 1.029 0.30464
## interest_c:anychoice 0.02619 0.02158 3717.39838 1.214 0.22493
## interest_fun_c:anychoice 0.01119 0.03100 3835.77579 0.361 0.71811
##
## (Intercept) ***
## interest_fun_c *
## interest_c ***
## anychoice **
## female
## minority
## interest_c:anychoice
## interest_fun_c:anychoice
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Correlation of Fixed Effects:
## (Intr) intr__ intrs_ anychc female minrty intr_:
## intrst_fn_c 0.031
## interest_c 0.028 -0.083
## anychoice -0.176 -0.039 -0.060
## female -0.467 0.087 -0.008 0.005
## minority -0.660 -0.079 -0.007 -0.040 -0.045
## intrst_c:ny -0.023 0.047 -0.710 0.041 0.008 0.001
## intrst_fn_: -0.013 -0.327 0.092 0.036 -0.008 -0.010 -0.149
ranova(M2_2, ddf="Kenward-Roger")
## ANOVA-like table for random-effects: Single term deletions
##
## Model:
## posaffect ~ interest_fun_c + interest_c + anychoice + female +
## minority + (1 | stud_ID) + (1 | teacher_ID1) + (1 | beep_id) +
## interest_c:anychoice + interest_fun_c:anychoice
## npar logLik AIC LRT Df Pr(>Chisq)
## <none> 12 -3764.9 7553.7
## (1 | stud_ID) 11 -4507.1 9036.3 1484.56 1 <2e-16 ***
## (1 | teacher_ID1) 11 -3764.9 7551.7 0.00 1 1.0000
## (1 | beep_id) 11 -3765.9 7553.7 1.98 1 0.1592
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
sjstats::icc(M2_2)
##
## Linear mixed model
## Family: gaussian (identity)
## Formula: posaffect ~ interest_fun_c + interest_c + anychoice + interest_c * anychoice + interest_fun_c * anychoice + female + minority + (1 | stud_ID) + (1 | teacher_ID1) + (1 | beep_id)
##
## ICC (beep_id): 0.005265
## ICC (stud_ID): 0.430513
## ICC (teacher_ID1): 0.000000
#sjPlot::sjp.int(M2_2, type = "eff")
#konfound::konfound(M2_2, `interest*choice`)
M2_2r<-r2glmm::r2beta(M2_2, method = "nsj")
M2_2r
## Effect Rsq upper.CL lower.CL
## 1 Model 0.140 0.161 0.122
## 3 interest_c 0.040 0.053 0.029
## 2 interest_fun_c 0.005 0.011 0.002
## 5 female 0.002 0.006 0.000
## 6 minority 0.002 0.006 0.000
## 4 anychoice 0.002 0.005 0.000
## 7 interest_c:anychoice 0.000 0.002 0.000
## 8 interest_fun_c:anychoice 0.000 0.001 0.000
MuMIn::r.squaredGLMM(M2_2)
## R2m R2c
## [1,] 0.1397748 0.5146424
#plot(M2_2r)
Any choice predicting negative affect
M3_3 <- lmer(negaffect ~ interest_fun_c +
interest_c +
anychoice +
interest_c*anychoice +
interest_fun_c*anychoice +
female +
minority +
(1|stud_ID) + (1|teacher_ID1) + (1|beep_id), data = SciMo_All)
summary(M3_3, ddf="Kenward-Roger")
## Linear mixed model fit by REML. t-tests use Kenward-Roger's method [
## lmerModLmerTest]
## Formula:
## negaffect ~ interest_fun_c + interest_c + anychoice + interest_c *
## anychoice + interest_fun_c * anychoice + female + minority +
## (1 | stud_ID) + (1 | teacher_ID1) + (1 | beep_id)
## Data: SciMo_All
##
## REML criterion at convergence: 7643.4
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -2.6069 -0.5470 -0.1662 0.3690 4.6213
##
## Random effects:
## Groups Name Variance Std.Dev.
## beep_id (Intercept) 0.01496 0.1223
## stud_ID (Intercept) 0.18960 0.4354
## teacher_ID1 (Intercept) 0.02350 0.1533
## Residual 0.35603 0.5967
## Number of obs: 3856, groups: beep_id, 246; stud_ID, 231; teacher_ID1, 12
##
## Fixed effects:
## Estimate Std. Error df t value Pr(>|t|)
## (Intercept) 5.260e-01 7.546e-02 3.504e+01 6.971 4.14e-08
## interest_fun_c -5.481e-02 4.298e-02 3.029e+02 -1.275 0.20325
## interest_c -7.831e-02 1.725e-02 3.760e+03 -4.540 5.81e-06
## anychoice -6.446e-03 2.512e-02 3.833e+03 -0.257 0.79749
## female 1.861e-01 6.228e-02 2.221e+02 2.988 0.00312
## minority -4.863e-02 6.706e-02 2.259e+02 -0.725 0.46905
## interest_c:anychoice 8.123e-03 2.203e-02 3.736e+03 0.369 0.71232
## interest_fun_c:anychoice -2.005e-02 3.141e-02 3.822e+03 -0.638 0.52338
##
## (Intercept) ***
## interest_fun_c
## interest_c ***
## anychoice
## female **
## minority
## interest_c:anychoice
## interest_fun_c:anychoice
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Correlation of Fixed Effects:
## (Intr) intr__ intrs_ anychc female minrty intr_:
## intrst_fn_c 0.011
## interest_c 0.028 -0.098
## anychoice -0.170 -0.045 -0.065
## female -0.358 0.096 -0.006 -0.001
## minority -0.539 -0.046 -0.013 -0.034 -0.047
## intrst_c:ny -0.023 0.057 -0.707 0.043 0.011 0.002
## intrst_fn_: -0.015 -0.369 0.092 0.036 -0.009 -0.010 -0.154
ranova(M3_3, ddf="Kenward-Roger")
## ANOVA-like table for random-effects: Single term deletions
##
## Model:
## negaffect ~ interest_fun_c + interest_c + anychoice + female +
## minority + (1 | stud_ID) + (1 | teacher_ID1) + (1 | beep_id) +
## interest_c:anychoice + interest_fun_c:anychoice
## npar logLik AIC LRT Df Pr(>Chisq)
## <none> 12 -3821.7 7667.4
## (1 | stud_ID) 11 -4307.0 8636.0 970.61 1 < 2.2e-16 ***
## (1 | teacher_ID1) 11 -3825.5 7672.9 7.50 1 0.006161 **
## (1 | beep_id) 11 -3836.6 7695.2 29.75 1 4.926e-08 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
sjstats::icc(M3_3)
##
## Linear mixed model
## Family: gaussian (identity)
## Formula: negaffect ~ interest_fun_c + interest_c + anychoice + interest_c * anychoice + interest_fun_c * anychoice + female + minority + (1 | stud_ID) + (1 | teacher_ID1) + (1 | beep_id)
##
## ICC (beep_id): 0.025610
## ICC (stud_ID): 0.324604
## ICC (teacher_ID1): 0.040239
#sjPlot::sjp.int(M3_3, type = "eff")
#konfound::konfound(M3_3, `interest*choice`)
M3_3r<-r2glmm::r2beta(M3_3, method = "nsj")
M3_3r
## Effect Rsq upper.CL lower.CL
## 1 Model 0.035 0.049 0.026
## 5 female 0.014 0.023 0.008
## 3 interest_c 0.004 0.009 0.001
## 2 interest_fun_c 0.002 0.005 0.000
## 6 minority 0.001 0.004 0.000
## 8 interest_fun_c:anychoice 0.000 0.002 0.000
## 7 interest_c:anychoice 0.000 0.001 0.000
## 4 anychoice 0.000 0.001 0.000
MuMIn::r.squaredGLMM(M3_3)
## R2m R2c
## [1,] 0.03527226 0.4119527
#plot(M3_3r)
Any choice predicting learning
M4_4 <- lmer(learning ~ interest_fun_c +
interest_c +
anychoice +
interest_c*anychoice +
interest_fun_c*anychoice +
female +
minority +
(1|stud_ID) + (1|teacher_ID1) + (1|beep_id), data = SciMo_All)
summary(M4_4, ddf="Kenward-Roger")
## Linear mixed model fit by REML. t-tests use Kenward-Roger's method [
## lmerModLmerTest]
## Formula:
## learning ~ interest_fun_c + interest_c + anychoice + interest_c *
## anychoice + interest_fun_c * anychoice + female + minority +
## (1 | stud_ID) + (1 | teacher_ID1) + (1 | beep_id)
## Data: SciMo_All
##
## REML criterion at convergence: 9258.5
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -3.6249 -0.6175 0.0324 0.6510 3.0557
##
## Random effects:
## Groups Name Variance Std.Dev.
## beep_id (Intercept) 0.03263 0.1806
## stud_ID (Intercept) 0.11232 0.3351
## teacher_ID1 (Intercept) 0.01790 0.1338
## Residual 0.56497 0.7516
## Number of obs: 3852, groups: beep_id, 246; stud_ID, 231; teacher_ID1, 12
##
## Fixed effects:
## Estimate Std. Error df t value Pr(>|t|)
## (Intercept) 1.71818 0.06579 34.45083 26.115 < 2e-16
## interest_fun_c 0.13967 0.03885 378.83162 3.595 0.000367
## interest_c 0.40249 0.02149 3828.62446 18.729 < 2e-16
## anychoice 0.07834 0.03081 3586.17980 2.543 0.011033
## female 0.01315 0.05216 221.16253 0.252 0.801199
## minority -0.13579 0.05613 224.02698 -2.419 0.016350
## interest_c:anychoice -0.02420 0.02749 3801.87899 -0.881 0.378644
## interest_fun_c:anychoice 0.04373 0.03828 3442.92245 1.142 0.253448
##
## (Intercept) ***
## interest_fun_c ***
## interest_c ***
## anychoice *
## female
## minority *
## interest_c:anychoice
## interest_fun_c:anychoice
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Correlation of Fixed Effects:
## (Intr) intr__ intrs_ anychc female minrty intr_:
## intrst_fn_c 0.014
## interest_c 0.043 -0.141
## anychoice -0.241 -0.056 -0.065
## female -0.343 0.101 -0.010 -0.001
## minority -0.509 -0.037 -0.023 -0.048 -0.048
## intrst_c:ny -0.033 0.088 -0.713 0.037 0.017 0.005
## intrst_fn_: -0.019 -0.501 0.106 0.033 -0.015 -0.012 -0.173
ranova(M4_4, ddf="Kenward-Roger")
## ANOVA-like table for random-effects: Single term deletions
##
## Model:
## learning ~ interest_fun_c + interest_c + anychoice + female +
## minority + (1 | stud_ID) + (1 | teacher_ID1) + (1 | beep_id) +
## interest_c:anychoice + interest_fun_c:anychoice
## npar logLik AIC LRT Df Pr(>Chisq)
## <none> 12 -4629.2 9282.5
## (1 | stud_ID) 11 -4787.4 9596.8 316.36 1 < 2.2e-16 ***
## (1 | teacher_ID1) 11 -4632.2 9286.3 5.88 1 0.01534 *
## (1 | beep_id) 11 -4655.9 9333.8 53.34 1 2.805e-13 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
sjstats::icc(M4_4)
##
## Linear mixed model
## Family: gaussian (identity)
## Formula: learning ~ interest_fun_c + interest_c + anychoice + interest_c * anychoice + interest_fun_c * anychoice + female + minority + (1 | stud_ID) + (1 | teacher_ID1) + (1 | beep_id)
##
## ICC (beep_id): 0.044832
## ICC (stud_ID): 0.154327
## ICC (teacher_ID1): 0.024589
#sjPlot::sjp.int(M4_4, type = "eff")
#konfound::konfound(M4_4, `interest*choice`)
M4_4r<-r2glmm::r2beta(M4_4, method = "nsj")
M4_4r
## Effect Rsq upper.CL lower.CL
## 1 Model 0.215 0.238 0.195
## 3 interest_c 0.085 0.102 0.069
## 2 interest_fun_c 0.008 0.014 0.003
## 6 minority 0.006 0.011 0.002
## 4 anychoice 0.002 0.006 0.000
## 8 interest_fun_c:anychoice 0.000 0.003 0.000
## 7 interest_c:anychoice 0.000 0.002 0.000
## 5 female 0.000 0.002 0.000
MuMIn::r.squaredGLMM(M4_4)
## R2m R2c
## [1,] 0.2151071 0.3907257
#plot(M4_4r)
All choices predicting engagement
M11<-lmer(engagement_three ~ scale(interesfun1, scale=FALSE) +
interest_c +
ch_who +
ch_howdo +
ch_mat +
ch_time +
ch_other +
ch_framing +
female +
minority +
(1|stud_ID) + (1|teacher_ID1) + (1|beep_id), data = SciMo_All)
summary(M11, ddf="Kenward-Roger")
## Linear mixed model fit by REML. t-tests use Kenward-Roger's method [
## lmerModLmerTest]
## Formula:
## engagement_three ~ scale(interesfun1, scale = FALSE) + interest_c +
## ch_who + ch_howdo + ch_mat + ch_time + ch_other + ch_framing +
## female + minority + (1 | stud_ID) + (1 | teacher_ID1) + (1 |
## beep_id)
## Data: SciMo_All
##
## REML criterion at convergence: 6848.2
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -3.3662 -0.6093 0.0306 0.6406 3.9728
##
## Random effects:
## Groups Name Variance Std.Dev.
## beep_id (Intercept) 0.01492 0.1221
## stud_ID (Intercept) 0.09115 0.3019
## teacher_ID1 (Intercept) 0.01039 0.1019
## Residual 0.29400 0.5422
## Number of obs: 3867, groups: beep_id, 246; stud_ID, 231; teacher_ID1, 12
##
## Fixed effects:
## Estimate Std. Error df t value
## (Intercept) 1.67183 0.05315 36.75952 31.454
## scale(interesfun1, scale = FALSE) 0.15005 0.02884 232.16493 5.203
## interest_c 0.36868 0.01098 3741.29051 33.563
## ch_who -0.01842 0.03433 3364.18289 -0.536
## ch_howdo 0.07140 0.02804 3814.17379 2.546
## ch_mat 0.06895 0.03303 3843.97002 2.088
## ch_time 0.10059 0.03053 3846.00136 3.295
## ch_other -0.02351 0.02951 3737.46265 -0.797
## ch_framing 0.02289 0.02847 3800.68762 0.804
## female -0.02871 0.04485 222.56190 -0.640
## minority -0.09195 0.04825 226.22315 -1.906
## Pr(>|t|)
## (Intercept) < 2e-16 ***
## scale(interesfun1, scale = FALSE) 4.31e-07 ***
## interest_c < 2e-16 ***
## ch_who 0.591654
## ch_howdo 0.010930 *
## ch_mat 0.036903 *
## ch_time 0.000993 ***
## ch_other 0.425705
## ch_framing 0.421425
## female 0.522742
## minority 0.057962 .
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Correlation of Fixed Effects:
## (Intr) s(1s=F intrs_ ch_who ch_hwd ch_mat ch_tim ch_thr ch_frm
## s(1,s=FALSE 0.006
## interest_c 0.022 -0.120
## ch_who -0.042 0.002 -0.002
## ch_howdo -0.063 -0.001 -0.027 -0.111
## ch_mat -0.010 -0.024 -0.056 -0.133 -0.229
## ch_time -0.060 -0.027 -0.008 -0.137 -0.154 -0.108
## ch_other -0.103 -0.015 -0.037 0.010 0.029 0.041 0.025
## ch_framing -0.074 -0.029 -0.011 -0.059 -0.065 -0.056 -0.018 0.058
## female -0.364 0.104 0.003 0.007 -0.001 0.001 -0.017 -0.030 0.015
## minority -0.549 -0.053 -0.019 0.004 -0.004 -0.056 0.025 0.000 -0.037
## female
## s(1,s=FALSE
## interest_c
## ch_who
## ch_howdo
## ch_mat
## ch_time
## ch_other
## ch_framing
## female
## minority -0.048
ranova(M11, ddf="Kenward-Roger")
## ANOVA-like table for random-effects: Single term deletions
##
## Model:
## engagement_three ~ scale(interesfun1, scale = FALSE) + interest_c +
## ch_who + ch_howdo + ch_mat + ch_time + ch_other + ch_framing +
## female + minority + (1 | stud_ID) + (1 | teacher_ID1) + (1 |
## beep_id)
## npar logLik AIC LRT Df Pr(>Chisq)
## <none> 15 -3424.1 6878.2
## (1 | stud_ID) 14 -3691.5 7411.1 534.90 1 < 2.2e-16 ***
## (1 | teacher_ID1) 14 -3426.4 6880.9 4.71 1 0.02992 *
## (1 | beep_id) 14 -3445.2 6918.4 42.25 1 8.033e-11 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
sjstats::icc(M11)
##
## Linear mixed model
## Family: gaussian (identity)
## Formula: engagement_three ~ scale(interesfun1, scale = FALSE) + interest_c + ch_who + ch_howdo + ch_mat + ch_time + ch_other + ch_framing + female + minority + (1 | stud_ID) + (1 | teacher_ID1) + (1 | beep_id)
##
## ICC (beep_id): 0.036339
## ICC (stud_ID): 0.222073
## ICC (teacher_ID1): 0.025306
#sjPlot::sjp.int(M11, type = "eff")
M11r<-r2glmm::r2beta(M11, method = "nsj")
M11r
## Effect Rsq upper.CL lower.CL
## 1 Model 0.310 0.333 0.289
## 3 interest_c 0.236 0.258 0.214
## 2 scale(interesfun1, scale = FALSE) 0.031 0.043 0.021
## 11 minority 0.005 0.010 0.001
## 7 ch_time 0.003 0.007 0.000
## 5 ch_howdo 0.002 0.005 0.000
## 6 ch_mat 0.001 0.004 0.000
## 10 female 0.000 0.003 0.000
## 8 ch_other 0.000 0.002 0.000
## 9 ch_framing 0.000 0.002 0.000
## 4 ch_who 0.000 0.002 0.000
MuMIn::r.squaredGLMM(M11)
## R2m R2c
## [1,] 0.3097681 0.5055992
#plot(M11r)
All choices predicting positive affect
M22<-lmer(posaffect ~ scale(interesfun1, scale=FALSE) +
interest_c +
ch_who +
ch_howdo +
ch_mat +
ch_time +
ch_other +
ch_framing +
female +
minority +
(1|stud_ID) + (1|teacher_ID1) + (1|beep_id), data = SciMo_All)
summary(M22, ddf="Kenward-Roger")
## Linear mixed model fit by REML. t-tests use Kenward-Roger's method [
## lmerModLmerTest]
## Formula: posaffect ~ scale(interesfun1, scale = FALSE) + interest_c +
## ch_who + ch_howdo + ch_mat + ch_time + ch_other + ch_framing +
## female + minority + (1 | stud_ID) + (1 | teacher_ID1) + (1 |
## beep_id)
## Data: SciMo_All
##
## REML criterion at convergence: 7537.5
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -3.9917 -0.6176 -0.0992 0.5450 4.3077
##
## Random effects:
## Groups Name Variance Std.Dev.
## beep_id (Intercept) 0.003096 0.05565
## stud_ID (Intercept) 0.264993 0.51477
## teacher_ID1 (Intercept) 0.000000 0.00000
## Residual 0.347612 0.58959
## Number of obs: 3856, groups: beep_id, 246; stud_ID, 231; teacher_ID1, 12
##
## Fixed effects:
## Estimate Std. Error df t value
## (Intercept) 1.015e+00 6.796e-02 6.989e+01 14.940
## scale(interesfun1, scale = FALSE) 1.107e-01 4.551e-02 2.198e+02 2.432
## interest_c 2.634e-01 1.183e-02 3.341e+03 22.266
## ch_who 9.498e-02 3.619e-02 2.683e+03 2.624
## ch_howdo 5.801e-03 3.062e-02 3.757e+03 0.189
## ch_mat 3.132e-02 3.576e-02 3.642e+03 0.876
## ch_time 2.944e-02 3.316e-02 3.730e+03 0.888
## ch_other 5.076e-02 3.256e-02 3.813e+03 1.559
## ch_framing 2.604e-03 3.137e-02 3.815e+03 0.083
## female -7.689e-02 7.167e-02 2.269e+02 -1.073
## minority 7.703e-02 7.521e-02 1.989e+02 1.024
## Pr(>|t|)
## (Intercept) < 2e-16 ***
## scale(interesfun1, scale = FALSE) 0.01582 *
## interest_c < 2e-16 ***
## ch_who 0.00873 **
## ch_howdo 0.84974
## ch_mat 0.38123
## ch_time 0.37471
## ch_other 0.11905
## ch_framing 0.93385
## female 0.28444
## minority 0.30702
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Correlation of Fixed Effects:
## (Intr) s(1s=F intrs_ ch_who ch_hwd ch_mat ch_tim ch_thr ch_frm
## s(1,s=FALSE 0.028
## interest_c 0.015 -0.080
## ch_who -0.023 -0.003 0.001
## ch_howdo -0.056 0.000 -0.023 -0.114
## ch_mat -0.006 -0.013 -0.068 -0.132 -0.236
## ch_time -0.047 -0.024 0.002 -0.143 -0.148 -0.104
## ch_other -0.084 -0.011 -0.028 0.002 0.030 0.045 0.024
## ch_framing -0.061 -0.020 -0.006 -0.063 -0.057 -0.052 -0.012 0.063
## female -0.468 0.089 -0.004 0.007 0.002 0.002 -0.010 -0.016 0.009
## minority -0.666 -0.087 -0.006 -0.009 0.000 -0.043 0.010 -0.008 -0.028
## female
## s(1,s=FALSE
## interest_c
## ch_who
## ch_howdo
## ch_mat
## ch_time
## ch_other
## ch_framing
## female
## minority -0.046
ranova(M22, ddf="Kenward-Roger")
## ANOVA-like table for random-effects: Single term deletions
##
## Model:
## posaffect ~ scale(interesfun1, scale = FALSE) + interest_c +
## ch_who + ch_howdo + ch_mat + ch_time + ch_other + ch_framing +
## female + minority + (1 | stud_ID) + (1 | teacher_ID1) + (1 |
## beep_id)
## npar logLik AIC LRT Df Pr(>Chisq)
## <none> 15 -3768.8 7567.5
## (1 | stud_ID) 14 -4498.8 9025.5 1459.98 1 <2e-16 ***
## (1 | teacher_ID1) 14 -3768.8 7565.5 0.00 1 1.0000
## (1 | beep_id) 14 -3769.7 7567.3 1.81 1 0.1783
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
sjstats::icc(M22)
##
## Linear mixed model
## Family: gaussian (identity)
## Formula: posaffect ~ scale(interesfun1, scale = FALSE) + interest_c + ch_who + ch_howdo + ch_mat + ch_time + ch_other + ch_framing + female + minority + (1 | stud_ID) + (1 | teacher_ID1) + (1 | beep_id)
##
## ICC (beep_id): 0.005029
## ICC (stud_ID): 0.430392
## ICC (teacher_ID1): 0.000000
#sjPlot::sjp.int(M22, type = "eff")
M22r<-r2glmm::r2beta(M22, method = "nsj")
M22r
## Effect Rsq upper.CL lower.CL
## 1 Model 0.140 0.162 0.123
## 3 interest_c 0.095 0.113 0.078
## 2 scale(interesfun1, scale = FALSE) 0.012 0.019 0.006
## 10 female 0.002 0.006 0.000
## 11 minority 0.002 0.006 0.000
## 4 ch_who 0.001 0.005 0.000
## 8 ch_other 0.001 0.003 0.000
## 6 ch_mat 0.000 0.002 0.000
## 7 ch_time 0.000 0.002 0.000
## 5 ch_howdo 0.000 0.001 0.000
## 9 ch_framing 0.000 0.001 0.000
MuMIn::r.squaredGLMM(M22)
## R2m R2c
## [1,] 0.1403908 0.514683
#plot(M22r)
All choices predicting negative affect
M33<-lmer(negaffect ~ interest_fun_c +
interest_c +
ch_who +
ch_howdo +
ch_mat +
ch_time +
ch_other +
ch_framing +
female +
minority +
(1|stud_ID) + (1|teacher_ID1) + (1|beep_id), data = SciMo_All)
summary(M33, ddf="Kenward-Roger")
## Linear mixed model fit by REML. t-tests use Kenward-Roger's method [
## lmerModLmerTest]
## Formula: negaffect ~ interest_fun_c + interest_c + ch_who + ch_howdo +
## ch_mat + ch_time + ch_other + ch_framing + female + minority +
## (1 | stud_ID) + (1 | teacher_ID1) + (1 | beep_id)
## Data: SciMo_All
##
## REML criterion at convergence: 7647.6
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -2.5640 -0.5473 -0.1643 0.3689 4.7125
##
## Random effects:
## Groups Name Variance Std.Dev.
## beep_id (Intercept) 0.01365 0.1168
## stud_ID (Intercept) 0.19049 0.4364
## teacher_ID1 (Intercept) 0.02292 0.1514
## Residual 0.35614 0.5968
## Number of obs: 3856, groups: beep_id, 246; stud_ID, 231; teacher_ID1, 12
##
## Fixed effects:
## Estimate Std. Error df t value Pr(>|t|)
## (Intercept) 5.221e-01 7.481e-02 3.478e+01 6.979 4.20e-08 ***
## interest_fun_c -6.729e-02 4.005e-02 2.305e+02 -1.680 0.09429 .
## interest_c -7.474e-02 1.220e-02 3.653e+03 -6.126 9.97e-10 ***
## ch_who -3.940e-02 3.778e-02 3.170e+03 -1.043 0.29707
## ch_howdo 1.387e-02 3.114e-02 3.770e+03 0.445 0.65601
## ch_mat 3.009e-02 3.661e-02 3.781e+03 0.822 0.41126
## ch_time 6.587e-02 3.386e-02 3.790e+03 1.946 0.05177 .
## ch_other -5.940e-02 3.304e-02 3.839e+03 -1.798 0.07231 .
## ch_framing -5.935e-03 3.182e-02 3.826e+03 -0.187 0.85203
## female 1.865e-01 6.243e-02 2.224e+02 2.987 0.00313 **
## minority -5.106e-02 6.725e-02 2.267e+02 -0.759 0.44847
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Correlation of Fixed Effects:
## (Intr) intr__ intrs_ ch_who ch_hwd ch_mat ch_tim ch_thr ch_frm
## intrst_fn_c 0.005
## interest_c 0.016 -0.096
## ch_who -0.032 0.002 -0.001
## ch_howdo -0.051 -0.003 -0.022 -0.109
## ch_mat -0.009 -0.018 -0.060 -0.133 -0.229
## ch_time -0.047 -0.023 -0.006 -0.138 -0.148 -0.106
## ch_other -0.082 -0.013 -0.032 0.007 0.030 0.042 0.024
## ch_framing -0.060 -0.025 -0.008 -0.063 -0.058 -0.053 -0.013 0.061
## female -0.361 0.100 0.002 0.006 0.000 0.001 -0.014 -0.025 0.011
## minority -0.547 -0.053 -0.014 0.004 -0.002 -0.046 0.020 0.000 -0.029
## female
## intrst_fn_c
## interest_c
## ch_who
## ch_howdo
## ch_mat
## ch_time
## ch_other
## ch_framing
## female
## minority -0.048
ranova(M33, ddf="Kenward-Roger")
## ANOVA-like table for random-effects: Single term deletions
##
## Model:
## negaffect ~ interest_fun_c + interest_c + ch_who + ch_howdo +
## ch_mat + ch_time + ch_other + ch_framing + female + minority +
## (1 | stud_ID) + (1 | teacher_ID1) + (1 | beep_id)
## npar logLik AIC LRT Df Pr(>Chisq)
## <none> 15 -3823.8 7677.6
## (1 | stud_ID) 14 -4309.9 8647.8 972.21 1 < 2.2e-16 ***
## (1 | teacher_ID1) 14 -3827.4 7682.8 7.25 1 0.007102 **
## (1 | beep_id) 14 -3836.4 7700.8 25.19 1 5.207e-07 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
sjstats::icc(M33)
##
## Linear mixed model
## Family: gaussian (identity)
## Formula: negaffect ~ interest_fun_c + interest_c + ch_who + ch_howdo + ch_mat + ch_time + ch_other + ch_framing + female + minority + (1 | stud_ID) + (1 | teacher_ID1) + (1 | beep_id)
##
## ICC (beep_id): 0.023405
## ICC (stud_ID): 0.326624
## ICC (teacher_ID1): 0.039301
#sjPlot::sjp.int(M33, type = "eff")
M33r<-r2glmm::r2beta(M33, method = "nsj")
M33r
## Effect Rsq upper.CL lower.CL
## 1 Model 0.037 0.052 0.029
## 10 female 0.014 0.023 0.008
## 3 interest_c 0.009 0.016 0.004
## 2 interest_fun_c 0.005 0.010 0.001
## 11 minority 0.001 0.004 0.000
## 8 ch_other 0.001 0.004 0.000
## 7 ch_time 0.001 0.004 0.000
## 4 ch_who 0.000 0.002 0.000
## 6 ch_mat 0.000 0.002 0.000
## 5 ch_howdo 0.000 0.001 0.000
## 9 ch_framing 0.000 0.001 0.000
MuMIn::r.squaredGLMM(M33)
## R2m R2c
## [1,] 0.0373937 0.4121658
#plot(M33r)
All choices predicting learning
M44<-lmer(learning ~ scale(interesfun1, scale=FALSE) +
interest_c +
ch_who +
ch_howdo +
ch_mat +
ch_time +
ch_other +
ch_framing +
female +
minority +
(1|stud_ID) + (1|teacher_ID1) + (1|beep_id), data = SciMo_All)
summary(M44, ddf="Kenward-Roger")
## Linear mixed model fit by REML. t-tests use Kenward-Roger's method [
## lmerModLmerTest]
## Formula:
## learning ~ scale(interesfun1, scale = FALSE) + interest_c + ch_who +
## ch_howdo + ch_mat + ch_time + ch_other + ch_framing + female +
## minority + (1 | stud_ID) + (1 | teacher_ID1) + (1 | beep_id)
## Data: SciMo_All
##
## REML criterion at convergence: 9273.4
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -3.6543 -0.6133 0.0360 0.6537 3.0523
##
## Random effects:
## Groups Name Variance Std.Dev.
## beep_id (Intercept) 0.03261 0.1806
## stud_ID (Intercept) 0.11154 0.3340
## teacher_ID1 (Intercept) 0.01627 0.1276
## Residual 0.56621 0.7525
## Number of obs: 3852, groups: beep_id, 246; stud_ID, 231; teacher_ID1, 12
##
## Fixed effects:
## Estimate Std. Error df t value
## (Intercept) 1.74575 0.06395 34.27754 27.299
## scale(interesfun1, scale = FALSE) 0.16417 0.03358 232.42143 4.889
## interest_c 0.38982 0.01511 3680.52987 25.790
## ch_who -0.04319 0.04749 3443.45517 -0.909
## ch_howdo 0.03290 0.03859 3796.66108 0.853
## ch_mat 0.03229 0.04550 3806.43100 0.710
## ch_time -0.02583 0.04202 3832.29698 -0.615
## ch_other 0.07047 0.04028 3458.35730 1.749
## ch_framing 0.01366 0.03898 3641.40146 0.350
## female 0.01206 0.05207 221.71350 0.232
## minority -0.13448 0.05608 225.81177 -2.398
## Pr(>|t|)
## (Intercept) < 2e-16 ***
## scale(interesfun1, scale = FALSE) 1.89e-06 ***
## interest_c < 2e-16 ***
## ch_who 0.3632
## ch_howdo 0.3939
## ch_mat 0.4780
## ch_time 0.5388
## ch_other 0.0803 .
## ch_framing 0.7261
## female 0.8170
## minority 0.0173 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Correlation of Fixed Effects:
## (Intr) s(1s=F intrs_ ch_who ch_hwd ch_mat ch_tim ch_thr ch_frm
## s(1,s=FALSE 0.005
## interest_c 0.027 -0.142
## ch_who -0.050 0.003 -0.001
## ch_howdo -0.070 -0.002 -0.027 -0.113
## ch_mat -0.012 -0.028 -0.054 -0.134 -0.232
## ch_time -0.068 -0.031 -0.010 -0.139 -0.160 -0.108
## ch_other -0.118 -0.018 -0.040 0.012 0.029 0.040 0.024
## ch_framing -0.082 -0.034 -0.014 -0.057 -0.073 -0.061 -0.023 0.055
## female -0.349 0.108 0.004 0.008 -0.002 0.001 -0.020 -0.035 0.018
## minority -0.528 -0.050 -0.025 0.007 -0.004 -0.065 0.032 0.001 -0.044
## female
## s(1,s=FALSE
## interest_c
## ch_who
## ch_howdo
## ch_mat
## ch_time
## ch_other
## ch_framing
## female
## minority -0.050
ranova(M44, ddf="Kenward-Roger")
## ANOVA-like table for random-effects: Single term deletions
##
## Model:
## learning ~ scale(interesfun1, scale = FALSE) + interest_c + ch_who +
## ch_howdo + ch_mat + ch_time + ch_other + ch_framing + female +
## minority + (1 | stud_ID) + (1 | teacher_ID1) + (1 | beep_id)
## npar logLik AIC LRT Df Pr(>Chisq)
## <none> 15 -4636.7 9303.4
## (1 | stud_ID) 14 -4792.4 9612.7 311.317 1 < 2.2e-16 ***
## (1 | teacher_ID1) 14 -4639.2 9306.4 4.993 1 0.02546 *
## (1 | beep_id) 14 -4663.0 9354.0 52.585 1 4.12e-13 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
sjstats::icc(M44)
##
## Linear mixed model
## Family: gaussian (identity)
## Formula: learning ~ scale(interesfun1, scale = FALSE) + interest_c + ch_who + ch_howdo + ch_mat + ch_time + ch_other + ch_framing + female + minority + (1 | stud_ID) + (1 | teacher_ID1) + (1 | beep_id)
##
## ICC (beep_id): 0.044876
## ICC (stud_ID): 0.153507
## ICC (teacher_ID1): 0.022390
#sjPlot::sjp.int(M44, type = "eff")
M44r<-r2glmm::r2beta(M44, method = "nsj")
M44r
## Effect Rsq upper.CL lower.CL
## 1 Model 0.216 0.239 0.196
## 3 interest_c 0.163 0.184 0.143
## 2 scale(interesfun1, scale = FALSE) 0.021 0.031 0.013
## 11 minority 0.006 0.011 0.002
## 8 ch_other 0.001 0.004 0.000
## 4 ch_who 0.000 0.002 0.000
## 5 ch_howdo 0.000 0.002 0.000
## 6 ch_mat 0.000 0.002 0.000
## 7 ch_time 0.000 0.002 0.000
## 10 female 0.000 0.002 0.000
## 9 ch_framing 0.000 0.001 0.000
MuMIn::r.squaredGLMM(M44)
## R2m R2c
## [1,] 0.2156913 0.3888457
#plot(M44r)
Correlation Function
#correlation table function
corstarsl <- function(x) {
require(Hmisc)
x <- as.matrix(x)
R <- rcorr(x)$r
p <- rcorr(x)$P
## define notions for significance levels; spacing is important.
mystars <- ifelse(p < .001, "***", ifelse(p < .01, "** ", ifelse(p < .05, "* ", " ")))
## trunctuate the matrix that holds the correlations to two decimal
R <- format(round(cbind(rep(-1.11, ncol(x)), R), 2))[,-1]
## build a new matrix that includes the correlations with their apropriate stars
Rnew <- matrix(paste(R, mystars, sep=""), ncol=ncol(x))
diag(Rnew) <- paste(diag(R), " ", sep="")
rownames(Rnew) <- colnames(x)
colnames(Rnew) <- paste(colnames(x), "", sep="")
## remove upper triangle
Rnew <- as.matrix(Rnew)
Rnew[upper.tri(Rnew, diag = TRUE)] <- ""
Rnew <- as.data.frame(Rnew)
## remove last column and return the matrix (which is now a data frame)
Rnew <- cbind(Rnew[1:length(Rnew)-1])
return(Rnew)
}
Correlations
Scimo_All_Corr <- select(SciMo_All, engagement_three, learning, posaffect, negaffect, interesfun1, interest, anychoice, ch_framing, ch_mat, ch_time, ch_who, ch_howdo, ch_other)
corstarsl(Scimo_All_Corr)
## Loading required package: Hmisc
## Loading required package: lattice
## Loading required package: survival
## Loading required package: Formula
##
## Attaching package: 'Hmisc'
## The following object is masked from 'package:sjstats':
##
## deff
## The following objects are masked from 'package:dplyr':
##
## src, summarize
## The following objects are masked from 'package:base':
##
## format.pval, units
## engagement_three learning posaffect negaffect interesfun1
## engagement_three
## learning 0.64***
## posaffect 0.44*** 0.34***
## negaffect -0.13*** -0.12*** -0.07***
## interesfun1 0.28*** 0.23*** 0.20*** -0.11***
## interest 0.59*** 0.49*** 0.39*** -0.12*** 0.25***
## anychoice 0.09*** 0.05** 0.08*** -0.02 0.10***
## ch_framing 0.07*** 0.02 0.03 0.00 0.09***
## ch_mat 0.10*** 0.04** 0.05** 0.00 0.10***
## ch_time 0.08*** 0.01 -0.01 0.03 0.09***
## ch_who 0.02 -0.03 0.05** 0.01 0.05**
## ch_howdo 0.08*** 0.04** 0.04* 0.02 0.06***
## ch_other 0.01 0.03 0.09*** -0.01 0.03
## interest anychoice ch_framing ch_mat ch_time ch_who
## engagement_three
## learning
## posaffect
## negaffect
## interesfun1
## interest
## anychoice 0.09***
## ch_framing 0.07*** 0.43***
## ch_mat 0.11*** 0.37*** 0.22***
## ch_time 0.04* 0.38*** 0.16*** 0.23***
## ch_who 0.02 0.33*** 0.15*** 0.26*** 0.27***
## ch_howdo 0.07*** 0.46*** 0.23*** 0.38*** 0.32*** 0.27***
## ch_other 0.05** 0.40*** -0.05** -0.04** -0.04** -0.03
## ch_howdo
## engagement_three
## learning
## posaffect
## negaffect
## interesfun1
## interest
## anychoice
## ch_framing
## ch_mat
## ch_time
## ch_who
## ch_howdo
## ch_other -0.06***
interest_corr <- select(SciMo_student_survey, interesfun1, notinterest1r)
corstarsl(interest_corr)
## interesfun1
## interesfun1
## notinterest1r 0.48***
reliability for interest
library(psy)
##
## Attaching package: 'psy'
## The following object is masked from 'package:sjstats':
##
## icc
interest_reliability <- select(SciMo_student_survey, interesfun1, notinterest1r)
cronbach(interest_reliability)
## $sample.size
## [1] 231
##
## $number.of.items
## [1] 2
##
## $alpha
## [1] 0.635647
Descriptives
psych::describe(SciMo_esm$engagement_three)
## vars n mean sd median trimmed mad min max range skew kurtosis
## X1 1 4105 1.64 0.8 1.67 1.67 0.99 0 3 3 -0.24 -0.58
## se
## X1 0.01
psych::describe(SciMo_esm$posaffect)
## vars n mean sd median trimmed mad min max range skew kurtosis
## X1 1 4086 1.06 0.86 1 0.98 0.99 0 3 3 0.62 -0.58
## se
## X1 0.01
psych::describe(SciMo_esm$negaffect)
## vars n mean sd median trimmed mad min max range skew kurtosis
## X1 1 4080 0.57 0.76 0.33 0.42 0.49 0 3 3 1.44 1.35
## se
## X1 0.01
psych::describe(SciMo_esm$learning)
## vars n mean sd median trimmed mad min max range skew kurtosis
## X1 1 4085 1.69 0.98 2 1.74 1.48 0 3 3 -0.27 -0.93
## se
## X1 0.02
psych::describe(SciMo_esm$interest)
## vars n mean sd median trimmed mad min max range skew kurtosis
## X1 1 3985 1.23 0.97 1 1.16 1.48 0 3 3 0.27 -0.95
## se
## X1 0.02
psych::describe(SciMo_esm$anychoice)
## vars n mean sd median trimmed mad min max range skew kurtosis se
## X1 1 4135 0.55 0.5 1 0.56 0 0 1 1 -0.19 -1.96 0.01
psych::describe(SciMo_esm$ch_framing)
## vars n mean sd median trimmed mad min max range skew kurtosis se
## X1 1 4135 0.18 0.39 0 0.11 0 0 1 1 1.62 0.64 0.01
psych::describe(SciMo_esm$ch_mat)
## vars n mean sd median trimmed mad min max range skew kurtosis se
## X1 1 4135 0.14 0.35 0 0.05 0 0 1 1 2.07 2.29 0.01
psych::describe(SciMo_esm$ch_time)
## vars n mean sd median trimmed mad min max range skew kurtosis se
## X1 1 4135 0.15 0.36 0 0.06 0 0 1 1 1.96 1.83 0.01
psych::describe(SciMo_esm$ch_who)
## vars n mean sd median trimmed mad min max range skew kurtosis se
## X1 1 4135 0.11 0.32 0 0.02 0 0 1 1 2.42 3.87 0
psych::describe(SciMo_esm$ch_howdo)
## vars n mean sd median trimmed mad min max range skew kurtosis se
## X1 1 4135 0.2 0.4 0 0.13 0 0 1 1 1.48 0.2 0.01
psych::describe(SciMo_esm$ch_other)
## vars n mean sd median trimmed mad min max range skew kurtosis se
## X1 1 4135 0.17 0.37 0 0.08 0 0 1 1 1.8 1.24 0.01
psych::describe(SciMo_student_survey$interesfun1)
## vars n mean sd median trimmed mad min max range skew kurtosis se
## X1 1 232 2.67 0.81 3 2.7 0 1 4 3 -0.37 -0.29 0.05
psych::describe(scale(SciMo_student_survey$interesfun1, center=TRUE, scale=FALSE))
## vars n mean sd median trimmed mad min max range skew kurtosis
## X1 1 232 0 0.81 0.33 0.03 0 -1.67 1.33 3 -0.37 -0.29
## se
## X1 0.05
table(SciMo_esm$ch_who)
##
## 0 1
## 3662 473
table(SciMo_esm$ch_mat)
##
## 0 1
## 3555 580
table(SciMo_esm$ch_time)
##
## 0 1
## 3514 621
table(SciMo_esm$ch_howdo)
##
## 0 1
## 3300 835
table(SciMo_esm$ch_other)
##
## 0 1
## 3451 684
table(SciMo_esm$ch_framing)
##
## 0 1
## 3371 764
table(SciMo_esm$ch_doing)
##
## 0 1
## 3778 357
table(SciMo_esm$ch_defin)
##
## 0 1
## 3773 362
table(SciMo_esm$ch_topic)
##
## 0 1
## 3902 233
table(SciMo_esm$ch_none)
##
## 0 1
## 2267 1868
table(SciMo_esm$anychoice)
##
## 0 1
## 1868 2267