# Libraries
library(tidyverse)
library(igraph)
library(ggraph)
library(tidygraph)
library(haven)
library(stargazer)
library(statnet)
library(intergraph)
library(metafor)

# Parameters
baseline_network_file <- "baseline_network.dta"
endline_network_file <- "endline_network.dta"

#===============================================================================

Creating networks for each classroom

classids <- read_dta(endline_network_file) %>% select(classid) %>% arrange(classid) %>% distinct() %>% unlist()

b_netlist <- list()
e_netlist <- list()

for (class in classids) {
  print(str_c("Now at class: ", class))
  
  b_nodes <-
    read_dta(baseline_network_file) %>%
    filter(classid == class) %>%
    select(-b_node2) %>%
    mutate(
      reservation = recode(reservation, `Non-reservation` = "0", `Reservation` = "1", .default = NA_character_) %>% as.integer()
    ) %>% 
    distinct()

  b_edges <-
    read_dta(baseline_network_file) %>%
    filter(classid == class) %>%
    select(b_node1, b_node2) %>%
    filter(b_node2 != "")

  e_nodes <-
    read_dta(endline_network_file) %>%
    filter(classid == class) %>%
    select(-e_node2) %>%
    mutate(
      reservation = recode(reservation, `Non-reservation` = "0", `Reservation` = "1", .default = NA_character_) %>% as.integer()
    ) %>%
    distinct()

  e_edges <-
    read_dta(endline_network_file) %>%
    filter(classid == class) %>%
    select(e_node1, e_node2) %>%
    filter(e_node2 != "")
  
  b_netlist[[class]] <-
    graph_from_data_frame(b_edges, b_nodes, directed = TRUE) %>%
    asNetwork()
  
  e_netlist[[class]] <-
    graph_from_data_frame(e_edges, e_nodes, directed = TRUE) %>%
    asNetwork()
}

Running STERGMs

results <- tibble()

for (class in classids) {
  tryCatch(
    {
      print(str_c("Now at class: ", class))
      
      model <- 
        stergm(
          list(b_netlist[[class]], e_netlist[[class]]),
          formation = 
            ~ edges + nodefactor("reservation") + nodematch("reservation") + nodefactor("female") + nodematch("female") + nodefactor("ses") + nodematch("ses") + nodefactor("area") + nodematch("area") + nodecov("score") + absdiff("score") + mutual + gwesp(0.25),
          dissolution = 
            ~ edges + nodefactor("reservation") + nodematch("reservation") + nodefactor("female") + nodematch("female") + nodefactor("ses") + nodematch("ses") + nodefactor("area") + nodematch("area") + nodecov("score") + absdiff("score") + mutual + gwesp(0.25),
          estimate = "CMLE",
          times = 1:2,
          control = control.stergm(seed = 100)
        )
      
      summary <- model %>% summary()
      
      results <-
        bind_rows(
          results,
          bind_cols(
            rep(
              class, nrow(summary[["formation"]][["coefs"]][["Estimate"]] %>% as_tibble())
            ) %>% 
              as_tibble() %>% 
              select(classid = value),
            model[["formation.fit"]][["coef"]] %>% names() %>% as_tibble() %>% select(name = value),
            summary[["formation"]][["coefs"]][["Estimate"]] %>% as_tibble() %>% select(form_coef = value),
            summary[["formation"]][["coefs"]][["Std. Error"]] %>% as_tibble() %>% select(form_se = value), 
            summary[["dissolution"]][["coefs"]][["Estimate"]] %>% as_tibble() %>% select(diss_coef = value),
            summary[["dissolution"]][["coefs"]][["Std. Error"]] %>% as_tibble() %>% select(diss_se = value)
          )
        )
    }, 
    error = function(e){cat("ERROR :", conditionMessage(e), "\n")})
}

results %>% write_csv("results_v2.csv")

Level 1 Formation

read_csv("results_v2.csv") %>%
  filter(name == "nodefactor.reservation.1") %>% 
  mutate(coef = form_coef, var = form_se * form_se) %>% 
  filter(is.finite(coef), is.finite(var)) %>% 
  rma(coef, var, data = ., method = "REML")
## 
## Random-Effects Model (k = 153; tau^2 estimator: REML)
## 
## tau^2 (estimated amount of total heterogeneity): 0.0021 (SE = 0.0007)
## tau (square root of estimated tau^2 value):      0.0457
## I^2 (total heterogeneity / total variability):   38.41%
## H^2 (total variability / sampling variability):  1.62
## 
## Test for Heterogeneity:
## Q(df = 152) = 247.4486, p-val < .0001
## 
## Model Results:
## 
## estimate      se    zval    pval    ci.lb   ci.ub 
##   0.0095  0.0066  1.4307  0.1525  -0.0035  0.0224    
## 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
read_csv("results_v2.csv") %>%
  filter(name == "nodefactor.female.1") %>% 
  mutate(coef = form_coef, var = form_se * form_se) %>% 
  filter(is.finite(coef), is.finite(var)) %>% 
  rma(coef, var, data = ., method = "REML")
## 
## Random-Effects Model (k = 152; tau^2 estimator: REML)
## 
## tau^2 (estimated amount of total heterogeneity): 0.0044 (SE = 0.0012)
## tau (square root of estimated tau^2 value):      0.0667
## I^2 (total heterogeneity / total variability):   47.35%
## H^2 (total variability / sampling variability):  1.90
## 
## Test for Heterogeneity:
## Q(df = 151) = 296.6546, p-val < .0001
## 
## Model Results:
## 
## estimate      se     zval    pval    ci.lb    ci.ub 
##  -0.0443  0.0093  -4.7605  <.0001  -0.0625  -0.0261  *** 
## 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
read_csv("results_v2.csv") %>%
  filter(name == "nodefactor.area.2") %>% 
  mutate(coef = form_coef, var = form_se * form_se) %>% 
  filter(is.finite(coef), is.finite(var)) %>% 
  rma(coef, var, data = ., method = "REML")
## 
## Random-Effects Model (k = 155; tau^2 estimator: REML)
## 
## tau^2 (estimated amount of total heterogeneity): 0.0016 (SE = 0.0007)
## tau (square root of estimated tau^2 value):      0.0401
## I^2 (total heterogeneity / total variability):   27.81%
## H^2 (total variability / sampling variability):  1.39
## 
## Test for Heterogeneity:
## Q(df = 154) = 235.8977, p-val < .0001
## 
## Model Results:
## 
## estimate      se     zval    pval    ci.lb   ci.ub 
##  -0.0056  0.0067  -0.8375  0.4023  -0.0188  0.0076    
## 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
read_csv("results_v2.csv") %>%
  filter(name == "nodefactor.ses.2") %>% 
  mutate(coef = form_coef, var = form_se * form_se) %>% 
  filter(is.finite(coef), is.finite(var)) %>% 
  rma(coef, var, data = ., method = "REML")
## 
## Random-Effects Model (k = 156; tau^2 estimator: REML)
## 
## tau^2 (estimated amount of total heterogeneity): 0.0012 (SE = 0.0006)
## tau (square root of estimated tau^2 value):      0.0347
## I^2 (total heterogeneity / total variability):   21.53%
## H^2 (total variability / sampling variability):  1.27
## 
## Test for Heterogeneity:
## Q(df = 155) = 221.1349, p-val = 0.0004
## 
## Model Results:
## 
## estimate      se     zval    pval    ci.lb    ci.ub 
##  -0.0160  0.0064  -2.4939  0.0126  -0.0287  -0.0034  * 
## 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
read_csv("results_v2.csv") %>%
  filter(name == "nodefactor.ses.3") %>% 
  mutate(coef = form_coef, var = form_se * form_se) %>% 
  filter(is.finite(coef), is.finite(var)) %>% 
  rma(coef, var, data = ., method = "REML")
## 
## Random-Effects Model (k = 146; tau^2 estimator: REML)
## 
## tau^2 (estimated amount of total heterogeneity): 0.0007 (SE = 0.0006)
## tau (square root of estimated tau^2 value):      0.0260
## I^2 (total heterogeneity / total variability):   11.01%
## H^2 (total variability / sampling variability):  1.12
## 
## Test for Heterogeneity:
## Q(df = 145) = 188.7776, p-val = 0.0085
## 
## Model Results:
## 
## estimate      se     zval    pval    ci.lb    ci.ub 
##  -0.0202  0.0068  -2.9960  0.0027  -0.0335  -0.0070  ** 
## 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
read_csv("results_v2.csv") %>%
  filter(name == "nodecov.score") %>% 
  mutate(coef = form_coef, var = form_se * form_se) %>% 
  filter(is.finite(coef), is.finite(var)) %>% 
  rma(coef, var, data = ., method = "REML")
## 
## Random-Effects Model (k = 156; tau^2 estimator: REML)
## 
## tau^2 (estimated amount of total heterogeneity): 0.0054 (SE = 0.0020)
## tau (square root of estimated tau^2 value):      0.0738
## I^2 (total heterogeneity / total variability):   30.79%
## H^2 (total variability / sampling variability):  1.44
## 
## Test for Heterogeneity:
## Q(df = 155) = 242.3327, p-val < .0001
## 
## Model Results:
## 
## estimate      se     zval    pval    ci.lb    ci.ub 
##  -0.0355  0.0114  -3.1012  0.0019  -0.0579  -0.0131  ** 
## 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
read_csv("results_v2.csv") %>%
  filter(name == "nodematch.reservation") %>% 
  mutate(coef = form_coef, var = form_se * form_se) %>% 
  filter(is.finite(coef), is.finite(var)) %>% 
  rma(coef, var, data = ., method = "REML")
## 
## Random-Effects Model (k = 153; tau^2 estimator: REML)
## 
## tau^2 (estimated amount of total heterogeneity): 0.0026 (SE = 0.0013)
## tau (square root of estimated tau^2 value):      0.0507
## I^2 (total heterogeneity / total variability):   21.57%
## H^2 (total variability / sampling variability):  1.28
## 
## Test for Heterogeneity:
## Q(df = 152) = 204.0432, p-val = 0.0031
## 
## Model Results:
## 
## estimate      se     zval    pval    ci.lb    ci.ub 
##  -0.0212  0.0093  -2.2821  0.0225  -0.0393  -0.0030  * 
## 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
read_csv("results_v2.csv") %>%
  filter(name == "nodematch.female") %>% 
  mutate(coef = form_coef, var = form_se * form_se) %>% 
  filter(is.finite(coef), is.finite(var)) %>% 
  rma(coef, var, data = ., method = "REML")
## 
## Random-Effects Model (k = 152; tau^2 estimator: REML)
## 
## tau^2 (estimated amount of total heterogeneity): 0.0062 (SE = 0.0019)
## tau (square root of estimated tau^2 value):      0.0788
## I^2 (total heterogeneity / total variability):   38.75%
## H^2 (total variability / sampling variability):  1.63
## 
## Test for Heterogeneity:
## Q(df = 151) = 243.5342, p-val < .0001
## 
## Model Results:
## 
## estimate      se      zval    pval    ci.lb    ci.ub 
##  -0.2208  0.0115  -19.1419  <.0001  -0.2434  -0.1982  *** 
## 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
read_csv("results_v2.csv") %>%
  filter(name == "nodematch.area") %>% 
  mutate(coef = form_coef, var = form_se * form_se) %>% 
  filter(is.finite(coef), is.finite(var)) %>% 
  rma(coef, var, data = ., method = "REML")
## 
## Random-Effects Model (k = 155; tau^2 estimator: REML)
## 
## tau^2 (estimated amount of total heterogeneity): 0.0006 (SE = 0.0010)
## tau (square root of estimated tau^2 value):      0.0253
## I^2 (total heterogeneity / total variability):   5.58%
## H^2 (total variability / sampling variability):  1.06
## 
## Test for Heterogeneity:
## Q(df = 154) = 198.2115, p-val = 0.0094
## 
## Model Results:
## 
## estimate      se     zval    pval    ci.lb   ci.ub 
##  -0.0007  0.0087  -0.0778  0.9380  -0.0178  0.0165    
## 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
read_csv("results_v2.csv") %>%
  filter(name == "nodematch.ses") %>% 
  mutate(coef = form_coef, var = form_se * form_se) %>% 
  filter(is.finite(coef), is.finite(var)) %>% 
  rma(coef, var, data = ., method = "REML")
## 
## Random-Effects Model (k = 156; tau^2 estimator: REML)
## 
## tau^2 (estimated amount of total heterogeneity): 0.0009 (SE = 0.0010)
## tau (square root of estimated tau^2 value):      0.0294
## I^2 (total heterogeneity / total variability):   7.97%
## H^2 (total variability / sampling variability):  1.09
## 
## Test for Heterogeneity:
## Q(df = 155) = 182.9541, p-val = 0.0620
## 
## Model Results:
## 
## estimate      se     zval    pval    ci.lb    ci.ub 
##  -0.0171  0.0085  -2.0110  0.0443  -0.0338  -0.0004  * 
## 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
read_csv("results_v2.csv") %>%
  filter(name == "absdiff.score") %>% 
  mutate(coef = form_coef, var = form_se * form_se) %>% 
  filter(is.finite(coef), is.finite(var)) %>% 
  rma(coef, var, data = ., method = "REML")
## 
## Random-Effects Model (k = 156; tau^2 estimator: REML)
## 
## tau^2 (estimated amount of total heterogeneity): 0.0156 (SE = 0.0066)
## tau (square root of estimated tau^2 value):      0.1250
## I^2 (total heterogeneity / total variability):   25.89%
## H^2 (total variability / sampling variability):  1.35
## 
## Test for Heterogeneity:
## Q(df = 155) = 221.9955, p-val = 0.0003
## 
## Model Results:
## 
## estimate      se    zval    pval    ci.lb   ci.ub 
##   0.0209  0.0208  1.0063  0.3143  -0.0198  0.0616    
## 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
read_csv("results_v2.csv") %>%
  filter(name == "mutual") %>% 
  mutate(coef = form_coef, var = form_se * form_se) %>% 
  filter(is.finite(coef), is.finite(var)) %>% 
  rma(coef, var, data = ., method = "REML")
## 
## Random-Effects Model (k = 156; tau^2 estimator: REML)
## 
## tau^2 (estimated amount of total heterogeneity): 0.0992 (SE = 0.0143)
## tau (square root of estimated tau^2 value):      0.3150
## I^2 (total heterogeneity / total variability):   83.80%
## H^2 (total variability / sampling variability):  6.17
## 
## Test for Heterogeneity:
## Q(df = 155) = 869.4830, p-val < .0001
## 
## Model Results:
## 
## estimate      se     zval    pval   ci.lb   ci.ub 
##   1.3046  0.0287  45.4406  <.0001  1.2484  1.3609  *** 
## 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
read_csv("results_v2.csv") %>%
  filter(name == "gwesp") %>% 
  mutate(coef = form_coef, var = form_se * form_se) %>% 
  filter(is.finite(coef), is.finite(var)) %>% 
  rma(coef, var, data = ., method = "REML")
## 
## Random-Effects Model (k = 156; tau^2 estimator: REML)
## 
## tau^2 (estimated amount of total heterogeneity): 0.0312 (SE = 0.0051)
## tau (square root of estimated tau^2 value):      0.1768
## I^2 (total heterogeneity / total variability):   79.33%
## H^2 (total variability / sampling variability):  4.84
## 
## Test for Heterogeneity:
## Q(df = 155) = 790.6077, p-val < .0001
## 
## Model Results:
## 
## estimate      se     zval    pval   ci.lb   ci.ub 
##   0.5227  0.0175  29.8393  <.0001  0.4883  0.5570  *** 
## 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
read_csv("results_v2.csv") %>%
  filter(name == "gwesp.decay") %>% 
  mutate(coef = form_coef, var = form_se * form_se) %>% 
  filter(is.finite(coef), is.finite(var)) %>% 
  rma(coef, var, data = ., method = "REML")
## 
## Random-Effects Model (k = 156; tau^2 estimator: REML)
## 
## tau^2 (estimated amount of total heterogeneity): 0.0534 (SE = 0.0091)
## tau (square root of estimated tau^2 value):      0.2310
## I^2 (total heterogeneity / total variability):   77.94%
## H^2 (total variability / sampling variability):  4.53
## 
## Test for Heterogeneity:
## Q(df = 155) = 552.6290, p-val < .0001
## 
## Model Results:
## 
## estimate      se     zval    pval   ci.lb   ci.ub 
##   0.8757  0.0236  37.1248  <.0001  0.8295  0.9219  *** 
## 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Level 1 persistence

read_csv("results_v2.csv") %>%
  filter(name == "nodefactor.reservation.1") %>% 
  mutate(coef = diss_coef, var = diss_se * diss_se) %>% 
  filter(is.finite(coef), is.finite(var)) %>% 
  rma(coef, var, data = ., method = "REML")
## 
## Random-Effects Model (k = 138; tau^2 estimator: REML)
## 
## tau^2 (estimated amount of total heterogeneity): 0 (SE = 0.0068)
## tau (square root of estimated tau^2 value):      0
## I^2 (total heterogeneity / total variability):   0.00%
## H^2 (total variability / sampling variability):  1.00
## 
## Test for Heterogeneity:
## Q(df = 137) = 126.4267, p-val = 0.7309
## 
## Model Results:
## 
## estimate      se    zval    pval    ci.lb   ci.ub 
##   0.0018  0.0224  0.0823  0.9344  -0.0421  0.0458    
## 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
read_csv("results_v2.csv") %>%
  filter(name == "nodefactor.female.1") %>% 
  mutate(coef = diss_coef, var = diss_se * diss_se) %>% 
  filter(is.finite(coef), is.finite(var)) %>% 
  rma(coef, var, data = ., method = "REML")
## 
## Random-Effects Model (k = 145; tau^2 estimator: REML)
## 
## tau^2 (estimated amount of total heterogeneity): 0.0059 (SE = 0.0050)
## tau (square root of estimated tau^2 value):      0.0768
## I^2 (total heterogeneity / total variability):   11.99%
## H^2 (total variability / sampling variability):  1.14
## 
## Test for Heterogeneity:
## Q(df = 144) = 169.0677, p-val = 0.0752
## 
## Model Results:
## 
## estimate      se    zval    pval    ci.lb   ci.ub 
##   0.0238  0.0191  1.2417  0.2143  -0.0137  0.0613    
## 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
read_csv("results_v2.csv") %>%
  filter(name == "nodefactor.area.2") %>% 
  mutate(coef = diss_coef, var = diss_se * diss_se) %>% 
  filter(is.finite(coef), is.finite(var)) %>% 
  rma(coef, var, data = ., method = "REML")
## 
## Random-Effects Model (k = 139; tau^2 estimator: REML)
## 
## tau^2 (estimated amount of total heterogeneity): 0.0024 (SE = 0.0084)
## tau (square root of estimated tau^2 value):      0.0487
## I^2 (total heterogeneity / total variability):   2.74%
## H^2 (total variability / sampling variability):  1.03
## 
## Test for Heterogeneity:
## Q(df = 138) = 152.8217, p-val = 0.1836
## 
## Model Results:
## 
## estimate      se     zval    pval    ci.lb   ci.ub 
##  -0.0067  0.0251  -0.2684  0.7884  -0.0560  0.0425    
## 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
read_csv("results_v2.csv") %>%
  filter(name == "nodefactor.ses.2") %>% 
  mutate(coef = diss_coef, var = diss_se * diss_se) %>% 
  filter(is.finite(coef), is.finite(var)) %>% 
  rma(coef, var, data = ., method = "REML")
## 
## Random-Effects Model (k = 145; tau^2 estimator: REML)
## 
## tau^2 (estimated amount of total heterogeneity): 0 (SE = 0.0086)
## tau (square root of estimated tau^2 value):      0
## I^2 (total heterogeneity / total variability):   0.00%
## H^2 (total variability / sampling variability):  1.00
## 
## Test for Heterogeneity:
## Q(df = 144) = 158.5095, p-val = 0.1930
## 
## Model Results:
## 
## estimate      se    zval    pval    ci.lb   ci.ub 
##   0.0102  0.0254  0.4016  0.6880  -0.0396  0.0601    
## 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
read_csv("results_v2.csv") %>%
  filter(name == "nodefactor.ses.3") %>% 
  mutate(coef = diss_coef, var = diss_se * diss_se) %>% 
  filter(is.finite(coef), is.finite(var)) %>% 
  rma(coef, var, data = ., method = "REML")
## 
## Random-Effects Model (k = 138; tau^2 estimator: REML)
## 
## tau^2 (estimated amount of total heterogeneity): 0.0148 (SE = 0.0153)
## tau (square root of estimated tau^2 value):      0.1217
## I^2 (total heterogeneity / total variability):   10.42%
## H^2 (total variability / sampling variability):  1.12
## 
## Test for Heterogeneity:
## Q(df = 137) = 164.7158, p-val = 0.0534
## 
## Model Results:
## 
## estimate      se     zval    pval    ci.lb   ci.ub 
##  -0.0137  0.0327  -0.4175  0.6763  -0.0779  0.0505    
## 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
read_csv("results_v2.csv") %>%
  filter(name == "nodecov.score") %>% 
  mutate(coef = diss_coef, var = diss_se * diss_se) %>% 
  filter(is.finite(coef), is.finite(var)) %>% 
  rma(coef, var, data = ., method = "REML")
## 
## Random-Effects Model (k = 145; tau^2 estimator: REML)
## 
## tau^2 (estimated amount of total heterogeneity): 0.0000 (SE = 0.0263)
## tau (square root of estimated tau^2 value):      0.0014
## I^2 (total heterogeneity / total variability):   0.00%
## H^2 (total variability / sampling variability):  1.00
## 
## Test for Heterogeneity:
## Q(df = 144) = 143.9231, p-val = 0.4861
## 
## Model Results:
## 
## estimate      se    zval    pval    ci.lb   ci.ub 
##   0.0263  0.0425  0.6190  0.5359  -0.0570  0.1096    
## 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
read_csv("results_v2.csv") %>%
  filter(name == "nodematch.reservation") %>% 
  mutate(coef = diss_coef, var = diss_se * diss_se) %>% 
  filter(is.finite(coef), is.finite(var)) %>% 
  rma(coef, var, data = ., method = "REML")
## 
## Random-Effects Model (k = 138; tau^2 estimator: REML)
## 
## tau^2 (estimated amount of total heterogeneity): 0 (SE = 0.0127)
## tau (square root of estimated tau^2 value):      0
## I^2 (total heterogeneity / total variability):   0.00%
## H^2 (total variability / sampling variability):  1.00
## 
## Test for Heterogeneity:
## Q(df = 137) = 109.6581, p-val = 0.9587
## 
## Model Results:
## 
## estimate      se     zval    pval    ci.lb   ci.ub 
##  -0.0546  0.0299  -1.8236  0.0682  -0.1133  0.0041  . 
## 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
read_csv("results_v2.csv") %>%
  filter(name == "nodematch.female") %>% 
  mutate(coef = diss_coef, var = diss_se * diss_se) %>% 
  filter(is.finite(coef), is.finite(var)) %>% 
  rma(coef, var, data = ., method = "REML")
## 
## Random-Effects Model (k = 145; tau^2 estimator: REML)
## 
## tau^2 (estimated amount of total heterogeneity): 0.0188 (SE = 0.0241)
## tau (square root of estimated tau^2 value):      0.1372
## I^2 (total heterogeneity / total variability):   7.89%
## H^2 (total variability / sampling variability):  1.09
## 
## Test for Heterogeneity:
## Q(df = 144) = 156.8294, p-val = 0.2196
## 
## Model Results:
## 
## estimate      se     zval    pval    ci.lb    ci.ub 
##  -0.1957  0.0413  -4.7357  <.0001  -0.2767  -0.1147  *** 
## 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
read_csv("results_v2.csv") %>%
  filter(name == "nodematch.area") %>% 
  mutate(coef = diss_coef, var = diss_se * diss_se) %>% 
  filter(is.finite(coef), is.finite(var)) %>% 
  rma(coef, var, data = ., method = "REML")
## 
## Random-Effects Model (k = 139; tau^2 estimator: REML)
## 
## tau^2 (estimated amount of total heterogeneity): 0.0013 (SE = 0.0149)
## tau (square root of estimated tau^2 value):      0.0357
## I^2 (total heterogeneity / total variability):   0.87%
## H^2 (total variability / sampling variability):  1.01
## 
## Test for Heterogeneity:
## Q(df = 138) = 133.5736, p-val = 0.5906
## 
## Model Results:
## 
## estimate      se    zval    pval    ci.lb   ci.ub 
##   0.0054  0.0325  0.1675  0.8669  -0.0583  0.0692    
## 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
read_csv("results_v2.csv") %>%
  filter(name == "nodematch.ses") %>% 
  mutate(coef = diss_coef, var = diss_se * diss_se) %>% 
  filter(is.finite(coef), is.finite(var)) %>% 
  rma(coef, var, data = ., method = "REML")
## 
## Random-Effects Model (k = 144; tau^2 estimator: REML)
## 
## tau^2 (estimated amount of total heterogeneity): 0.0266 (SE = 0.0171)
## tau (square root of estimated tau^2 value):      0.1631
## I^2 (total heterogeneity / total variability):   17.27%
## H^2 (total variability / sampling variability):  1.21
## 
## Test for Heterogeneity:
## Q(df = 143) = 162.5088, p-val = 0.1263
## 
## Model Results:
## 
## estimate      se     zval    pval    ci.lb   ci.ub 
##  -0.0464  0.0335  -1.3840  0.1663  -0.1120  0.0193    
## 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
read_csv("results_v2.csv") %>%
  filter(name == "absdiff.score") %>% 
  mutate(coef = diss_coef, var = diss_se * diss_se) %>% 
  filter(is.finite(coef), is.finite(var)) %>% 
  rma(coef, var, data = ., method = "REML")
## 
## Random-Effects Model (k = 145; tau^2 estimator: REML)
## 
## tau^2 (estimated amount of total heterogeneity): 0 (SE = 0.0781)
## tau (square root of estimated tau^2 value):      0
## I^2 (total heterogeneity / total variability):   0.00%
## H^2 (total variability / sampling variability):  1.00
## 
## Test for Heterogeneity:
## Q(df = 144) = 108.2767, p-val = 0.9884
## 
## Model Results:
## 
## estimate      se    zval    pval    ci.lb   ci.ub 
##   0.1026  0.0719  1.4272  0.1535  -0.0383  0.2434    
## 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
read_csv("results_v2.csv") %>%
  filter(name == "mutual") %>% 
  mutate(coef = diss_coef, var = diss_se * diss_se) %>% 
  filter(is.finite(coef), is.finite(var)) %>% 
  rma(coef, var, data = ., method = "REML")
## 
## Random-Effects Model (k = 130; tau^2 estimator: REML)
## 
## tau^2 (estimated amount of total heterogeneity): 0.2927 (SE = 0.0834)
## tau (square root of estimated tau^2 value):      0.5410
## I^2 (total heterogeneity / total variability):   44.59%
## H^2 (total variability / sampling variability):  1.80
## 
## Test for Heterogeneity:
## Q(df = 129) = 228.3006, p-val < .0001
## 
## Model Results:
## 
## estimate      se     zval    pval   ci.lb   ci.ub 
##   1.6359  0.0737  22.2018  <.0001  1.4915  1.7803  *** 
## 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
read_csv("results_v2.csv") %>%
  filter(name == "gwesp") %>% 
  mutate(coef = diss_coef, var = diss_se * diss_se) %>% 
  filter(is.finite(coef), is.finite(var)) %>% 
  rma(coef, var, data = ., method = "REML")
## 
## Random-Effects Model (k = 121; tau^2 estimator: REML)
## 
## tau^2 (estimated amount of total heterogeneity): 0.0726 (SE = 0.0247)
## tau (square root of estimated tau^2 value):      0.2694
## I^2 (total heterogeneity / total variability):   39.57%
## H^2 (total variability / sampling variability):  1.65
## 
## Test for Heterogeneity:
## Q(df = 120) = 194.9123, p-val < .0001
## 
## Model Results:
## 
## estimate      se     zval    pval   ci.lb   ci.ub 
##   0.6392  0.0424  15.0638  <.0001  0.5560  0.7224  *** 
## 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
read_csv("results_v2.csv") %>%
  filter(name == "gwesp.decay") %>% 
  mutate(coef = diss_coef, var = diss_se * diss_se) %>% 
  filter(is.finite(coef), is.finite(var)) %>% 
  rma(coef, var, data = ., method = "REML")
## 
## Random-Effects Model (k = 99; tau^2 estimator: REML)
## 
## tau^2 (estimated amount of total heterogeneity): 0.2412 (SE = 0.0980)
## tau (square root of estimated tau^2 value):      0.4911
## I^2 (total heterogeneity / total variability):   74.08%
## H^2 (total variability / sampling variability):  3.86
## 
## Test for Heterogeneity:
## Q(df = 98) = 830.8170, p-val < .0001
## 
## Model Results:
## 
## estimate      se     zval    pval    ci.lb    ci.ub 
##  -0.6471  0.0990  -6.5395  <.0001  -0.8410  -0.4531  *** 
## 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Level 2 formation

read_csv("results_v2.csv") %>%
  left_join(read_rds("controls.Rds"), by = "classid") %>% 
  filter(name == "nodematch.reservation") %>% 
  mutate(coef = form_coef, var = form_se * form_se) %>% 
  filter(is.finite(coef), is.finite(var)) %>% 
  rma(coef, var, data = ., method = "REML", mods = ~ elite)
## 
## Mixed-Effects Model (k = 153; tau^2 estimator: REML)
## 
## tau^2 (estimated amount of residual heterogeneity):     0.0027 (SE = 0.0013)
## tau (square root of estimated tau^2 value):             0.0517
## I^2 (residual heterogeneity / unaccounted variability): 22.20%
## H^2 (unaccounted variability / sampling variability):   1.29
## R^2 (amount of heterogeneity accounted for):            0.00%
## 
## Test for Residual Heterogeneity:
## QE(df = 151) = 204.0355, p-val = 0.0026
## 
## Test of Moderators (coefficient 2):
## QM(df = 1) = 0.0005, p-val = 0.9817
## 
## Model Results:
## 
##          estimate      se     zval    pval    ci.lb    ci.ub 
## intrcpt   -0.0211  0.0103  -2.0512  0.0403  -0.0413  -0.0009  * 
## elite     -0.0006  0.0242  -0.0229  0.9817  -0.0480   0.0469    
## 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
read_csv("results_v2.csv") %>%
  left_join(read_rds("controls.Rds"), by = "classid") %>% 
  filter(name == "nodematch.reservation") %>% 
  mutate(coef = form_coef, var = form_se * form_se) %>% 
  filter(is.finite(coef), is.finite(var)) %>% 
  rma(coef, var, data = ., method = "REML", mods = ~ stu_res_actual)
## 
## Mixed-Effects Model (k = 153; tau^2 estimator: REML)
## 
## tau^2 (estimated amount of residual heterogeneity):     0.0026 (SE = 0.0013)
## tau (square root of estimated tau^2 value):             0.0514
## I^2 (residual heterogeneity / unaccounted variability): 22.03%
## H^2 (unaccounted variability / sampling variability):   1.28
## R^2 (amount of heterogeneity accounted for):            0.00%
## 
## Test for Residual Heterogeneity:
## QE(df = 151) = 203.3212, p-val = 0.0029
## 
## Test of Moderators (coefficient 2):
## QM(df = 1) = 0.7102, p-val = 0.3994
## 
## Model Results:
## 
##                 estimate      se     zval    pval    ci.lb    ci.ub 
## intrcpt          -0.0211  0.0093  -2.2708  0.0232  -0.0394  -0.0029  * 
## stu_res_actual    0.0095  0.0112   0.8427  0.3994  -0.0125   0.0314    
## 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
read_csv("results_v2.csv") %>%
  left_join(read_rds("controls.Rds"), by = "classid") %>% 
  filter(name == "nodematch.reservation") %>% 
  mutate(coef = form_coef, var = form_se * form_se) %>% 
  filter(is.finite(coef), is.finite(var)) %>% 
  rma(coef, var, data = ., method = "REML", mods = ~ fac_res_actual)
## 
## Mixed-Effects Model (k = 153; tau^2 estimator: REML)
## 
## tau^2 (estimated amount of residual heterogeneity):     0.0025 (SE = 0.0013)
## tau (square root of estimated tau^2 value):             0.0503
## I^2 (residual heterogeneity / unaccounted variability): 21.29%
## H^2 (unaccounted variability / sampling variability):   1.27
## R^2 (amount of heterogeneity accounted for):            1.56%
## 
## Test for Residual Heterogeneity:
## QE(df = 151) = 201.7628, p-val = 0.0036
## 
## Test of Moderators (coefficient 2):
## QM(df = 1) = 1.8931, p-val = 0.1689
## 
## Model Results:
## 
##                 estimate      se     zval    pval    ci.lb    ci.ub 
## intrcpt          -0.0212  0.0093  -2.2925  0.0219  -0.0393  -0.0031  * 
## fac_res_actual    0.0132  0.0096   1.3759  0.1689  -0.0056   0.0319    
## 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
read_csv("results_v2.csv") %>%
  left_join(read_rds("controls.Rds"), by = "classid") %>% 
  filter(name == "nodematch.reservation") %>% 
  mutate(coef = form_coef, var = form_se * form_se) %>% 
  filter(is.finite(coef), is.finite(var)) %>% 
  rma(coef, var, data = ., method = "REML", mods = ~ hostel)
## 
## Mixed-Effects Model (k = 153; tau^2 estimator: REML)
## 
## tau^2 (estimated amount of residual heterogeneity):     0.0027 (SE = 0.0013)
## tau (square root of estimated tau^2 value):             0.0517
## I^2 (residual heterogeneity / unaccounted variability): 22.19%
## H^2 (unaccounted variability / sampling variability):   1.29
## R^2 (amount of heterogeneity accounted for):            0.00%
## 
## Test for Residual Heterogeneity:
## QE(df = 151) = 204.0017, p-val = 0.0026
## 
## Test of Moderators (coefficient 2):
## QM(df = 1) = 0.0001, p-val = 0.9931
## 
## Model Results:
## 
##          estimate      se     zval    pval    ci.lb   ci.ub 
## intrcpt   -0.0214  0.0172  -1.2449  0.2132  -0.0550  0.0123    
## hostel     0.0002  0.0204   0.0087  0.9931  -0.0399  0.0402    
## 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
read_csv("results_v2.csv") %>%
  left_join(read_rds("controls.Rds"), by = "classid") %>% 
  filter(name == "nodematch.reservation") %>% 
  mutate(coef = form_coef, var = form_se * form_se) %>% 
  filter(is.finite(coef), is.finite(var)) %>% 
  rma(coef, var, data = ., method = "REML", mods = ~ section)
## 
## Mixed-Effects Model (k = 153; tau^2 estimator: REML)
## 
## tau^2 (estimated amount of residual heterogeneity):     0.0026 (SE = 0.0013)
## tau (square root of estimated tau^2 value):             0.0508
## I^2 (residual heterogeneity / unaccounted variability): 21.61%
## H^2 (unaccounted variability / sampling variability):   1.28
## R^2 (amount of heterogeneity accounted for):            0.00%
## 
## Test for Residual Heterogeneity:
## QE(df = 151) = 203.1087, p-val = 0.0030
## 
## Test of Moderators (coefficient 2):
## QM(df = 1) = 0.4145, p-val = 0.5197
## 
## Model Results:
## 
##          estimate      se     zval    pval    ci.lb   ci.ub 
## intrcpt   -0.0099  0.0199  -0.4970  0.6192  -0.0488  0.0290    
## section   -0.0145  0.0225  -0.6439  0.5197  -0.0585  0.0296    
## 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
read_csv("results_v2.csv") %>%
  left_join(read_rds("controls.Rds"), by = "classid") %>% 
  filter(name == "nodematch.reservation") %>% 
  mutate(coef = form_coef, var = form_se * form_se) %>% 
  filter(is.finite(coef), is.finite(var)) %>% 
  rma(coef, var, data = ., method = "REML", mods = ~ seminars)
## 
## Mixed-Effects Model (k = 153; tau^2 estimator: REML)
## 
## tau^2 (estimated amount of residual heterogeneity):     0.0024 (SE = 0.0013)
## tau (square root of estimated tau^2 value):             0.0493
## I^2 (residual heterogeneity / unaccounted variability): 20.58%
## H^2 (unaccounted variability / sampling variability):   1.26
## R^2 (amount of heterogeneity accounted for):            5.39%
## 
## Test for Residual Heterogeneity:
## QE(df = 151) = 200.6125, p-val = 0.0043
## 
## Test of Moderators (coefficient 2):
## QM(df = 1) = 2.5814, p-val = 0.1081
## 
## Model Results:
## 
##           estimate      se     zval    pval    ci.lb   ci.ub 
## intrcpt    -0.0055  0.0134  -0.4085  0.6829  -0.0317  0.0207    
## seminars   -0.0296  0.0184  -1.6067  0.1081  -0.0657  0.0065    
## 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
read_csv("results_v2.csv") %>%
  left_join(read_rds("controls.Rds"), by = "classid") %>% 
  filter(name == "nodematch.reservation") %>% 
  mutate(coef = form_coef, var = form_se * form_se) %>% 
  filter(is.finite(coef), is.finite(var)) %>% 
  rma(coef, var, data = ., method = "REML", mods = ~ mentors)
## 
## Mixed-Effects Model (k = 153; tau^2 estimator: REML)
## 
## tau^2 (estimated amount of residual heterogeneity):     0.0027 (SE = 0.0013)
## tau (square root of estimated tau^2 value):             0.0521
## I^2 (residual heterogeneity / unaccounted variability): 22.50%
## H^2 (unaccounted variability / sampling variability):   1.29
## R^2 (amount of heterogeneity accounted for):            0.00%
## 
## Test for Residual Heterogeneity:
## QE(df = 151) = 204.0233, p-val = 0.0026
## 
## Test of Moderators (coefficient 2):
## QM(df = 1) = 0.1662, p-val = 0.6835
## 
## Model Results:
## 
##          estimate      se     zval    pval    ci.lb   ci.ub 
## intrcpt   -0.0276  0.0181  -1.5214  0.1282  -0.0632  0.0080    
## mentors    0.0086  0.0212   0.4077  0.6835  -0.0329  0.0501    
## 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Level 2 persistence

read_csv("results_v2.csv") %>%
  left_join(read_rds("controls.Rds"), by = "classid") %>% 
  filter(name == "nodematch.reservation") %>% 
  mutate(coef = diss_coef, var = diss_se * diss_se) %>% 
  filter(is.finite(coef), is.finite(var)) %>% 
  rma(coef, var, data = ., method = "REML", mods = ~ elite)
## 
## Mixed-Effects Model (k = 138; tau^2 estimator: REML)
## 
## tau^2 (estimated amount of residual heterogeneity):     0 (SE = 0.0128)
## tau (square root of estimated tau^2 value):             0
## I^2 (residual heterogeneity / unaccounted variability): 0.00%
## H^2 (unaccounted variability / sampling variability):   1.00
## R^2 (amount of heterogeneity accounted for):            0.00%
## 
## Test for Residual Heterogeneity:
## QE(df = 136) = 109.0585, p-val = 0.9568
## 
## Test of Moderators (coefficient 2):
## QM(df = 1) = 0.5996, p-val = 0.4387
## 
## Model Results:
## 
##          estimate      se     zval    pval    ci.lb    ci.ub 
## intrcpt   -0.0642  0.0324  -1.9811  0.0476  -0.1278  -0.0007  * 
## elite      0.0653  0.0844   0.7744  0.4387  -0.1000   0.2307    
## 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
read_csv("results_v2.csv") %>%
  left_join(read_rds("controls.Rds"), by = "classid") %>% 
  filter(name == "nodematch.reservation") %>% 
  mutate(coef = diss_coef, var = diss_se * diss_se) %>% 
  filter(is.finite(coef), is.finite(var)) %>% 
  rma(coef, var, data = ., method = "REML", mods = ~ stu_res_actual)
## 
## Mixed-Effects Model (k = 138; tau^2 estimator: REML)
## 
## tau^2 (estimated amount of residual heterogeneity):     0 (SE = 0.0128)
## tau (square root of estimated tau^2 value):             0
## I^2 (residual heterogeneity / unaccounted variability): 0.00%
## H^2 (unaccounted variability / sampling variability):   1.00
## R^2 (amount of heterogeneity accounted for):            0.00%
## 
## Test for Residual Heterogeneity:
## QE(df = 136) = 109.4536, p-val = 0.9542
## 
## Test of Moderators (coefficient 2):
## QM(df = 1) = 0.2045, p-val = 0.6511
## 
## Model Results:
## 
##                 estimate      se     zval    pval    ci.lb   ci.ub 
## intrcpt          -0.0528  0.0302  -1.7498  0.0802  -0.1120  0.0063  . 
## stu_res_actual   -0.0174  0.0385  -0.4522  0.6511  -0.0928  0.0580    
## 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
read_csv("results_v2.csv") %>%
  left_join(read_rds("controls.Rds"), by = "classid") %>% 
  filter(name == "nodematch.reservation") %>% 
  mutate(coef = diss_coef, var = diss_se * diss_se) %>% 
  filter(is.finite(coef), is.finite(var)) %>% 
  rma(coef, var, data = ., method = "REML", mods = ~ fac_res_actual)
## 
## Mixed-Effects Model (k = 138; tau^2 estimator: REML)
## 
## tau^2 (estimated amount of residual heterogeneity):     0 (SE = 0.0128)
## tau (square root of estimated tau^2 value):             0
## I^2 (residual heterogeneity / unaccounted variability): 0.00%
## H^2 (unaccounted variability / sampling variability):   1.00
## R^2 (amount of heterogeneity accounted for):            0.00%
## 
## Test for Residual Heterogeneity:
## QE(df = 136) = 109.3991, p-val = 0.9546
## 
## Test of Moderators (coefficient 2):
## QM(df = 1) = 0.2590, p-val = 0.6108
## 
## Model Results:
## 
##                 estimate      se     zval    pval    ci.lb   ci.ub 
## intrcpt          -0.0543  0.0299  -1.8138  0.0697  -0.1130  0.0044  . 
## fac_res_actual   -0.0151  0.0296  -0.5089  0.6108  -0.0731  0.0429    
## 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
read_csv("results_v2.csv") %>%
  left_join(read_rds("controls.Rds"), by = "classid") %>% 
  filter(name == "nodematch.reservation") %>% 
  mutate(coef = diss_coef, var = diss_se * diss_se) %>% 
  filter(is.finite(coef), is.finite(var)) %>% 
  rma(coef, var, data = ., method = "REML", mods = ~ hostel)
## 
## Mixed-Effects Model (k = 138; tau^2 estimator: REML)
## 
## tau^2 (estimated amount of residual heterogeneity):     0 (SE = 0.0128)
## tau (square root of estimated tau^2 value):             0
## I^2 (residual heterogeneity / unaccounted variability): 0.00%
## H^2 (unaccounted variability / sampling variability):   1.00
## R^2 (amount of heterogeneity accounted for):            0.00%
## 
## Test for Residual Heterogeneity:
## QE(df = 136) = 109.3149, p-val = 0.9551
## 
## Test of Moderators (coefficient 2):
## QM(df = 1) = 0.3432, p-val = 0.5580
## 
## Model Results:
## 
##          estimate      se     zval    pval    ci.lb   ci.ub 
## intrcpt   -0.0303  0.0512  -0.5914  0.5543  -0.1306  0.0700    
## hostel    -0.0370  0.0631  -0.5859  0.5580  -0.1606  0.0867    
## 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
read_csv("results_v2.csv") %>%
  left_join(read_rds("controls.Rds"), by = "classid") %>% 
  filter(name == "nodematch.reservation") %>% 
  mutate(coef = diss_coef, var = diss_se * diss_se) %>% 
  filter(is.finite(coef), is.finite(var)) %>% 
  rma(coef, var, data = ., method = "REML", mods = ~ section)
## 
## Mixed-Effects Model (k = 138; tau^2 estimator: REML)
## 
## tau^2 (estimated amount of residual heterogeneity):     0 (SE = 0.0128)
## tau (square root of estimated tau^2 value):             0
## I^2 (residual heterogeneity / unaccounted variability): 0.00%
## H^2 (unaccounted variability / sampling variability):   1.00
## R^2 (amount of heterogeneity accounted for):            0.00%
## 
## Test for Residual Heterogeneity:
## QE(df = 136) = 109.6234, p-val = 0.9530
## 
## Test of Moderators (coefficient 2):
## QM(df = 1) = 0.0347, p-val = 0.8522
## 
## Model Results:
## 
##          estimate      se     zval    pval    ci.lb   ci.ub 
## intrcpt   -0.0443  0.0626  -0.7088  0.4785  -0.1670  0.0783    
## section   -0.0133  0.0713  -0.1863  0.8522  -0.1529  0.1264    
## 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
read_csv("results_v2.csv") %>%
  left_join(read_rds("controls.Rds"), by = "classid") %>% 
  filter(name == "nodematch.reservation") %>% 
  mutate(coef = diss_coef, var = diss_se * diss_se) %>% 
  filter(is.finite(coef), is.finite(var)) %>% 
  rma(coef, var, data = ., method = "REML", mods = ~ seminars)
## 
## Mixed-Effects Model (k = 138; tau^2 estimator: REML)
## 
## tau^2 (estimated amount of residual heterogeneity):     0 (SE = 0.0128)
## tau (square root of estimated tau^2 value):             0
## I^2 (residual heterogeneity / unaccounted variability): 0.00%
## H^2 (unaccounted variability / sampling variability):   1.00
## R^2 (amount of heterogeneity accounted for):            0.00%
## 
## Test for Residual Heterogeneity:
## QE(df = 136) = 108.6269, p-val = 0.9595
## 
## Test of Moderators (coefficient 2):
## QM(df = 1) = 1.0313, p-val = 0.3099
## 
## Model Results:
## 
##           estimate      se     zval    pval    ci.lb   ci.ub 
## intrcpt    -0.0212  0.0444  -0.4776  0.6329  -0.1083  0.0659    
## seminars   -0.0611  0.0601  -1.0155  0.3099  -0.1789  0.0568    
## 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
read_csv("results_v2.csv") %>%
  left_join(read_rds("controls.Rds"), by = "classid") %>% 
  filter(name == "nodematch.reservation") %>% 
  mutate(coef = diss_coef, var = diss_se * diss_se) %>% 
  filter(is.finite(coef), is.finite(var)) %>% 
  rma(coef, var, data = ., method = "REML", mods = ~ mentors)
## 
## Mixed-Effects Model (k = 138; tau^2 estimator: REML)
## 
## tau^2 (estimated amount of residual heterogeneity):     0 (SE = 0.0128)
## tau (square root of estimated tau^2 value):             0
## I^2 (residual heterogeneity / unaccounted variability): 0.00%
## H^2 (unaccounted variability / sampling variability):   1.00
## R^2 (amount of heterogeneity accounted for):            0.00%
## 
## Test for Residual Heterogeneity:
## QE(df = 136) = 109.3920, p-val = 0.9546
## 
## Test of Moderators (coefficient 2):
## QM(df = 1) = 0.2661, p-val = 0.6059
## 
## Model Results:
## 
##          estimate      se     zval    pval    ci.lb   ci.ub 
## intrcpt   -0.0788  0.0557  -1.4157  0.1569  -0.1879  0.0303    
## mentors    0.0341  0.0660   0.5159  0.6059  -0.0953  0.1635    
## 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1