Preparation

data<-read.csv("/Users/samanthabouwmeester/Documents/Out of the Box Plot/CWTL/Copy of RCT_data_full.csv")

### Changes in Copy of RCT_data_full.csv that are already processed in datacleaning file but note that column names and attendance data differ in Copy of RCT_data_full.csv and the file that results after the cleaning... ####
data$read_2[data$index==262]=data$read_1[data$index==262] 
data$read_2[data$index==4]=data$read_1[data$index==4] 
data$read_2[data$index==5]=data$read_1[data$index==5] 
data$read_2[data$index==7]=data$read_1[data$index==7] 
data$read_2[data$index==8]=data$read_1[data$index==8] 

data$Attendance<-rowSums(data[,which(substring(colnames(data),1,4)=="week")],na.rm = TRUE)
data$Attendance_dich=1
data$Attendance_dich[data$Attendance<21*5*.8]=0

## Missings values were imputed using mice ####

#baseline math
bas.num<-data[,c("total_nid","total_qds","total_mis","total_add","total_sub","total_prb")]

#Are there any missings values?
any(is.na(rowSums(bas.num))) # FALSE, so no missing values
## [1] FALSE
#baseline literacy
bas.lit<-data[,c("total_lid","total_pho","total_muw","total_non","total_com","total_lis","total_wrt","read_1","read_2")]
bas.lit$read_2[is.na(bas.lit$read_2)]=bas.lit$read_1[is.na(bas.lit$read_2)]
bas.lit$read_1[is.na(bas.lit$read_1)]=0 #One Na in read1 has to be 0.

# Are there any missings values?
any(is.na(rowSums(bas.lit))) # FALSE, so no missing values
## [1] FALSE
#endline math
end.num<-data[,c("total_nid_end","total_qds_end","total_mis_end","total_add_end","total_sub_end","total_prb_end")]

# Are there any missings values?
any(is.na(rowSums(end.num))) # TRUE, so missing values: multiple imputation
## [1] TRUE
mis.number=rep(NA,6)
for(i in 1:ncol(end.num))
mis.number[i]=length(which(is.na(end.num[,i])))

mis.number
## [1] 69 69 69 69 69 69
# 69 participants miss the endline data for numericy all tasks. This is 69/1507=.046, 4.6%
# These endline scores were imputed.

library(mice)
scores.mice<-mice(end.num,print=FALSE)
end.num.MI<-complete(scores.mice)

data[,c("total_nid_end","total_qds_end","total_mis_end","total_add_end","total_sub_end","total_prb_end")]=end.num.MI


#check
end.num<-data[,c("total_nid_end","total_qds_end","total_mis_end","total_add_end","total_sub_end","total_prb_end")]
any(is.na(rowSums(end.num))) # FALSE: no missings anymore
## [1] FALSE
### total scores in percentages
totals.num_perc_bas<-data.frame(data$total_nid/15,
                            data$total_qds/10,
                            data$total_mis/10,
                            data$total_add/25,
                            data$total_sub/25,
                            data$total_prb/6)


totals.num_perc_end<-data.frame(data$total_nid_end/15,
                            data$total_qds_end/10,
                            data$total_mis_end/10,
                            data$total_add_end/25,
                            data$total_sub_end/25,
                            data$total_prb_end/6)


end.num$tot.num_end<-rowSums(totals.num_perc_end)/6.  #divided by 6 to get scores between 0 and 1

bas.num$tot.num<-rowSums(totals.num_perc_bas)/6. #divided by 6 to get scores between 0 and 1


#endline literacy
end.lit<-data[,c("total_lid_end","total_pho_end","total_muw_end","total_non_end","total_com_end","total_lis_end","total_wrt_end","RCP1_end",
                 "RCP2_end")]


# Are there any missings values?
any(is.na(rowSums(end.lit)))
## [1] TRUE
# TRUE, so missing values: multiple imputation

mis.lit=rep(NA,9)
for(i in 1:ncol(end.lit))
  mis.lit[i]=length(which(is.na(end.lit[,i])))

mis.lit
## [1]  69  69  69  69 416  69  69  69 416
# 69 participants miss the endline data for literacy all tasks. This is 69/1507=.046, 4.6%
# Task total_com and Read_2 has 416 missings values, this is 416/1507=.276, 27.6%
# These endline scores were imputed.

scores.mice<-mice(end.lit,print=FALSE)
end.lit.MI<-complete(scores.mice)

data[,c("total_lid_end","total_pho_end","total_muw_end","total_non_end","total_com_end","total_lis_end","total_wrt_end","RCP1_end","RCP2_end")]=end.lit.MI


#check
end.lit<-data[,c("total_lid_end","total_pho_end","total_muw_end","total_non_end","total_com_end","total_lis_end","total_wrt_end"
                 ,"RCP1_end","RCP2_end")]
any(is.na(rowSums(end.lit))) # FALSE: no missings anymore
## [1] FALSE
### Add total literacy score as a percentage note that READ_2 is not included 

totals.lit_perc_bas<-data.frame(data$total_lid/26,
                            data$total_pho/10,
                            data$total_muw/20,
                            data$total_non/16,
                            data$total_com/5,
                            data$total_lis/5,
                            data$total_wrt/10,
                            data$read_1/99)



totals.lit_perc_end<-data.frame(data$total_lid_end/26,
                            data$total_pho_end/10,
                            data$total_muw_end/20,
                            data$total_non_end/16,
                            data$total_com_end/5,
                            data$total_lis_end/5,
                            data$total_wrt_end/10,
                            data$RCP1_end/99)




end.lit$tot.lit_end<-rowSums(totals.lit_perc_end)/8

bas.lit$tot.lit<-rowSums(totals.lit_perc_bas)/8




### Add total wellbeing score
wellbeing<-data[,which(substring(colnames(data),1,4)=="SCWS")]
                     
for(i in 1:ncol(wellbeing)){
  wellbeing[,i][wellbeing[,i]=="Never"]=0
  wellbeing[,i][wellbeing[,i]=="Not much of the time"]=1
  wellbeing[,i][wellbeing[,i]=="Some of the time"]=2
  wellbeing[,i][wellbeing[,i]=="Quite a lot of the time"]=3
   wellbeing[,i][wellbeing[,i]=="All of the time"]=4
   wellbeing[,i][wellbeing[,i]=="Refused to answer"]=NA
}

wellbeing<-apply(wellbeing,2,as.numeric)
scores.mice<-mice(wellbeing,print=FALSE)
wellbeing<-complete(scores.mice)
wb.bas<-cbind(data[,c(2:4,620)],wellbeing[,1:12])
wb.end<-cbind(wb.bas[,1:4],wellbeing[,13:24])
colnames(wb.end)<-colnames(wb.bas)

WB.long<-rbind(wb.bas,wb.end)
#head(WB.long)
WB.long$totaal<-rowSums(WB.long[,5:16])

Results Assesments

Long datafile

### Creating a Long datafile ###.  

baseline<-cbind(data$participantID,data$GenderChild,data$School,data$Group,data$Attendance,data$Attendance_dich,bas.num,bas.lit)
colnames(baseline)<-c("participantID","GenderChild","School" ,"Group"  ,         "Attendance" ,     "Attendance_dich",colnames(baseline[7:23]))
endline<-cbind(baseline[,1:6],end.num,end.lit)
colnames(endline)=colnames(baseline)

longdata<-rbind(baseline,endline)
longdata<-longdata[order(longdata$participantID),]
longdata$WB_total<-WB.long$totaal
longdata$time<-rep(c("baseline","endline"),nrow(baseline))

# save longdata
write.csv(longdata,"longdata.csv")

Descriptives

dm<-t(descriptives_Num)
colnames(dm)<-c("Baseline A","Endline A","Baseline B","Endline B")
data.table(dm[-c(1,2),],keep.rownames=TRUE)
##                 rn Baseline A Endline A Baseline B Endline B
##  1: mean total_nid      12.25     14.13      12.17     13.72
##  2:   sd total_nid       2.90      1.62       2.95      2.15
##  3: mean total_qds       8.29      9.45       8.25      9.04
##  4:   sd total_qds       2.05      1.08       2.14      1.55
##  5: mean total_mis       5.82      7.70       5.27      6.99
##  6:   sd total_mis       2.81      2.14       2.94      2.66
##  7: mean total_add       6.97      9.91       5.83      8.25
##  8:   sd total_add       4.10      4.23       3.70      4.30
##  9: mean total_sub       4.63      7.26       3.97      5.44
## 10:   sd total_sub       3.66      3.96       2.91      3.44
## 11: mean total_prb       3.51      4.75       3.44      4.39
## 12:   sd total_prb       1.92      1.37       1.89      1.62
## 13:   mean tot.num       0.55      0.69       0.52      0.63
## 14:     sd tot.num       0.16      0.12       0.16      0.14
dl<-t(descriptives_Lit)
colnames(dl)<-c("Baseline A","Endline A","Baseline B","Endline B")
data.table(dl[-c(1,2),],keep.rownames=TRUE)
##                 rn Baseline A Endline A Baseline B Endline B
##  1: mean total_lid      19.39     23.69      20.41     23.15
##  2:   sd total_lid       8.14      4.41       7.19      4.90
##  3: mean total_pho       3.71      6.73       2.16      2.88
##  4:   sd total_pho       3.51      3.09       2.83      3.15
##  5: mean total_muw       8.37     13.76       7.46     12.14
##  6:   sd total_muw       6.91      6.29       6.54      6.97
##  7: mean total_non       3.73      7.91       2.81      5.71
##  8:   sd total_non       4.72      5.33       4.15      5.29
##  9: mean total_com       0.80      1.76       0.60      1.59
## 10:   sd total_com       1.27      1.51       1.09      1.47
## 11: mean total_lis       0.86      1.48       0.64      1.21
## 12:   sd total_lis       1.26      1.41       1.04      1.33
## 13: mean total_wrt       3.06      4.76       2.51      4.55
## 14:   sd total_wrt       2.92      3.28       2.73      3.31
## 15:    mean read_1      13.72     29.69      10.32     23.80
## 16:      sd read_1      15.90     22.99      13.31     20.61
## 17:    mean read_2      28.22     60.46      23.63     52.62
## 18:      sd read_2      31.68     28.47      30.39     29.33
## 19:   mean tot.lit       0.32      0.52       0.27      0.42
## 20:     sd tot.lit       0.20      0.22       0.18      0.22

Multilevel Analyses

nid

tab_model(fit_nid,fit_nid1,show.se=TRUE,show.ci = FALSE)
  total_nid total_nid
Predictors Estimates std. Error p Estimates std. Error p
(Intercept) 11.13 0.26 <0.001 11.10 0.27 <0.001
GenderChild [Male] 0.27 0.13 0.031 0.27 0.13 0.033
time [endline] 1.83 0.25 <0.001 1.71 0.25 <0.001
Attendance 0.01 0.00 <0.001 0.01 0.00 <0.001
GenderChild [Male] × time
[endline]
-0.25 0.13 0.051 -0.24 0.13 0.066
time [endline] ×
Attendance
0.00 0.00 0.954 -0.00 0.00 0.890
Group [1] 0.05 0.18 0.782
time [endline] × Group
[1]
0.32 0.13 0.015
Random Effects
σ2 3.21 3.20
τ00 2.72 participantID:School 2.72 participantID:School
0.13 School 0.12 School
ICC 0.47 0.47
N 1507 participantID 1507 participantID
30 School 30 School
Observations 3014 3014
Marginal R2 / Conditional R2 0.119 / 0.533 0.121 / 0.535
plot(colnames(dat)[10])

qds

tab_model(fit_qds,fit_qds1,show.se=TRUE,show.ci = FALSE)
  total_qds total_qds
Predictors Estimates std. Error p Estimates std. Error p
(Intercept) 7.86 0.19 <0.001 7.84 0.19 <0.001
GenderChild [Male] -0.01 0.09 0.944 -0.01 0.09 0.906
time [endline] 0.73 0.20 <0.001 0.59 0.20 0.004
Attendance 0.01 0.00 0.013 0.01 0.00 0.011
GenderChild [Male] × time
[endline]
-0.14 0.10 0.171 -0.13 0.10 0.224
time [endline] ×
Attendance
0.00 0.00 0.085 0.00 0.00 0.148
Group [1] 0.01 0.13 0.927
time [endline] × Group
[1]
0.36 0.10 0.001
Random Effects
σ2 2.05 2.04
τ00 0.98 participantID:School 0.98 participantID:School
0.06 School 0.06 School
ICC 0.34 0.34
N 1507 participantID 1507 participantID
30 School 30 School
Observations 3014 3014
Marginal R2 / Conditional R2 0.080 / 0.389 0.085 / 0.394
plot(colnames(dat)[11])

mis

tab_model(fit_mis,fit_mis1,show.se=TRUE,show.ci = FALSE)
  total_mis total_mis
Predictors Estimates std. Error p Estimates std. Error p
(Intercept) 4.27 0.29 <0.001 4.04 0.30 <0.001
GenderChild [Male] 0.25 0.13 0.065 0.25 0.13 0.060
time [endline] 1.64 0.26 <0.001 1.59 0.27 <0.001
Attendance 0.02 0.00 <0.001 0.02 0.00 <0.001
GenderChild [Male] × time
[endline]
-0.34 0.14 0.013 -0.34 0.14 0.015
time [endline] ×
Attendance
0.00 0.00 0.169 0.00 0.00 0.196
Group [1] 0.51 0.22 0.018
time [endline] × Group
[1]
0.13 0.14 0.349
Random Effects
σ2 3.56 3.56
τ00 3.19 participantID:School 3.19 participantID:School
0.29 School 0.21 School
ICC 0.49 0.49
N 1507 participantID 1507 participantID
30 School 30 School
Observations 3014 3014
Marginal R2 / Conditional R2 0.120 / 0.555 0.131 / 0.556
plot(colnames(dat)[12])

add

tab_model(fit_add,fit_add1,show.se=TRUE,show.ci = FALSE)
  total_add total_add
Predictors Estimates std. Error p Estimates std. Error p
(Intercept) 4.68 0.44 <0.001 4.28 0.43 <0.001
GenderChild [Male] 0.22 0.21 0.295 0.22 0.21 0.288
time [endline] 1.59 0.46 0.001 1.43 0.47 0.002
Attendance 0.02 0.01 <0.001 0.02 0.01 <0.001
GenderChild [Male] × time
[endline]
-0.60 0.24 0.013 -0.58 0.24 0.016
time [endline] ×
Attendance
0.02 0.01 0.001 0.02 0.01 0.002
Group [1] 1.09 0.26 <0.001
time [endline] × Group
[1]
0.43 0.24 0.075
Random Effects
σ2 10.86 10.84
τ00 5.35 participantID:School 5.36 participantID:School
0.61 School 0.18 School
ICC 0.35 0.34
N 1507 participantID 1507 participantID
30 School 30 School
Observations 3014 3014
Marginal R2 / Conditional R2 0.119 / 0.431 0.142 / 0.432
plot(colnames(dat)[13])

sub

tab_model(fit_sub,fit_sub1,show.se=TRUE,show.ci = FALSE)
  total_sub total_sub
Predictors Estimates std. Error p Estimates std. Error p
(Intercept) 3.23 0.39 <0.001 3.01 0.37 <0.001
GenderChild [Male] 0.26 0.18 0.153 0.24 0.18 0.186
time [endline] 1.23 0.41 0.003 0.80 0.41 0.052
Attendance 0.01 0.00 0.006 0.01 0.00 0.010
GenderChild [Male] × time
[endline]
0.07 0.21 0.737 0.12 0.21 0.560
time [endline] ×
Attendance
0.01 0.01 0.039 0.01 0.01 0.101
Group [1] 0.64 0.22 0.004
time [endline] × Group
[1]
1.13 0.21 <0.001
Random Effects
σ2 8.53 8.38
τ00 3.67 participantID:School 3.75 participantID:School
0.50 School 0.12 School
ICC 0.33 0.32
N 1507 participantID 1507 participantID
30 School 30 School
Observations 3014 3014
Marginal R2 / Conditional R2 0.088 / 0.387 0.119 / 0.398
plot(colnames(dat)[14])

prb

tab_model(fit_prb,fit_prb1,show.se=TRUE,show.ci = FALSE)
  total_prb total_prb
Predictors Estimates std. Error p Estimates std. Error p
(Intercept) 3.00 0.19 <0.001 2.95 0.20 <0.001
GenderChild [Male] 0.19 0.09 0.027 0.19 0.09 0.031
time [endline] 1.23 0.20 <0.001 1.13 0.20 <0.001
Attendance 0.01 0.00 0.021 0.01 0.00 0.017
GenderChild [Male] × time
[endline]
-0.24 0.10 0.019 -0.23 0.10 0.026
time [endline] ×
Attendance
-0.00 0.00 0.956 -0.00 0.00 0.788
Group [1] 0.06 0.16 0.694
time [endline] × Group
[1]
0.27 0.10 0.008
Random Effects
σ2 2.01 2.01
τ00 0.80 participantID:School 0.80 participantID:School
0.15 School 0.14 School
ICC 0.32 0.32
N 1507 participantID 1507 participantID
30 School 30 School
Observations 3014 3014
Marginal R2 / Conditional R2 0.097 / 0.385 0.102 / 0.389
plot(colnames(dat)[15])

total math

tab_model(fit_nu,fit_nu1,show.se=TRUE,show.ci = FALSE)
  tot.num tot.num
Predictors Estimates std. Error p Estimates std. Error p
(Intercept) 0.46 0.02 <0.001 0.45 0.02 <0.001
GenderChild [Male] 0.02 0.01 0.033 0.02 0.01 0.033
time [endline] 0.11 0.01 <0.001 0.10 0.01 <0.001
Attendance 0.00 0.00 <0.001 0.00 0.00 <0.001
GenderChild [Male] × time
[endline]
-0.02 0.01 0.001 -0.02 0.01 0.002
time [endline] ×
Attendance
0.00 0.00 0.030 0.00 0.00 0.070
Group [1] 0.02 0.01 0.048
time [endline] × Group
[1]
0.03 0.01 <0.001
Random Effects
σ2 0.01 0.01
τ00 0.01 participantID:School 0.01 participantID:School
0.00 School 0.00 School
ICC 0.61 0.61
N 1507 participantID 1507 participantID
30 School 30 School
Observations 3014 3014
Marginal R2 / Conditional R2 0.180 / 0.682 0.196 / 0.687
plot(colnames(dat)[16])

lid

tab_model(fit_lid,fit_lid1,show.se=TRUE,show.ci = FALSE)
  total_lid total_lid
Predictors Estimates std. Error p Estimates std. Error p
(Intercept) 17.83 0.72 <0.001 18.30 0.79 <0.001
GenderChild [Male] -0.16 0.32 0.621 -0.19 0.32 0.538
time [endline] 3.40 0.70 <0.001 2.81 0.71 <0.001
Attendance 0.03 0.01 <0.001 0.03 0.01 <0.001
GenderChild [Male] × time
[endline]
-0.38 0.37 0.299 -0.31 0.37 0.395
time [endline] ×
Attendance
0.00 0.01 0.626 0.00 0.01 0.881
Group [1] -1.13 0.72 0.115
time [endline] × Group
[1]
1.54 0.37 <0.001
Random Effects
σ2 25.36 25.08
τ00 11.84 participantID:School 11.98 participantID:School
3.00 School 3.09 School
ICC 0.37 0.38
N 1507 participantID 1507 participantID
30 School 30 School
Observations 3014 3014
Marginal R2 / Conditional R2 0.081 / 0.421 0.085 / 0.428
plot(colnames(dat)[17])

pho

tab_model(fit_pho,fit_pho1,show.se=TRUE,show.ci = FALSE)
  total_pho total_pho
Predictors Estimates std. Error p Estimates std. Error p
(Intercept) 3.08 0.45 <0.001 2.20 0.44 <0.001
GenderChild [Male] -0.29 0.15 0.055 -0.34 0.15 0.024
time [endline] -0.53 0.40 0.188 -1.37 0.39 0.001
Attendance 0.00 0.00 0.984 0.00 0.00 0.613
GenderChild [Male] × time
[endline]
-0.04 0.21 0.849 0.06 0.20 0.762
time [endline] ×
Attendance
0.03 0.01 <0.001 0.03 0.01 <0.001
Group [1] 1.53 0.47 0.001
time [endline] × Group
[1]
2.21 0.20 <0.001
Random Effects
σ2 8.24 7.64
τ00 0.42 participantID:School 0.73 participantID:School
3.23 School 1.50 School
ICC 0.31 0.23
N 1507 participantID 1507 participantID
30 School 30 School
Observations 3014 3014
Marginal R2 / Conditional R2 0.087 / 0.368 0.248 / 0.418
plot(colnames(dat)[18])

muw

tab_model(fit_muw,fit_muw1,show.se=TRUE,show.ci = FALSE)
  total_muw total_muw
Predictors Estimates std. Error p Estimates std. Error p
(Intercept) 4.16 0.74 <0.001 3.79 0.80 <0.001
GenderChild [Male] -0.78 0.33 0.018 -0.78 0.33 0.017
time [endline] 4.09 0.47 <0.001 3.84 0.48 <0.001
Attendance 0.06 0.01 <0.001 0.06 0.01 <0.001
GenderChild [Male] × time
[endline]
-0.14 0.25 0.575 -0.11 0.25 0.660
time [endline] ×
Attendance
0.01 0.01 0.020 0.01 0.01 0.034
Group [1] 0.70 0.69 0.312
time [endline] × Group
[1]
0.65 0.25 0.008
Random Effects
σ2 11.34 11.29
τ00 28.58 participantID:School 28.60 participantID:School
2.88 School 2.73 School
ICC 0.74 0.74
N 1507 participantID 1507 participantID
30 School 30 School
Observations 3014 3014
Marginal R2 / Conditional R2 0.162 / 0.778 0.169 / 0.780
plot(colnames(dat)[19])

non

tab_model(fit_non,fit_non1,show.se=TRUE,show.ci = FALSE)
  total_non total_non
Predictors Estimates std. Error p Estimates std. Error p
(Intercept) 1.73 0.54 0.001 1.31 0.55 0.017
GenderChild [Male] -0.01 0.25 0.983 -0.02 0.25 0.949
time [endline] 2.56 0.47 <0.001 2.10 0.48 <0.001
Attendance 0.02 0.01 0.001 0.02 0.01 0.001
GenderChild [Male] × time
[endline]
-0.43 0.25 0.079 -0.38 0.25 0.123
time [endline] ×
Attendance
0.02 0.01 0.006 0.01 0.01 0.018
Group [1] 0.85 0.38 0.025
time [endline] × Group
[1]
1.21 0.25 <0.001
Random Effects
σ2 11.48 11.30
τ00 11.71 participantID:School 11.80 participantID:School
1.15 School 0.63 School
ICC 0.53 0.52
N 1507 participantID 1507 participantID
30 School 30 School
Observations 3014 3014
Marginal R2 / Conditional R2 0.127 / 0.588 0.151 / 0.596
plot(colnames(dat)[20])

com

tab_model(fit_com,fit_com1,show.se=TRUE,show.ci = FALSE)
  total_com total_com
Predictors Estimates std. Error p Estimates std. Error p
(Intercept) 0.22 0.15 0.126 0.14 0.16 0.364
GenderChild [Male] -0.03 0.07 0.639 -0.03 0.07 0.667
time [endline] 0.80 0.14 <0.001 0.81 0.15 <0.001
Attendance 0.01 0.00 <0.001 0.01 0.00 <0.001
GenderChild [Male] × time
[endline]
-0.15 0.07 0.050 -0.15 0.07 0.047
time [endline] ×
Attendance
0.00 0.00 0.057 0.00 0.00 0.051
Group [1] 0.18 0.13 0.159
time [endline] × Group
[1]
-0.05 0.07 0.534
Random Effects
σ2 1.04 1.04
τ00 0.64 participantID:School 0.64 participantID:School
0.09 School 0.09 School
ICC 0.41 0.41
N 1507 participantID 1507 participantID
30 School 30 School
Observations 3014 3014
Marginal R2 / Conditional R2 0.133 / 0.492 0.137 / 0.493
plot(colnames(dat)[21])

lis

tab_model(fit_lis,fit_lis1,show.se=TRUE,show.ci = FALSE)
  total_lis total_lis
Predictors Estimates std. Error p Estimates std. Error p
(Intercept) 0.43 0.14 0.003 0.33 0.15 0.032
GenderChild [Male] -0.15 0.06 0.017 -0.15 0.06 0.018
time [endline] 0.37 0.13 0.005 0.36 0.14 0.009
Attendance 0.01 0.00 0.001 0.01 0.00 0.001
GenderChild [Male] × time
[endline]
0.06 0.07 0.415 0.06 0.07 0.399
time [endline] ×
Attendance
0.00 0.00 0.120 0.00 0.00 0.134
Group [1] 0.19 0.13 0.151
time [endline] × Group
[1]
0.05 0.07 0.517
Random Effects
σ2 0.92 0.92
τ00 0.56 participantID:School 0.56 participantID:School
0.11 School 0.11 School
ICC 0.42 0.42
N 1507 participantID 1507 participantID
30 School 30 School
Observations 3014 3014
Marginal R2 / Conditional R2 0.066 / 0.462 0.074 / 0.464
plot(colnames(dat)[22])

wrt

tab_model(fit_wrt,fit_wrt1,show.se=TRUE,show.ci = FALSE)
  total_wrt total_wrt
Predictors Estimates std. Error p Estimates std. Error p
(Intercept) 1.34 0.34 <0.001 1.14 0.37 0.002
GenderChild [Male] -0.49 0.15 0.001 -0.48 0.15 0.001
time [endline] 1.25 0.23 <0.001 1.40 0.24 <0.001
Attendance 0.02 0.00 <0.001 0.02 0.00 <0.001
GenderChild [Male] × time
[endline]
-0.17 0.12 0.158 -0.19 0.12 0.119
time [endline] ×
Attendance
0.01 0.00 0.001 0.01 0.00 <0.001
Group [1] 0.47 0.31 0.134
time [endline] × Group
[1]
-0.39 0.12 0.001
Random Effects
σ2 2.75 2.73
τ00 5.66 participantID:School 5.67 participantID:School
0.55 School 0.56 School
ICC 0.69 0.70
N 1507 participantID 1507 participantID
30 School 30 School
Observations 3014 3014
Marginal R2 / Conditional R2 0.127 / 0.732 0.130 / 0.735
plot(colnames(dat)[23])

read 1

tab_model(fit_read1,fit_read11,show.se=TRUE,show.ci = FALSE)
  read_1 read_1
Predictors Estimates std. Error p Estimates std. Error p
(Intercept) 5.07 2.09 0.015 3.52 2.25 0.117
GenderChild [Male] -1.42 0.92 0.121 -1.44 0.92 0.116
time [endline] 9.16 1.48 <0.001 8.38 1.51 <0.001
Attendance 0.11 0.03 <0.001 0.11 0.03 <0.001
GenderChild [Male] × time
[endline]
-2.69 0.77 0.001 -2.60 0.77 0.001
time [endline] ×
Attendance
0.10 0.02 <0.001 0.10 0.02 <0.001
Group [1] 3.00 1.93 0.120
time [endline] × Group
[1]
2.07 0.78 0.008
Random Effects
σ2 112.76 112.31
τ00 198.72 participantID:School 198.94 participantID:School
24.94 School 21.70 School
ICC 0.66 0.66
N 1507 participantID 1507 participantID
30 School 30 School
Observations 3014 3014
Marginal R2 / Conditional R2 0.167 / 0.721 0.180 / 0.723
plot(colnames(dat)[24])

read 2

tab_model(fit_read2,fit_read21,show.se=TRUE,show.ci = FALSE)
  read_2 read_2
Predictors Estimates std. Error p Estimates std. Error p
(Intercept) 10.92 3.28 0.001 8.98 3.47 0.010
GenderChild [Male] -2.43 1.50 0.105 -2.44 1.50 0.103
time [endline] 27.63 2.43 <0.001 26.48 2.48 <0.001
Attendance 0.23 0.04 <0.001 0.24 0.04 <0.001
GenderChild [Male] × time
[endline]
-1.49 1.27 0.240 -1.35 1.27 0.287
time [endline] ×
Attendance
0.05 0.03 0.097 0.05 0.03 0.143
Group [1] 3.77 2.71 0.164
time [endline] × Group
[1]
3.03 1.27 0.017
Random Effects
σ2 304.22 303.28
τ00 528.59 participantID:School 529.04 participantID:School
43.61 School 38.27 School
ICC 0.65 0.65
N 1507 participantID 1507 participantID
30 School 30 School
Observations 3014 3014
Marginal R2 / Conditional R2 0.231 / 0.733 0.239 / 0.735
plot(colnames(dat)[25])

total literacy

tab_model(fit_tot.lit,fit_tot.lit1,show.se=TRUE,show.ci = FALSE)
  tot.lit tot.lit
Predictors Estimates std. Error p Estimates std. Error p
(Intercept) 0.20 0.02 <0.001 0.18 0.02 <0.001
GenderChild [Male] -0.02 0.01 0.031 -0.02 0.01 0.027
time [endline] 0.11 0.02 <0.001 0.09 0.02 <0.001
Attendance 0.00 0.00 <0.001 0.00 0.00 <0.001
GenderChild [Male] × time
[endline]
-0.01 0.01 0.083 -0.01 0.01 0.135
time [endline] ×
Attendance
0.00 0.00 <0.001 0.00 0.00 <0.001
Group [1] 0.04 0.02 0.034
time [endline] × Group
[1]
0.05 0.01 <0.001
Random Effects
σ2 0.01 0.01
τ00 0.03 participantID:School 0.03 participantID:School
0.00 School 0.00 School
ICC 0.70 0.70
N 1507 participantID 1507 participantID
30 School 30 School
Observations 3013 3013
Marginal R2 / Conditional R2 0.193 / 0.758 0.220 / 0.764
plot(colnames(dat)[26])

Wellbeing

dw<-t(descriptives_WB)
colnames(dw)<-c("Baseline A","Endline A","Baseline B","Endline B")
data.table(dw[-c(1,2),],keep.rownames=TRUE)
##                      rn Baseline A Endline A Baseline B Endline B
## 1: mean total wellbeing      28.22     60.46      23.63     52.62
## 2:   sd total wellbeing      31.68     28.47      30.39     29.33
endline.wb<-longdata$WB_total[longdata$time=="endline"]
baseline.wb<-longdata$WB_total[longdata$time=="baseline"]

df.effs<-data.frame(diff=endline.wb-baseline.wb,group=longdata$Group)
cd.wb<-df.effs %>% cohens_d(diff ~ group, var.equal = TRUE)

Cohen’s d for the effect of wellbeing is .001, which is very small.

fit_WB <- lmer(WB_total ~ GenderChild*time+Attendance*time+ (1|participantID:School) + (1 | School), data =longdata )
fit_WB1 <- lmer(WB_total ~ GenderChild*time+Attendance+Attendance*time+time*Group+ (1|participantID:School) + (1 | School), data =longdata )



tab_model(fit_WB,fit_WB1,show.se=TRUE,show.ci = FALSE)
  WB_total WB_total
Predictors Estimates std. Error p Estimates std. Error p
(Intercept) 33.63 0.74 <0.001 32.45 0.70 <0.001
GenderChild [Male] -0.31 0.33 0.351 -0.30 0.33 0.362
time [endline] -0.92 0.89 0.299 -1.23 0.91 0.173
Attendance 0.01 0.01 0.539 0.00 0.01 0.699
GenderChild [Male] × time
[endline]
0.25 0.46 0.593 0.29 0.46 0.539
time [endline] ×
Attendance
0.00 0.01 0.698 0.00 0.01 0.806
Group [1] 2.65 0.45 <0.001
time [endline] × Group
[1]
0.82 0.47 0.079
Random Effects
σ2 40.61 40.55
τ00 0.43 participantID:School 0.46 participantID:School
3.08 School 0.71 School
ICC 0.08 0.03
N 1507 participantID 1507 participantID
30 School 30 School
Observations 3014 3014
Marginal R2 / Conditional R2 0.002 / 0.082 0.056 / 0.083
plot(colnames(dat)[26])

# wellbeing including group

fit_Wbg <- lmer(WB_total ~ GenderChild*time*Group+Attendance+Attendance*time+time*Group+ (1|participantID:School) + (1 | School), data =longdata )

wellbeing_g<-tab_model(fit_Wbg,show.se=TRUE,show.ci = FALSE)

Q-values of the interaction effect time x group

pvalues<-na.omit(pvalue)


qvalue_truncp <- function(p, fdr.level = NULL, pfdr = FALSE, lfdr.out = TRUE, pi0 = NULL,...){
  # Argument checks
  p_in <- qvals_out <- lfdr_out <- p
  rm_na <- !is.na(p)
  p <- p[rm_na]
  if (min(p) < 0 || max(p) > 1) {
    stop("p-values not in valid range [0, 1].")
  } else if (!is.null(fdr.level) && (fdr.level <= 0 || fdr.level > 1)) {
    stop("'fdr.level' must be in (0, 1].")
  }
  p <- p / max(p)
  # Calculate pi0 estimate
  if (is.null(pi0)) {
    pi0s <- pi0est(p, ...)
  } else {
    if (pi0 > 0 && pi0 <= 1)  {
      pi0s = list()
      pi0s$pi0 = pi0
    } else {
      stop("pi0 is not (0,1]")
    }
  }
 # Calculate q-value estimates
  m <- length(p)
  i <- m:1L
  o <- order(p, decreasing = TRUE)
  ro <- order(o)
  if (pfdr) {
    qvals <- pi0s$pi0 * pmin(1, cummin(p[o] * m / (i * (1 - (1 - p[o]) ^ m))))[ro]
  } else {
    qvals <- pi0s$pi0 * pmin(1, cummin(p[o] * m /i ))[ro]
  }
  qvals_out[rm_na] <- qvals
  # Calculate local FDR estimates
  if (lfdr.out) {
    lfdr <- lfdr(p = p, pi0 = pi0s$pi0, ...)
    lfdr_out[rm_na] <- lfdr
  } else {
    lfdr_out <- NULL
  }
  
  # Return results
  if (!is.null(fdr.level)) {
    retval <- list(call = match.call(), pi0 = pi0s$pi0, qvalues = qvals_out,
                   pvalues = p_in, lfdr = lfdr_out, fdr.level = fdr.level,
                   significant = (qvals <= fdr.level),
                   pi0.lambda = pi0s$pi0.lambda, lambda = pi0s$lambda,
                   pi0.smooth = pi0s$pi0.smooth)
  } else {
    retval <- list(call = match.call(), pi0 = pi0s$pi0, qvalues = qvals_out,
                   pvalues = p_in, lfdr = lfdr_out, pi0.lambda = pi0s$pi0.lambda,
                   lambda = pi0s$lambda, pi0.smooth = pi0s$pi0.smooth)
  }
  class(retval) <- "qvalue"
  return(retval)
}

qobj <- qvalue_truncp(p = pvalues)


test<-c("nid","qds","mis","add","sub","prb","nu","lid","pho","muw","non",
"com","lis","wrt","read1","read2","lit")

qvalues <- qobj$qvalues

q<-data.frame(test,pvalues,qvalues)

# unique effect interaction time * group

colnames(q)<-c("(Sub)Task","P-value","Q-value")
data.table(q,keep.rownames=FALSE)
##     (Sub)Task      P-value      Q-value
##  1:       nid 1.524241e-02 4.041171e-02
##  2:       qds 5.785857e-04 2.629689e-03
##  3:       mis 3.494967e-01 7.412875e-01
##  4:       add 7.514410e-02 1.707661e-01
##  5:       sub 1.006443e-07 1.067340e-06
##  6:       prb 8.153845e-03 2.358330e-02
##  7:        nu 5.831946e-06 3.710892e-05
##  8:       lid 2.749689e-05 1.458032e-04
##  9:       pho 7.621153e-27 2.424686e-25
## 10:       muw 8.042224e-03 2.358330e-02
## 11:       non 8.796654e-07 6.996685e-06
## 12:       com 5.343356e-01 1.000000e+00
## 13:       lis 5.174150e-01 1.000000e+00
## 14:       wrt 1.450818e-03 5.769758e-03
## 15:     read1 7.717318e-03 2.358330e-02
## 16:     read2 1.752043e-02 4.287816e-02
## 17:       lit 1.461252e-08 2.324502e-07

Effect size Cohen’s d raw data

Note that Cohen’s d was calculated without a correction for variance by school or covariates.

cd=list()
for(i in 1:17){
df.effs<-data.frame(diff=endline[,i+6]-baseline[,i+6],group=baseline$Group)
cd[[i]]<-df.effs %>% cohens_d(diff ~ group, var.equal = TRUE,ci = TRUE,
  conf.level = 0.95)}


test<-c("nid","qds","mis","add","sub","prb","nu","lid","pho","muw","non",
"com","lis","wrt","read1","read2","lit")

df.cohensd<-cd[[1]][4]
df.cohensd_low<-cd[[1]][7]
df.cohensd_high<-cd[[1]][8]
for(i in 2:17){
df.cohensd<-rbind(df.cohensd,cd[[i]][4])
df.cohensd_low<-rbind(df.cohensd_low,cd[[i]][7])
df.cohensd_high<-rbind(df.cohensd_high,cd[[i]][8])

}

df<-data.frame(test,round(df.cohensd,2),round(df.cohensd_low,2),round(df.cohensd_high,2))

colnames(df)<-c("(Sub)Task","Cohen's d","CI_low","CI_high")
data.table(df,keep.rownames=FALSE)
##     (Sub)Task Cohen's d CI_low CI_high
##  1:       nid      0.13   0.03    0.23
##  2:       qds      0.19   0.09    0.29
##  3:       mis      0.06  -0.05    0.15
##  4:       add      0.11   0.01    0.22
##  5:       sub      0.28   0.18    0.38
##  6:       prb      0.14   0.04    0.25
##  7:        nu      0.25   0.16    0.35
##  8:       lid      0.22   0.11    0.32
##  9:       pho      0.58   0.48    0.70
## 10:       muw      0.15   0.05    0.24
## 11:       non      0.27   0.17    0.37
## 12:       com     -0.02  -0.12    0.07
## 13:       lis      0.04  -0.07    0.14
## 14:       wrt     -0.15  -0.24   -0.04
## 15:     read1      0.16   0.06    0.26
## 16:     read2      0.13   0.03    0.23
## 17:       lit      0.32   0.21    0.42

Completer analyses on >80% attendance only

nid

tab_model(fit_nid,fit_nid1,show.se=TRUE,show.ci = FALSE)
  total_nid total_nid
Predictors Estimates std. Error p Estimates std. Error p
(Intercept) 12.73 0.24 <0.001 12.52 0.29 <0.001
GenderChild [Male] -0.40 0.28 0.148 -0.39 0.28 0.163
time [endline] 1.75 0.19 <0.001 1.73 0.23 <0.001
GenderChild [Male] × time
[endline]
-0.17 0.27 0.538 -0.17 0.27 0.544
Group [1] 0.44 0.37 0.238
time [endline] × Group
[1]
0.04 0.28 0.876
Random Effects
σ2 3.07 3.08
τ00 3.16 participantID:School 3.15 participantID:School
0.25 School 0.22 School
ICC 0.53 0.52
N 328 participantID 328 participantID
20 School 20 School
Observations 656 656
Marginal R2 / Conditional R2 0.105 / 0.576 0.112 / 0.576
plot(colnames(dat)[10])

qds

tab_model(fit_qds,fit_qds1,show.se=TRUE,show.ci = FALSE)
  total_qds total_qds
Predictors Estimates std. Error p Estimates std. Error p
(Intercept) 8.67 0.15 <0.001 8.59 0.18 <0.001
GenderChild [Male] -0.47 0.18 0.009 -0.47 0.18 0.009
time [endline] 0.98 0.15 <0.001 0.89 0.17 <0.001
GenderChild [Male] × time
[endline]
0.09 0.21 0.659 0.10 0.21 0.627
Group [1] 0.14 0.23 0.533
time [endline] × Group
[1]
0.18 0.21 0.388
Random Effects
σ2 1.74 1.74
τ00 0.82 participantID:School 0.82 participantID:School
0.09 School 0.08 School
ICC 0.34 0.34
N 328 participantID 328 participantID
20 School 20 School
Observations 656 656
Marginal R2 / Conditional R2 0.104 / 0.411 0.109 / 0.413
plot(colnames(dat)[11])

mis

tab_model(fit_mis,fit_mis1,show.se=TRUE,show.ci = FALSE)
  total_mis total_mis
Predictors Estimates std. Error p Estimates std. Error p
(Intercept) 6.03 0.27 <0.001 5.40 0.29 <0.001
GenderChild [Male] -0.24 0.28 0.391 -0.21 0.28 0.458
time [endline] 2.16 0.20 <0.001 2.22 0.24 <0.001
GenderChild [Male] × time
[endline]
-0.46 0.29 0.114 -0.46 0.29 0.109
Group [1] 1.21 0.37 0.001
time [endline] × Group
[1]
-0.14 0.29 0.630
Random Effects
σ2 3.40 3.40
τ00 2.95 participantID:School 2.94 participantID:School
0.52 School 0.23 School
ICC 0.51 0.48
N 328 participantID 328 participantID
20 School 20 School
Observations 656 656
Marginal R2 / Conditional R2 0.127 / 0.568 0.168 / 0.569
plot(colnames(dat)[12])

add

tab_model(fit_add,fit_add1,show.se=TRUE,show.ci = FALSE)
  total_add total_add
Predictors Estimates std. Error p Estimates std. Error p
(Intercept) 7.21 0.45 <0.001 6.45 0.51 <0.001
GenderChild [Male] -0.49 0.46 0.288 -0.47 0.46 0.306
time [endline] 3.10 0.38 <0.001 3.00 0.45 <0.001
GenderChild [Male] × time
[endline]
-0.18 0.53 0.739 -0.17 0.53 0.757
Group [1] 1.49 0.65 0.022
time [endline] × Group
[1]
0.22 0.54 0.677
Random Effects
σ2 11.60 11.63
τ00 5.19 participantID:School 5.23 participantID:School
1.56 School 0.82 School
ICC 0.37 0.34
N 328 participantID 328 participantID
20 School 20 School
Observations 656 656
Marginal R2 / Conditional R2 0.114 / 0.440 0.145 / 0.438
plot(colnames(dat)[13])

sub

tab_model(fit_sub,fit_sub1,show.se=TRUE,show.ci = FALSE)
  total_sub total_sub
Predictors Estimates std. Error p Estimates std. Error p
(Intercept) 4.85 0.41 <0.001 4.33 0.41 <0.001
GenderChild [Male] -0.06 0.41 0.877 -0.10 0.40 0.813
time [endline] 2.07 0.36 <0.001 1.15 0.41 0.005
GenderChild [Male] × time
[endline]
0.11 0.50 0.821 0.22 0.49 0.652
Group [1] 0.79 0.52 0.131
time [endline] × Group
[1]
2.03 0.49 <0.001
Random Effects
σ2 10.22 9.74
τ00 3.04 participantID:School 3.31 participantID:School
1.38 School 0.41 School
ICC 0.30 0.28
N 328 participantID 328 participantID
20 School 20 School
Observations 656 656
Marginal R2 / Conditional R2 0.072 / 0.352 0.139 / 0.377
plot(colnames(dat)[14])

prb

tab_model(fit_prb,fit_prb1,show.se=TRUE,show.ci = FALSE)
  total_prb total_prb
Predictors Estimates std. Error p Estimates std. Error p
(Intercept) 3.80 0.17 <0.001 3.61 0.20 <0.001
GenderChild [Male] 0.23 0.18 0.201 0.23 0.18 0.189
time [endline] 0.94 0.15 <0.001 0.82 0.18 <0.001
GenderChild [Male] × time
[endline]
-0.28 0.21 0.199 -0.26 0.21 0.225
Group [1] 0.35 0.26 0.188
time [endline] × Group
[1]
0.29 0.22 0.186
Random Effects
σ2 1.89 1.88
τ00 0.63 participantID:School 0.63 participantID:School
0.20 School 0.15 School
ICC 0.31 0.29
N 328 participantID 328 participantID
20 School 20 School
Observations 656 656
Marginal R2 / Conditional R2 0.059 / 0.347 0.080 / 0.350
plot(colnames(dat)[15])

nu

tab_model(fit_nu,fit_nu1,show.se=TRUE,show.ci = FALSE)
  tot.num tot.num
Predictors Estimates std. Error p Estimates std. Error p
(Intercept) 0.57 0.02 <0.001 0.54 0.02 <0.001
GenderChild [Male] -0.01 0.02 0.367 -0.01 0.02 0.405
time [endline] 0.13 0.01 <0.001 0.12 0.01 <0.001
GenderChild [Male] × time
[endline]
-0.02 0.01 0.246 -0.01 0.01 0.285
Group [1] 0.05 0.02 0.019
time [endline] × Group
[1]
0.02 0.01 0.084
Random Effects
σ2 0.01 0.01
τ00 0.01 participantID:School 0.01 participantID:School
0.00 School 0.00 School
ICC 0.63 0.61
N 328 participantID 328 participantID
20 School 20 School
Observations 656 656
Marginal R2 / Conditional R2 0.160 / 0.688 0.202 / 0.690
plot(colnames(dat)[16])

lid

tab_model(fit_lid,fit_lid1,show.se=TRUE,show.ci = FALSE)
  total_lid total_lid
Predictors Estimates std. Error p Estimates std. Error p
(Intercept) 21.91 0.63 <0.001 21.31 0.83 <0.001
GenderChild [Male] -1.56 0.59 0.008 -1.53 0.59 0.009
time [endline] 2.72 0.51 <0.001 2.81 0.61 <0.001
GenderChild [Male] × time
[endline]
0.66 0.72 0.357 0.65 0.72 0.366
Group [1] 1.20 1.09 0.271
time [endline] × Group
[1]
-0.19 0.73 0.795
Random Effects
σ2 21.26 21.32
τ00 6.06 participantID:School 6.05 participantID:School
3.76 School 3.65 School
ICC 0.32 0.31
N 328 participantID 328 participantID
20 School 20 School
Observations 656 656
Marginal R2 / Conditional R2 0.081 / 0.372 0.090 / 0.374
plot(colnames(dat)[17])

pho

tab_model(fit_pho,fit_pho1,show.se=TRUE,show.ci = FALSE)
  total_pho total_pho
Predictors Estimates std. Error p Estimates std. Error p
(Intercept) 3.46 0.56 <0.001 2.24 0.58 <0.001
GenderChild [Male] -0.24 0.31 0.438 -0.28 0.31 0.362
time [endline] 2.59 0.29 <0.001 1.56 0.33 <0.001
GenderChild [Male] × time
[endline]
-0.36 0.41 0.384 -0.24 0.39 0.548
Group [1] 2.07 0.77 0.008
time [endline] × Group
[1]
2.29 0.40 <0.001
Random Effects
σ2 6.91 6.29
τ00 0.91 participantID:School 1.22 participantID:School
4.87 School 2.30 School
ICC 0.46 0.36
N 328 participantID 328 participantID
20 School 20 School
Observations 656 656
Marginal R2 / Conditional R2 0.106 / 0.513 0.309 / 0.557
plot(colnames(dat)[18])

muw

tab_model(fit_muw,fit_muw1,show.se=TRUE,show.ci = FALSE)
  total_muw total_muw
Predictors Estimates std. Error p Estimates std. Error p
(Intercept) 11.61 0.74 <0.001 10.71 0.98 <0.001
GenderChild [Male] -2.23 0.64 0.001 -2.20 0.64 0.001
time [endline] 5.33 0.34 <0.001 5.41 0.41 <0.001
GenderChild [Male] × time
[endline]
-0.27 0.48 0.579 -0.28 0.48 0.569
Group [1] 1.78 1.30 0.172
time [endline] × Group
[1]
-0.16 0.49 0.745
Random Effects
σ2 9.51 9.54
τ00 23.28 participantID:School 23.26 participantID:School
5.84 School 5.51 School
ICC 0.75 0.75
N 328 participantID 328 participantID
20 School 20 School
Observations 656 656
Marginal R2 / Conditional R2 0.175 / 0.797 0.189 / 0.798
plot(colnames(dat)[19])

non

tab_model(fit_non,fit_non1,show.se=TRUE,show.ci = FALSE)
  total_non total_non
Predictors Estimates std. Error p Estimates std. Error p
(Intercept) 4.44 0.61 <0.001 3.66 0.73 <0.001
GenderChild [Male] -0.51 0.53 0.336 -0.51 0.53 0.337
time [endline] 4.93 0.38 <0.001 4.14 0.44 <0.001
GenderChild [Male] × time
[endline]
-1.36 0.53 0.010 -1.27 0.52 0.015
Group [1] 1.38 0.96 0.149
time [endline] × Group
[1]
1.76 0.53 0.001
Random Effects
σ2 11.40 11.06
τ00 11.05 participantID:School 11.23 participantID:School
3.87 School 2.68 School
ICC 0.57 0.56
N 328 participantID 328 participantID
20 School 20 School
Observations 656 656
Marginal R2 / Conditional R2 0.159 / 0.636 0.205 / 0.648
plot(colnames(dat)[20])

com

tab_model(fit_com,fit_com1,show.se=TRUE,show.ci = FALSE)
  total_com total_com
Predictors Estimates std. Error p Estimates std. Error p
(Intercept) 1.02 0.16 <0.001 0.91 0.21 <0.001
GenderChild [Male] -0.11 0.15 0.476 -0.10 0.15 0.496
time [endline] 1.38 0.11 <0.001 1.42 0.13 <0.001
GenderChild [Male] × time
[endline]
-0.17 0.16 0.273 -0.18 0.16 0.264
Group [1] 0.21 0.28 0.451
time [endline] × Group
[1]
-0.07 0.16 0.645
Random Effects
σ2 1.01 1.01
τ00 0.78 participantID:School 0.78 participantID:School
0.23 School 0.24 School
ICC 0.50 0.50
N 328 participantID 328 participantID
20 School 20 School
Observations 656 656
Marginal R2 / Conditional R2 0.176 / 0.589 0.178 / 0.591
plot(colnames(dat)[21])

lis

tab_model(fit_lis,fit_lis1,show.se=TRUE,show.ci = FALSE)
  total_lis total_lis
Predictors Estimates std. Error p Estimates std. Error p
(Intercept) 1.13 0.15 <0.001 1.06 0.20 <0.001
GenderChild [Male] -0.20 0.15 0.183 -0.20 0.15 0.180
time [endline] 0.69 0.12 <0.001 0.60 0.14 <0.001
GenderChild [Male] × time
[endline]
0.00 0.16 0.992 0.01 0.16 0.945
Group [1] 0.12 0.27 0.662
time [endline] × Group
[1]
0.18 0.17 0.272
Random Effects
σ2 1.11 1.11
τ00 0.70 participantID:School 0.70 participantID:School
0.21 School 0.21 School
ICC 0.45 0.45
N 328 participantID 328 participantID
20 School 20 School
Observations 656 656
Marginal R2 / Conditional R2 0.060 / 0.482 0.065 / 0.486
plot(colnames(dat)[22])

wrt

tab_model(fit_wrt,fit_wrt1,show.se=TRUE,show.ci = FALSE)
  total_wrt total_wrt
Predictors Estimates std. Error p Estimates std. Error p
(Intercept) 4.39 0.37 <0.001 3.90 0.50 <0.001
GenderChild [Male] -0.92 0.32 0.004 -0.90 0.32 0.004
time [endline] 2.47 0.18 <0.001 2.63 0.21 <0.001
GenderChild [Male] × time
[endline]
-0.34 0.25 0.184 -0.36 0.25 0.160
Group [1] 0.99 0.66 0.134
time [endline] × Group
[1]
-0.36 0.26 0.156
Random Effects
σ2 2.62 2.61
τ00 5.22 participantID:School 5.23 participantID:School
1.52 School 1.46 School
ICC 0.72 0.72
N 328 participantID 328 participantID
20 School 20 School
Observations 656 656
Marginal R2 / Conditional R2 0.148 / 0.762 0.163 / 0.765
plot(colnames(dat)[23])

read 1

tab_model(fit_read1,fit_read11,show.se=TRUE,show.ci = FALSE)
  read_1 read_1
Predictors Estimates std. Error p Estimates std. Error p
(Intercept) 20.59 2.66 <0.001 17.39 3.55 <0.001
GenderChild [Male] -4.12 2.04 0.044 -4.06 2.04 0.047
time [endline] 19.96 1.15 <0.001 19.42 1.37 <0.001
GenderChild [Male] × time
[endline]
-4.91 1.62 0.002 -4.85 1.62 0.003
Group [1] 6.13 4.74 0.197
time [endline] × Group
[1]
1.20 1.64 0.466
Random Effects
σ2 107.09 107.25
τ00 221.41 participantID:School 221.35 participantID:School
87.27 School 80.92 School
ICC 0.74 0.74
N 328 participantID 328 participantID
20 School 20 School
Observations 656 656
Marginal R2 / Conditional R2 0.176 / 0.788 0.198 / 0.790
plot(colnames(dat)[24])

read 2

tab_model(fit_read2,fit_read21,show.se=TRUE,show.ci = FALSE)
  read_2 read_2
Predictors Estimates std. Error p Estimates std. Error p
(Intercept) 41.21 3.56 <0.001 37.15 4.61 <0.001
GenderChild [Male] -8.32 3.17 0.009 -8.20 3.17 0.010
time [endline] 33.06 1.84 <0.001 32.05 2.18 <0.001
GenderChild [Male] × time
[endline]
-3.47 2.58 0.180 -3.35 2.59 0.196
Group [1] 7.87 6.10 0.198
time [endline] × Group
[1]
2.24 2.62 0.392
Random Effects
σ2 273.33 273.56
τ00 520.05 participantID:School 520.00 participantID:School
128.00 School 115.72 School
ICC 0.70 0.70
N 328 participantID 328 participantID
20 School 20 School
Observations 656 656
Marginal R2 / Conditional R2 0.228 / 0.771 0.244 / 0.772
plot(colnames(dat)[25])

total literacy

tab_model(fit_tot.lit,fit_tot.lit1,show.se=TRUE,show.ci = FALSE)
  tot.lit tot.lit
Predictors Estimates std. Error p Estimates std. Error p
(Intercept) 0.39 0.03 <0.001 0.35 0.03 <0.001
GenderChild [Male] -0.05 0.02 0.011 -0.05 0.02 0.012
time [endline] 0.23 0.01 <0.001 0.21 0.01 <0.001
GenderChild [Male] × time
[endline]
-0.03 0.02 0.071 -0.03 0.02 0.093
Group [1] 0.08 0.04 0.070
time [endline] × Group
[1]
0.04 0.02 0.011
Random Effects
σ2 0.01 0.01
τ00 0.02 participantID:School 0.02 participantID:School
0.01 School 0.01 School
ICC 0.77 0.76
N 328 participantID 328 participantID
20 School 20 School
Observations 656 656
Marginal R2 / Conditional R2 0.222 / 0.820 0.269 / 0.824
plot(colnames(dat)[26])

Mediation analyses group->attendance->score (for total literacy score only in this example)

The first model shows that there is a significant relationship between group and attendance. Children in group A (=Group 1) have higher attendance scores (3.15) than children in group B (=Group 0). The second model shows that there is a significant relationship between total literacy score and attendance. Children with higher attendance have higher scores on literacy score (averaged over baseline and endline) and they improve more from baseline to endline with higher attendance scores. In the third model shows that children in group A have higher total literacy scores (averaged over baseline and endline) and children in group A improve more than children in group B. In the fourth model it is shown that higher attendance and being in group A results in significant improvement in literacy scores at endline. The final model shows a significant three way interaction between time group and attendance. Higher attendance in group A results in more improvement from baseline to endline than higher attendance in group B. Note that this final model does not have significant interaction effects anymore for time x attendance and time x group. So this would lead to the conclusion that attendance is both a mediator and a moderator.

  Attendance tot.lit tot.lit tot.lit tot.lit
Predictors Estimates std. Error p Estimates std. Error p Estimates std. Error p Estimates std. Error p Estimates std. Error p
(Intercept) 67.83 0.50 <0.001 0.19 0.02 <0.001 0.27 0.02 <0.001 0.17 0.02 <0.001 0.19 0.03 <0.001
Group [1] 3.15 0.71 <0.001 0.05 0.02 0.029 0.04 0.02 0.029 0.00 0.04 0.997
time [endline] 0.10 0.02 <0.001 0.16 0.01 <0.001 0.09 0.02 <0.001 0.11 0.02 <0.001
Attendance 0.00 0.00 <0.001 0.00 0.00 <0.001 0.00 0.00 0.001
time [endline] ×
Attendance
0.00 0.00 <0.001 0.00 0.00 <0.001 0.00 0.00 0.019
time [endline] × Group
[1]
0.05 0.01 <0.001 0.05 0.01 <0.001 -0.02 0.03 0.513
Attendance × Group [1] 0.00 0.00 0.261
(time [endline] ×
Attendance) × Group [1]
0.00 0.00 0.024
Random Effects
σ2   0.01 0.01 0.01 0.01
τ00   0.03 participantID:School 0.03 participantID:School 0.03 participantID:School 0.03 participantID:School
  0.00 School 0.00 School 0.00 School 0.00 School
ICC   0.70 0.71 0.70 0.70
N   1507 participantID 1507 participantID 1507 participantID 1507 participantID
  30 School 30 School 30 School 30 School
Observations 3014 3013 3013 3013 3013
R2 / R2 adjusted 0.006 / 0.006 0.189 / 0.757 0.185 / 0.761 0.216 / 0.764 0.219 / 0.764

Effect gender

Math

There is no significant interaction effect for gender x time x group on Math scales

numericy_g
  total_nid total_qds total_mis total_add total_sub total_prb tot.num
Predictors Estimates std. Error p Estimates std. Error p Estimates std. Error p Estimates std. Error p Estimates std. Error p Estimates std. Error p Estimates std. Error p
(Intercept) 11.16 0.28 <0.001 7.89 0.20 <0.001 4.02 0.31 <0.001 4.28 0.44 <0.001 2.98 0.38 <0.001 2.98 0.21 <0.001 0.45 0.02 <0.001
GenderChild [Male] 0.16 0.18 0.367 -0.11 0.13 0.399 0.30 0.19 0.122 0.22 0.30 0.455 0.29 0.26 0.262 0.15 0.12 0.234 0.01 0.01 0.228
time [endline] 1.64 0.26 <0.001 0.56 0.21 0.007 1.61 0.28 <0.001 1.40 0.49 0.004 0.85 0.43 0.048 1.12 0.21 <0.001 0.10 0.01 <0.001
Group [1] -0.06 0.22 0.783 -0.09 0.16 0.574 0.56 0.26 0.030 1.09 0.34 0.001 0.69 0.29 0.017 0.02 0.19 0.909 0.02 0.01 0.155
Attendance 0.01 0.00 <0.001 0.01 0.00 0.010 0.02 0.00 <0.001 0.02 0.01 <0.001 0.01 0.00 0.010 0.01 0.00 0.017 0.00 0.00 <0.001
GenderChild [Male] × time
[endline]
-0.11 0.18 0.548 -0.08 0.15 0.593 -0.37 0.19 0.056 -0.51 0.34 0.133 0.04 0.30 0.900 -0.22 0.15 0.132 -0.02 0.01 0.051
GenderChild [Male] ×
Group [1]
0.22 0.25 0.393 0.19 0.18 0.284 -0.08 0.27 0.757 0.00 0.42 0.996 -0.10 0.36 0.789 0.08 0.17 0.632 0.01 0.01 0.677
time [endline] × Group
[1]
0.45 0.19 0.016 0.41 0.15 0.006 0.09 0.20 0.643 0.50 0.34 0.150 1.05 0.30 0.001 0.28 0.15 0.055 0.03 0.01 0.001
time [endline] ×
Attendance
-0.00 0.00 0.888 0.00 0.00 0.149 0.00 0.00 0.196 0.02 0.01 0.002 0.01 0.01 0.101 -0.00 0.00 0.788 0.00 0.00 0.071
(GenderChild [Male] ×
time [endline]) × Group
[1]
-0.26 0.26 0.323 -0.10 0.21 0.647 0.07 0.28 0.790 -0.13 0.48 0.784 0.17 0.42 0.686 -0.02 0.21 0.923 -0.00 0.01 0.787
Random Effects
σ2 3.20 2.04 3.56 10.85 8.39 2.01 0.01
τ00 2.73 participantID:School 0.98 participantID:School 3.20 participantID:School 5.37 participantID:School 3.75 participantID:School 0.80 participantID:School 0.01 participantID:School
0.12 School 0.06 School 0.21 School 0.18 School 0.12 School 0.14 School 0.00 School
ICC 0.47 0.34 0.49 0.34 0.32 0.32 0.61
N 1507 participantID 1507 participantID 1507 participantID 1507 participantID 1507 participantID 1507 participantID 1507 participantID
30 School 30 School 30 School 30 School 30 School 30 School 30 School
Observations 3014 3014 3014 3014 3014 3014 3014
Marginal R2 / Conditional R2 0.121 / 0.535 0.086 / 0.394 0.131 / 0.556 0.142 / 0.432 0.119 / 0.398 0.102 / 0.388 0.196 / 0.687

Literacy

There are two significant effects for the interaction gender x time x group. Boys in group A improved less (.4) on com than Girls in group A. Boys in group A improved less (4.2) on read 1 than Girls in group A.

literacy_g
  total_lid total_pho total_muw total_non total_com total_lis total_wrt read_1 read_2 tot.lit
Predictors Estimates std. Error p Estimates std. Error p Estimates std. Error p Estimates std. Error p Estimates std. Error p Estimates std. Error p Estimates std. Error p Estimates std. Error p Estimates std. Error p Estimates std. Error p
(Intercept) 18.39 0.81 <0.001 2.19 0.45 <0.001 3.83 0.82 <0.001 1.35 0.56 0.016 0.17 0.16 0.283 0.34 0.16 0.030 1.07 0.37 0.004 3.84 2.29 0.094 9.58 3.55 0.007 0.18 0.03 <0.001
GenderChild [Male] -0.36 0.45 0.417 -0.31 0.21 0.143 -0.85 0.46 0.069 -0.09 0.35 0.798 -0.08 0.10 0.378 -0.17 0.09 0.055 -0.35 0.21 0.105 -2.01 1.30 0.122 -3.56 2.12 0.093 -0.03 0.01 0.083
time [endline] 2.59 0.74 <0.001 -1.48 0.41 <0.001 3.65 0.50 <0.001 1.90 0.50 <0.001 0.72 0.15 <0.001 0.30 0.14 0.037 1.36 0.24 <0.001 7.11 1.56 <0.001 25.08 2.57 <0.001 0.08 0.02 <0.001
Group [1] -1.30 0.79 0.098 1.56 0.49 0.002 0.63 0.76 0.409 0.78 0.46 0.090 0.12 0.14 0.399 0.17 0.15 0.252 0.60 0.35 0.082 2.42 2.15 0.260 2.62 3.11 0.400 0.04 0.02 0.074
Attendance 0.03 0.01 <0.001 0.00 0.00 0.626 0.06 0.01 <0.001 0.02 0.01 0.001 0.01 0.00 <0.001 0.01 0.00 0.001 0.02 0.00 <0.001 0.11 0.03 <0.001 0.24 0.04 <0.001 0.00 0.00 <0.001
GenderChild [Male] × time
[endline]
0.10 0.52 0.845 0.28 0.29 0.334 0.24 0.35 0.483 -0.01 0.35 0.985 0.03 0.11 0.790 0.17 0.10 0.080 -0.12 0.17 0.465 -0.21 1.09 0.846 1.29 1.80 0.474 0.01 0.01 0.441
GenderChild [Male] ×
Group [1]
0.34 0.63 0.594 -0.06 0.30 0.852 0.12 0.66 0.851 0.15 0.50 0.766 0.11 0.13 0.414 0.04 0.13 0.730 -0.27 0.30 0.376 1.13 1.83 0.536 2.23 3.00 0.456 0.01 0.02 0.804
time [endline] × Group
[1]
1.96 0.52 <0.001 2.43 0.29 <0.001 1.01 0.35 0.004 1.60 0.35 <0.001 0.13 0.11 0.210 0.16 0.10 0.105 -0.32 0.17 0.064 4.51 1.11 <0.001 5.74 1.82 0.002 0.07 0.01 <0.001
time [endline] ×
Attendance
0.00 0.01 0.883 0.03 0.01 <0.001 0.01 0.01 0.035 0.01 0.01 0.019 0.00 0.00 0.052 0.00 0.00 0.135 0.01 0.00 <0.001 0.10 0.02 <0.001 0.05 0.03 0.144 0.00 0.00 <0.001
(GenderChild [Male] ×
time [endline]) × Group
[1]
-0.82 0.73 0.260 -0.43 0.40 0.288 -0.70 0.49 0.153 -0.74 0.49 0.130 -0.35 0.15 0.018 -0.23 0.14 0.103 -0.13 0.24 0.600 -4.76 1.54 0.002 -5.27 2.54 0.038 -0.04 0.02 0.010
Random Effects
σ2 25.08 7.64 11.29 11.29 1.04 0.92 2.73 111.67 302.61 0.01
τ00 12.00 participantID:School 0.73 participantID:School 28.63 participantID:School 11.81 participantID:School 0.65 participantID:School 0.56 participantID:School 5.67 participantID:School 199.35 participantID:School 529.83 participantID:School 0.03 participantID:School
3.09 School 1.49 School 2.73 School 0.62 School 0.09 School 0.11 School 0.56 School 21.61 School 38.24 School 0.00 School
ICC 0.38 0.22 0.74 0.52 0.41 0.42 0.70 0.66 0.65 0.70
N 1507 participantID 1507 participantID 1507 participantID 1507 participantID 1507 participantID 1507 participantID 1507 participantID 1507 participantID 1507 participantID 1507 participantID
30 School 30 School 30 School 30 School 30 School 30 School 30 School 30 School 30 School 30 School
Observations 3014 3014 3014 3014 3014 3014 3014 3014 3014 3013
Marginal R2 / Conditional R2 0.085 / 0.429 0.249 / 0.418 0.169 / 0.780 0.151 / 0.596 0.138 / 0.495 0.075 / 0.465 0.131 / 0.735 0.180 / 0.725 0.239 / 0.735 0.221 / 0.765

Wellbeing

There is no significant interaction effect for gender x time x group on wellbeing

wellbeing_g
  WB_total
Predictors Estimates std. Error p
(Intercept) 32.21 0.72 <0.001
GenderChild [Male] 0.15 0.47 0.749
time [endline] -1.11 0.94 0.236
Group [1] 3.11 0.57 <0.001
Attendance 0.00 0.01 0.709
GenderChild [Male] × time
[endline]
0.06 0.66 0.930
GenderChild [Male] ×
Group [1]
-0.90 0.66 0.173
time [endline] × Group
[1]
0.58 0.67 0.381
time [endline] ×
Attendance
0.00 0.01 0.805
(GenderChild [Male] ×
time [endline]) × Group
[1]
0.46 0.93 0.624
Random Effects
σ2 40.57
τ00 participantID:School 0.43
τ00 School 0.71
ICC 0.03
N participantID 1507
N School 30
Observations 3014
Marginal R2 / Conditional R2 0.057 / 0.083

Effect gender in intervention group only

Math

There is a main effect for total_nid for gender. Boys scored .37 higher than girls, p=.031. There is one significant interaction effect gender x time. On the total math score, girls improved 2% more than boys (p=.012).

numericy_g
  total_nid total_qds total_mis total_add total_sub total_prb tot.num
Predictors Estimates std. Error p Estimates std. Error p Estimates std. Error p Estimates std. Error p Estimates std. Error p Estimates std. Error p Estimates std. Error p
(Intercept) 10.40 0.50 <0.001 7.28 0.35 <0.001 3.60 0.54 <0.001 3.55 0.88 <0.001 2.94 0.80 <0.001 2.70 0.36 <0.001 0.41 0.03 <0.001
GenderChild [Male] 1.71 0.72 0.017 0.87 0.50 0.080 1.20 0.75 0.110 2.02 1.26 0.109 0.80 1.16 0.490 0.08 0.50 0.867 0.07 0.04 0.071
Attendance 0.02 0.01 0.001 0.01 0.00 0.004 0.03 0.01 <0.001 0.05 0.01 <0.001 0.02 0.01 0.038 0.01 0.00 0.039 0.00 0.00 <0.001
time [endline] 2.12 0.54 <0.001 2.03 0.43 <0.001 2.55 0.53 <0.001 2.66 1.03 0.010 1.84 0.95 0.052 1.85 0.42 <0.001 0.18 0.03 <0.001
GenderChild [Male] ×
Attendance
-0.02 0.01 0.055 -0.01 0.01 0.105 -0.01 0.01 0.177 -0.03 0.02 0.143 -0.01 0.02 0.578 0.00 0.01 0.764 -0.00 0.00 0.163
GenderChild [Male] × time
[endline]
-0.68 0.78 0.380 -1.83 0.63 0.004 -0.89 0.78 0.252 -2.04 1.50 0.172 -1.39 1.38 0.315 -0.43 0.61 0.482 -0.09 0.04 0.024
Attendance × time
[endline]
-0.00 0.01 0.901 -0.01 0.01 0.062 -0.01 0.01 0.310 0.01 0.01 0.553 0.01 0.01 0.461 -0.01 0.01 0.221 -0.00 0.00 0.282
(GenderChild [Male] ×
Attendance) × time
[endline]
0.00 0.01 0.677 0.02 0.01 0.007 0.01 0.01 0.435 0.02 0.02 0.335 0.02 0.02 0.234 0.00 0.01 0.752 0.00 0.00 0.080
Random Effects
σ2 3.20 2.09 3.17 11.79 10.02 1.94 0.01
τ00 2.19 participantID:School 0.52 participantID:School 2.72 participantID:School 4.88 participantID:School 4.24 participantID:School 0.64 participantID:School 0.01 participantID:School
0.07 School 0.06 School 0.20 School 0.14 School 0.03 School 0.19 School 0.00 School
ICC 0.41 0.22 0.48 0.30 0.30 0.30 0.57
N 753 participantID 753 participantID 753 participantID 753 participantID 753 participantID 753 participantID 753 participantID
15 School 15 School 15 School 15 School 15 School 15 School 15 School
Observations 1506 1506 1506 1506 1506 1506 1506
Marginal R2 / Conditional R2 0.154 / 0.504 0.122 / 0.314 0.145 / 0.555 0.143 / 0.399 0.124 / 0.386 0.129 / 0.391 0.240 / 0.670

Literacy

There is one significant effect for the main effect of gender on total_wrt. Girls scores .62 higher than boys. There are three significant interaction effects gender x time. On total_com girls improved .28 more than boys, p=.009. On read_1 girls improved 4.27 more than boys, p<.001. On tot.lit girls improved 2 percent more than boys, p=.04.

literacy_g
  total_lid total_pho total_muw total_non total_com total_lis total_wrt read_1 read_2 tot.lit
Predictors Estimates std. Error p Estimates std. Error p Estimates std. Error p Estimates std. Error p Estimates std. Error p Estimates std. Error p Estimates std. Error p Estimates std. Error p Estimates std. Error p Estimates std. Error p
(Intercept) 12.81 1.42 <0.001 2.28 0.71 0.001 2.36 1.42 0.098 0.52 1.07 0.628 0.03 0.30 0.931 0.21 0.29 0.463 1.62 0.67 0.016 2.67 4.27 0.532 9.31 6.50 0.152 0.14 0.05 0.002
GenderChild [Male] 5.08 1.91 0.008 0.53 0.93 0.571 4.30 1.90 0.024 2.74 1.51 0.069 0.67 0.41 0.104 0.38 0.40 0.339 0.05 0.89 0.958 6.01 5.71 0.292 14.50 8.86 0.102 0.11 0.06 0.064
Attendance 0.09 0.02 <0.001 0.02 0.01 0.012 0.09 0.02 <0.001 0.04 0.01 0.002 0.01 0.00 0.006 0.01 0.00 0.008 0.02 0.01 0.004 0.16 0.05 0.003 0.28 0.08 0.001 0.00 0.00 <0.001
time [endline] 7.33 1.60 <0.001 0.74 0.88 0.400 6.10 0.96 <0.001 3.04 1.01 0.003 0.95 0.31 0.002 0.84 0.30 0.006 0.83 0.47 0.075 9.76 3.26 0.003 27.85 5.26 <0.001 0.17 0.03 <0.001
GenderChild [Male] ×
Attendance
-0.07 0.03 0.006 -0.01 0.01 0.328 -0.07 0.03 0.007 -0.04 0.02 0.068 -0.01 0.01 0.108 -0.01 0.01 0.189 -0.01 0.01 0.447 -0.10 0.08 0.216 -0.22 0.12 0.067 -0.00 0.00 0.025
GenderChild [Male] × time
[endline]
-5.18 2.32 0.026 -1.71 1.28 0.181 -4.84 1.40 0.001 -3.48 1.47 0.018 -1.06 0.45 0.018 -1.04 0.44 0.018 -0.43 0.68 0.532 -6.54 4.75 0.168 -14.64 7.65 0.056 -0.17 0.05 <0.001
Attendance × time
[endline]
-0.04 0.02 0.084 0.03 0.01 0.006 -0.01 0.01 0.604 0.02 0.01 0.125 0.00 0.00 0.582 -0.00 0.00 0.510 0.01 0.01 0.030 0.12 0.04 0.006 0.09 0.07 0.214 0.00 0.00 0.129
(GenderChild [Male] ×
Attendance) × time
[endline]
0.06 0.03 0.049 0.02 0.02 0.210 0.06 0.02 0.001 0.04 0.02 0.056 0.01 0.01 0.089 0.01 0.01 0.021 0.00 0.01 0.792 0.02 0.06 0.734 0.15 0.10 0.152 0.00 0.00 0.003
Random Effects
σ2 28.45 8.58 10.36 11.36 1.05 1.02 2.44 118.82 308.30 0.01
τ00 9.87 participantID:School 0.60 participantID:School 27.44 participantID:School 12.43 participantID:School 0.71 participantID:School 0.63 participantID:School 5.93 participantID:School 222.70 participantID:School 515.49 participantID:School 0.03 participantID:School
3.63 School 1.13 School 3.65 School 0.73 School 0.13 School 0.11 School 0.83 School 32.74 School 55.04 School 0.00 School
ICC 0.32 0.17 0.75 0.54 0.45 0.42 0.73 0.68 0.65 0.72
N 753 participantID 753 participantID 753 participantID 753 participantID 753 participantID 753 participantID 753 participantID 753 participantID 753 participantID 753 participantID
15 School 15 School 15 School 15 School 15 School 15 School 15 School 15 School 15 School 15 School
Observations 1506 1506 1506 1506 1506 1506 1506 1506 1506 1506
Marginal R2 / Conditional R2 0.122 / 0.404 0.221 / 0.352 0.180 / 0.795 0.176 / 0.618 0.128 / 0.518 0.068 / 0.459 0.108 / 0.763 0.176 / 0.738 0.246 / 0.735 0.240 / 0.788

Psychometrics Baseline

nid.scale<-data[,which(substring(colnames(data),1,3)=="nid")][1:15]
qds.scale<-data[,which(substring(colnames(data),1,3)=="qds")][1:10]
mis.scale<-data[,which(substring(colnames(data),1,3)=="mis")][1:10]
add.scale<-data[,which(substring(colnames(data),1,3)=="add")][1:25]
sub.scale<-data[,which(substring(colnames(data),1,3)=="sub")][1:25]
prb.scale<-data[,which(substring(colnames(data),1,3)=="prb")][1:6]

pho.scale<-data[,which(substring(colnames(data),1,3)=="pho")][1:10]
muw.scale<-data[,which(substring(colnames(data),1,3)=="muw")][1:20]
com.scale<-data[,which(substring(colnames(data),1,3)=="com")][1:5]
lis.scale<-data[,which(substring(colnames(data),1,3)=="lis")][1:5]
wrt.scale<-data[,which(substring(colnames(data),1,3)=="wrt")][1:10]

SCWS.scale<-data[,which(substring(colnames(data),1,3)=="SCW")][1:12]

### Alpha ####
library(psych)
## 
## Attaching package: 'psych'
## The following objects are masked from 'package:ggplot2':
## 
##     %+%, alpha
psychometrics<-function(y){
y[y=="Correct"]=1
y[y=="Incorrect"]=0
y<-apply(y,2,as.numeric)
alpha<-alpha(y)
return(alpha$total[,1])
}

alpha.math<-data.frame(subtest=c("nid","qds","mis","add","sub","prb"),
                       round(c(psychometrics(nid.scale),psychometrics(qds.scale),psychometrics(mis.scale),
                         psychometrics(add.scale),psychometrics(sub.scale),psychometrics(prb.scale)),2))
## Warning in alpha(y): Item = add_25 had no variance and was deleted but still is
## counted in the score
## Warning in cor.smooth(r): Matrix was not positive definite, smoothing was done
## In smc, smcs < 0 were set to .0
## In smc, smcs < 0 were set to .0
## In smc, smcs < 0 were set to .0
## In smc, smcs < 0 were set to .0
## In smc, smcs < 0 were set to .0
## In smc, smcs < 0 were set to .0
## In smc, smcs < 0 were set to .0
## In smc, smcs < 0 were set to .0
## In smc, smcs < 0 were set to .0
## In smc, smcs < 0 were set to .0
## In smc, smcs < 0 were set to .0
## In smc, smcs < 0 were set to .0
## In smc, smcs < 0 were set to .0
## In smc, smcs < 0 were set to .0
## In smc, smcs < 0 were set to .0
## In smc, smcs < 0 were set to .0
## In smc, smcs < 0 were set to .0
## In smc, smcs < 0 were set to .0
## In smc, smcs < 0 were set to .0
## In smc, smcs < 0 were set to .0
## In smc, smcs < 0 were set to .0
## In smc, smcs < 0 were set to .0
## In smc, smcs < 0 were set to .0
## In smc, smcs < 0 were set to .0
## In smc, smcs < 0 were set to .0
## In smc, smcs < 0 were set to .0
## Warning in alpha(y): Item = sub_24 had no variance and was deleted but still is
## counted in the score
## Warning in alpha(y): Item = sub_25 had no variance and was deleted but still is
## counted in the score
colnames(alpha.math)<-c("subtest","alpha")

alpha.lit<-data.frame(subtest=c("pho","muw","com","lis","wrt"),
                       round(c(psychometrics(pho.scale),psychometrics(muw.scale),psychometrics(com.scale),
                         psychometrics(lis.scale),psychometrics(wrt.scale)),2))
colnames(alpha.lit)<-c("subtest","alpha")


SCWS.scale[SCWS.scale=="All of the time"]=1
SCWS.scale[SCWS.scale=="Quite a lot of the time"]=2
SCWS.scale[SCWS.scale=="Some of the time"]=3
SCWS.scale[SCWS.scale=="Not much of the time"]=4
SCWS.scale[SCWS.scale=="Never"]=5

# impute missing data
SCWS.scale<-apply(SCWS.scale,2,as.numeric)
## Warning in apply(SCWS.scale, 2, as.numeric): NAs introduced by coercion
## Warning in apply(SCWS.scale, 2, as.numeric): NAs introduced by coercion

## Warning in apply(SCWS.scale, 2, as.numeric): NAs introduced by coercion

## Warning in apply(SCWS.scale, 2, as.numeric): NAs introduced by coercion

## Warning in apply(SCWS.scale, 2, as.numeric): NAs introduced by coercion

## Warning in apply(SCWS.scale, 2, as.numeric): NAs introduced by coercion

## Warning in apply(SCWS.scale, 2, as.numeric): NAs introduced by coercion

## Warning in apply(SCWS.scale, 2, as.numeric): NAs introduced by coercion

## Warning in apply(SCWS.scale, 2, as.numeric): NAs introduced by coercion

## Warning in apply(SCWS.scale, 2, as.numeric): NAs introduced by coercion

## Warning in apply(SCWS.scale, 2, as.numeric): NAs introduced by coercion
scores.mice<-mice(SCWS.scale,print=FALSE)
SCWS.scale<-complete(scores.mice)

alpha.SCWS<-alpha(SCWS.scale)$total[,1]

### CFA ####

library(lavaan)
## This is lavaan 0.6-16
## lavaan is FREE software! Please report any bugs.
## 
## Attaching package: 'lavaan'
## The following object is masked from 'package:psych':
## 
##     cor2cov
# good fit: cfi>.95, gfi>.9, nfi>.95 rmsea<.08
CFA.math<-data.frame(subtest=c("nid","qds","mis","add","sub","prb"),cfi=rep(NA,6),gfi=rep(NA,6),nfi=rep(NA,6),rmsea=rep(NA,6))

CFAmodel <- ' F1  =~ nid_1 + nid_2 + nid_3+nid_4 + nid_5 + nid_6+nid_7 + nid_8 + nid_9+nid_10 + nid_11 + nid_12+
nid_13+nid_14 + nid_15 '
fit <- cfa(CFAmodel, data = nid.scale)
CFA.math[1,2:5]<-round(fitMeasures(fit, fit.measures = c("cfi","gfi","nfi","rmsea")),3)

CFAmodel <- ' F1  =~ qds_1 + qds_2 + qds_3+qds_4 + qds_5 + qds_6+qds_7 + qds_8 + qds_9+qds_10 '
fit <- cfa(CFAmodel, data = qds.scale)
CFA.math[2,2:5]<-round(fitMeasures(fit, fit.measures = c("cfi","gfi","nfi","rmsea")),3)

CFAmodel <- ' F1  =~ mis_1 + mis_2 + mis_3+mis_4 + mis_5 + mis_6+mis_7 + mis_8 + mis_9+mis_10  '
fit <- cfa(CFAmodel, data = mis.scale)
CFA.math[3,2:5]<-round(fitMeasures(fit, fit.measures = c("cfi","gfi","nfi","rmsea")),3)

#note that  25 are removed because there was no variance
CFAmodel <- ' F1  =~ add_1 + add_2 + add_3+add_4 + add_5 + add_6+add_7 + add_8 + add_9+add_10 + add_11 + add_12+
add_13+add_14 + add_15+add_16+add_17 + add_18 + add_19+add_20 + add_21 + add_22+
add_23+add_24  '
#fit <- cfa(CFAmodel, data = add.scale)
CFA.math[4,2:5]<-NA

#note that 24 and 25 are removed because there was no variance
CFAmodel <- ' F1  =~ sub_1 + sub_2 + sub_3+sub_4 + sub_5 + sub_6+sub_7 + sub_8 + sub_9+sub_10 + sub_11 + sub_12+
sub_13+sub_14 + sub_15+sub_16+sub_17 + sub_18 + sub_19+sub_20 + sub_21 + sub_22+
sub_23 '
fit <- cfa(CFAmodel, data = sub.scale)
CFA.math[5,2:5]<-round(fitMeasures(fit, fit.measures = c("cfi","gfi","nfi","rmsea")),3)

CFAmodel <- ' F1  =~ prb_1 + prb_2 + prb_3+prb_4 + prb_5 + prb_6'
fit <- cfa(CFAmodel, data = prb.scale)
CFA.math[6,2:5]<-round(fitMeasures(fit, fit.measures = c("cfi","gfi","nfi","rmsea")),3)


CFA.lit<-data.frame(subtest=c("pho","muw","com","lis","wrt"),cfi=rep(NA,5),gfi=rep(NA,5),nfi=rep(NA,5),rmsea=rep(NA,5))

CFAmodel <- ' F1  =~ pho_1 + pho_2 + pho_3+pho_4 + pho_5 + pho_6+pho_7 + pho_8 + pho_9+pho_10 '
fit <- cfa(CFAmodel, data = pho.scale)
CFA.lit[1,2:5]<-round(fitMeasures(fit, fit.measures = c("cfi","gfi","nfi","rmsea")),3)


CFAmodel <- ' F1  =~ muw_1 + muw_2 + muw_3+muw_4 + muw_5 + muw_6+muw_7 + muw_8 + muw_9+muw_10 + muw_11 + muw_12+
muw_13+muw_14 + muw_15 + muw_16+muw_17 + muw_18 + muw_19+muw_20 '
fit <- cfa(CFAmodel, data = muw.scale)
CFA.lit[2,2:5]<-round(fitMeasures(fit, fit.measures = c("cfi","gfi","nfi","rmsea")),3)


CFAmodel <- ' F1  =~ com_1 + com_2 + com_3+com_4 + com_5  '
fit <- cfa(CFAmodel, data = com.scale)
CFA.lit[3,2:5]<-round(fitMeasures(fit, fit.measures = c("cfi","gfi","nfi","rmsea")),3)


CFAmodel <- ' F1  =~ lis_1 + lis_2 + lis_3+lis_4 + lis_5 '
fit <- cfa(CFAmodel, data = lis.scale)
CFA.lit[4,2:5]<-round(fitMeasures(fit, fit.measures = c("cfi","gfi","nfi","rmsea")),3)


CFAmodel <- ' F1  =~ wrt_1 + wrt_2 + wrt_3+wrt_4 + wrt_5 + wrt_6+wrt_7 + wrt_8 + wrt_9+wrt_10  '
fit <- cfa(CFAmodel, data = wrt.scale)
CFA.lit[5,2:5]<-round(fitMeasures(fit, fit.measures = c("cfi","gfi","nfi","rmsea")),3)


CFAmodel <- ' F1  =~ SCWS1 + SCWS2 + SCWS3+SCWS4 + SCWS5 + SCWS6+SCWS7 + SCWS8 + SCWS9+SCWS10+SCWS11 + SCWS12  '
fit <- cfa(CFAmodel, data = SCWS.scale)
CFA.WB<-round(fitMeasures(fit, fit.measures = c("cfi","gfi","nfi","rmsea")),3)

# CFA Analyses on total scores


# math

#note that the scale of the total scores does not influence the results of the cfa since the correlation is not affected. 

CFAmodel <- ' F1  =~ total_nid+total_qds+total_mis+total_add+total_sub+total_prb  '
fit <- cfa(CFAmodel, data = data)
CFA.num_tot<-round(fitMeasures(fit, fit.measures = c("cfi","gfi","nfi","rmsea")),3)

print(CFA.num_tot)
##   cfi   gfi   nfi rmsea 
## 0.857 0.910 0.855 0.177
# litt
CFAmodel <- ' F1  =~ total_lid+total_pho+total_muw+total_non+total_com+total_lis+ total_wrt '
fit <- cfa(CFAmodel, data = data)
CFA.lit_tot<-round(fitMeasures(fit, fit.measures = c("cfi","gfi","nfi","rmsea")),3)

print(CFA.lit_tot)
##   cfi   gfi   nfi rmsea 
## 0.916 0.924 0.914 0.143

Math

For the six sub tests for Math the internal consistency was evaluated using Cronbach’s alpha. The table below shows that alpha was sufficient (alpha>.8) for nid, mis, add and sub and just below sufficient for mis and prb. Note that add item 25 and sub items 24 and 25 had no variance.

A confirmative factor analysis was done at subtest level evaluating the 1 factor model. The fit was evaluated using 4 fit statistics, Comparative fit index (cfi), Goodness of fit index (gfi),Normed fit index (nfi), and Root mean square error of approximation (rmsea). Good fit indicates: cfi>.95, gfi>.9, nfi>.95 rmsea<.08.

The table below shows that the one factor model did not fit for nid, mis, and sub. For addition there was not enough variance to perform the cfa analysis. The fit was good for qds and prb.

data.table(data.frame(alpha.math,CFA.math[,-1]))
##    subtest alpha   cfi   gfi   nfi rmsea
## 1:     nid  0.85 0.656 0.676 0.649 0.143
## 2:     qds  0.77 0.942 0.977 0.929 0.052
## 3:     mis  0.84 0.821 0.897 0.815 0.123
## 4:     add  0.87    NA    NA    NA    NA
## 5:     sub  0.86 0.542 0.533 0.537 0.178
## 6:     prb  0.74 0.970 0.988 0.965 0.059

CFA Analysis on total math scores

The CFA analysis on math total scores using the six sub tests as indicators shows that the one factor model did not fit the data. The cfi was .857, the gfi .910, the nfi .855 and the rmsea .177.

CFA Analysis on total literacy scores

The CFA analysis on literacy total scores using the five sub tests as indicators shows that the one factor model did not fit the data. The cfi was .916, the gfi .924, the nfi .914 and the rmsea .143.

Literacy

For the five sub tests for Literary the internal consistency was evaluated using Cronbach’s alpha. The table below shows that alpha was sufficient (alpha>.8) for pho, muw, and wrt and just below sufficient for com and lis.

The table below shows that the one factor model did fit well for the literacy subtests.

data.table(data.frame(alpha.lit,CFA.lit[,-1]))
##    subtest alpha   cfi   gfi   nfi rmsea
## 1:     pho  0.90 0.915 0.913 0.911 0.109
## 2:     muw  0.95 0.920 0.866 0.911 0.076
## 3:     com  0.75 0.958 0.978 0.955 0.100
## 4:     lis  0.71 0.946 0.969 0.944 0.119
## 5:     wrt  0.87 0.944 0.948 0.938 0.079

Well-Being

The internal consistency for well-being was .69 which is insufficient. The fit of the cfa was good according to the gfi and rmsea, but not sufficient according to the cfi and nfi.

alpha.SCWS
## [1] 0.6890199
CFA.WB
##   cfi   gfi   nfi rmsea 
## 0.855 0.965 0.831 0.056