summary(mod <- rma(yi = g, vi = gvar, method = "REML", test= 't', data = dat, slab = id))
## 
## Random-Effects Model (k = 100; tau^2 estimator: REML)
## 
##    logLik   deviance        AIC        BIC       AICc   
##   71.5281  -143.0562  -139.0562  -133.8659  -138.9312   
## 
## tau^2 (estimated amount of total heterogeneity): 0.0091 (SE = 0.0020)
## tau (square root of estimated tau^2 value):      0.0956
## I^2 (total heterogeneity / total variability):   69.76%
## H^2 (total variability / sampling variability):  3.31
## 
## Test for Heterogeneity:
## Q(df = 99) = 339.2855, p-val < .0001
## 
## Model Results:
## 
## estimate      se     tval  df    pval   ci.lb   ci.ub      
##   0.2333  0.0120  19.4898  99  <.0001  0.2096  0.2571  *** 
## 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
predict(mod)
## 
##    pred     se  ci.lb  ci.ub  pi.lb  pi.ub 
##  0.2333 0.0120 0.2096 0.2571 0.0422 0.4245
influence(mod)
## 
##     rstudent  dffits cook.d  cov.r tau2.del   QE.del    hat weight    dfbs inf 
## 1    -0.3028 -0.0336 0.0011 1.0232   0.0093 338.7833 0.0126 1.2570 -0.0336     
## 2    -0.2222 -0.0247 0.0006 1.0242   0.0093 338.9832 0.0128 1.2821 -0.0247     
## 3    -1.5977 -0.1630 0.0262 0.9959   0.0089 331.9820 0.0102 1.0229 -0.1631     
## 4     0.2875  0.0189 0.0004 1.0078   0.0092 339.1775 0.0042 0.4199  0.0189     
## 5    -0.3061 -0.0311 0.0010 1.0193   0.0093 338.9825 0.0105 1.0493 -0.0311     
## 6     0.8269  0.0937 0.0088 1.0165   0.0092 335.8346 0.0126 1.2632  0.0937     
## 7    -0.3097 -0.0333 0.0011 1.0217   0.0093 338.8677 0.0118 1.1800 -0.0333     
## 8     0.2467  0.0238 0.0006 1.0168   0.0092 339.1541 0.0089 0.8914  0.0238     
## 9    -1.8186 -0.1999 0.0389 0.9875   0.0088 326.3470 0.0117 1.1737 -0.1997     
## 10   -1.3520 -0.1429 0.0202 1.0027   0.0090 333.1681 0.0110 1.0978 -0.1429     
## 11    1.4460  0.1532 0.0232 1.0004   0.0090 332.2210 0.0112 1.1164  0.1531     
## 12   -0.4163 -0.0269 0.0007 1.0074   0.0092 339.0422 0.0042 0.4199 -0.0269     
## 13    1.1221  0.1252 0.0156 1.0096   0.0091 333.5334 0.0123 1.2319  0.1252     
## 14    0.1729  0.0176 0.0003 1.0186   0.0093 339.2146 0.0097 0.9736  0.0176     
## 15    0.4308  0.0392 0.0015 1.0143   0.0092 338.9178 0.0081 0.8073  0.0392     
## 16    1.3255  0.1194 0.0142 1.0028   0.0091 335.7243 0.0081 0.8106  0.1195     
## 17   -1.1765 -0.1260 0.0158 1.0073   0.0091 334.2733 0.0113 1.1303 -0.1260     
## 18   -0.9104 -0.0938 0.0088 1.0122   0.0092 336.7148 0.0105 1.0524 -0.0938     
## 19   -0.1102 -0.0096 0.0001 1.0156   0.0092 339.2563 0.0081 0.8106 -0.0096     
## 20   -0.0834 -0.0089 0.0001 1.0245   0.0093 339.2380 0.0127 1.2711 -0.0089     
## 21    0.5705  0.0635 0.0041 1.0198   0.0092 337.8843 0.0121 1.2138  0.0636     
## 22    1.7491  0.1690 0.0282 0.9924   0.0089 331.8838 0.0094 0.9387  0.1692     
## 23   -1.0558 -0.1174 0.0138 1.0109   0.0091 334.1854 0.0122 1.2189 -0.1174     
## 24    2.3599  0.2590 0.0635 0.9646   0.0085 317.0976 0.0120 1.1985  0.2582     
## 25   -0.2323 -0.0164 0.0003 1.0095   0.0092 339.2013 0.0051 0.5053 -0.0164     
## 26    0.3762  0.0229 0.0005 1.0066   0.0092 339.1071 0.0036 0.3634  0.0229     
## 27   -1.0101 -0.1143 0.0131 1.0124   0.0091 333.9155 0.0126 1.2632 -0.1143     
## 28   -0.5435 -0.0526 0.0028 1.0155   0.0092 338.5237 0.0094 0.9387 -0.0526     
## 29    0.9897  0.1057 0.0112 1.0117   0.0091 335.8706 0.0113 1.1281  0.1057     
## 30   -1.9761 -0.2073 0.0418 0.9830   0.0088 327.1644 0.0107 1.0733 -0.2073     
## 31    0.1991  0.0230 0.0005 1.0239   0.0093 339.1019 0.0126 1.2599  0.0230     
## 32   -0.1286 -0.0110 0.0001 1.0146   0.0092 339.2489 0.0076 0.7644 -0.0110     
## 33    0.1000  0.0092 0.0001 1.0149   0.0092 339.2688 0.0078 0.7756  0.0092     
## 34    0.9564  0.0748 0.0056 1.0067   0.0091 337.8215 0.0061 0.6066  0.0748     
## 35   -0.5613 -0.0620 0.0039 1.0200   0.0092 337.7916 0.0122 1.2217 -0.0620     
## 36    1.6362  0.1823 0.0325 0.9941   0.0089 327.2250 0.0123 1.2313  0.1820     
## 37    0.8477  0.0936 0.0088 1.0153   0.0092 336.2746 0.0120 1.2016  0.0936     
## 38    0.3679  0.0365 0.0013 1.0172   0.0092 338.9570 0.0095 0.9523  0.0365     
## 39    0.9555  0.0707 0.0050 1.0060   0.0091 337.9130 0.0054 0.5434  0.0707     
## 40   -0.2806 -0.0259 0.0007 1.0161   0.0092 339.0979 0.0087 0.8665 -0.0259     
## 41   -0.4386 -0.0466 0.0022 1.0199   0.0092 338.5461 0.0114 1.1380 -0.0466     
## 42   -0.6528 -0.0729 0.0054 1.0190   0.0092 337.1367 0.0124 1.2441 -0.0729     
## 43    0.5242  0.0596 0.0036 1.0212   0.0092 337.9144 0.0126 1.2626  0.0596     
## 44   -0.4244 -0.0463 0.0022 1.0211   0.0093 338.4721 0.0120 1.2001 -0.0463     
## 45   -0.9094 -0.0635 0.0040 1.0056   0.0091 338.0740 0.0049 0.4852 -0.0635     
## 46    2.4977  0.2815 0.0740 0.9560   0.0084 310.3010 0.0125 1.2548  0.2800     
## 47   -0.8032 -0.0909 0.0083 1.0169   0.0092 335.7420 0.0127 1.2727 -0.0910     
## 48   -0.0241 -0.0021 0.0000 1.0228   0.0093 339.2806 0.0118 1.1826 -0.0021     
## 49   -0.3364 -0.0323 0.0011 1.0170   0.0092 338.9895 0.0093 0.9340 -0.0323     
## 50   -1.5033 -0.1654 0.0269 0.9984   0.0090 330.1090 0.0118 1.1826 -0.1653     
## 51    0.6379  0.0722 0.0052 1.0196   0.0092 337.2960 0.0125 1.2548  0.0722     
## 52    1.0777  0.1131 0.0128 1.0095   0.0091 335.5506 0.0109 1.0912  0.1131     
## 53    0.1942  0.0199 0.0004 1.0190   0.0093 339.1910 0.0100 0.9993  0.0199     
## 54   -0.4993 -0.0519 0.0027 1.0184   0.0092 338.4456 0.0108 1.0818 -0.0519     
## 55   -0.1996 -0.0212 0.0005 1.0221   0.0093 339.1124 0.0117 1.1654 -0.0212     
## 56   -1.1990 -0.1028 0.0105 1.0044   0.0091 336.5791 0.0073 0.7290 -0.1028     
## 57    0.4634  0.0404 0.0016 1.0129   0.0092 338.8926 0.0074 0.7412  0.0403     
## 58   -0.4714 -0.0410 0.0017 1.0130   0.0092 338.8410 0.0076 0.7568 -0.0409     
## 59    0.0230  0.0023 0.0000 1.0136   0.0092 339.2851 0.0070 0.7036  0.0023     
## 60   -0.4356 -0.0423 0.0018 1.0166   0.0092 338.7842 0.0095 0.9478 -0.0423     
## 61    1.1420  0.1187 0.0141 1.0080   0.0091 335.2572 0.0107 1.0719  0.1187     
## 62    0.4178  0.0468 0.0022 1.0216   0.0093 338.5352 0.0122 1.2174  0.0468     
## 63    2.2901  0.2530 0.0608 0.9675   0.0085 317.4737 0.0121 1.2131  0.2523     
## 64    0.1037  0.0107 0.0001 1.0187   0.0093 339.2619 0.0097 0.9736  0.0107     
## 65   -0.1956 -0.0208 0.0004 1.0222   0.0093 339.1173 0.0117 1.1691 -0.0208     
## 66   -0.6196 -0.0666 0.0045 1.0181   0.0092 337.7801 0.0115 1.1526 -0.0666     
## 67    0.4754  0.0545 0.0030 1.0221   0.0093 338.0843 0.0128 1.2821  0.0546     
## 68   -0.4721 -0.0364 0.0013 1.0102   0.0092 338.9154 0.0060 0.5957 -0.0364     
## 69    0.3026  0.0347 0.0012 1.0234   0.0093 338.8366 0.0127 1.2659  0.0347     
## 70   -0.9094 -0.0820 0.0067 1.0094   0.0092 337.5547 0.0081 0.8073 -0.0820     
## 71    0.6685  0.0736 0.0054 1.0181   0.0092 337.4839 0.0119 1.1886  0.0736     
## 72   -0.0447 -0.0042 0.0000 1.0210   0.0093 339.2757 0.0109 1.0899 -0.0042     
## 73   -1.0165 -0.0672 0.0045 1.0042   0.0091 337.8421 0.0044 0.4351 -0.0672     
## 74    0.8166  0.0774 0.0060 1.0117   0.0092 337.7881 0.0089 0.8860  0.0774     
## 75    0.2928  0.0270 0.0007 1.0152   0.0092 339.1158 0.0082 0.8205  0.0270     
## 76   -1.2271 -0.1319 0.0173 1.0061   0.0091 333.7591 0.0114 1.1369 -0.1319     
## 77   -0.3497 -0.0365 0.0013 1.0201   0.0093 338.8440 0.0111 1.1054 -0.0365     
## 78   -1.1951 -0.1364 0.0185 1.0078   0.0091 331.4288 0.0128 1.2787 -0.1363     
## 79   -0.6197 -0.0553 0.0031 1.0125   0.0092 338.4876 0.0079 0.7935 -0.0552     
## 80    0.3204  0.0359 0.0013 1.0223   0.0093 338.8606 0.0121 1.2093  0.0359     
## 81    0.7850  0.0604 0.0036 1.0080   0.0092 338.3233 0.0058 0.5846  0.0603     
## 82    0.5357  0.0538 0.0029 1.0165   0.0092 338.5379 0.0099 0.9858  0.0538     
## 83    0.3739  0.0401 0.0016 1.0201   0.0093 338.8274 0.0111 1.1116  0.0401     
## 84   -0.2384 -0.0244 0.0006 1.0201   0.0093 339.0901 0.0107 1.0704 -0.0244     
## 85   -2.9570 -0.3390 0.1043 0.9316   0.0081 301.9409 0.0123 1.2319 -0.3368   * 
## 86    0.8130  0.0890 0.0080 1.0157   0.0092 336.6725 0.0118 1.1800  0.0890     
## 87    0.7190  0.0539 0.0029 1.0081   0.0092 338.5022 0.0056 0.5555  0.0539     
## 88    0.3583  0.0210 0.0004 1.0061   0.0092 339.1271 0.0034 0.3375  0.0210     
## 89   -0.7509 -0.0483 0.0023 1.0058   0.0092 338.5099 0.0041 0.4122 -0.0483     
## 90    0.1142  0.0101 0.0001 1.0140   0.0092 339.2644 0.0073 0.7290  0.0101     
## 91    1.1744  0.1314 0.0172 1.0083   0.0091 332.8763 0.0124 1.2378  0.1313     
## 92   -1.1172 -0.1188 0.0141 1.0086   0.0091 334.9070 0.0112 1.1152 -0.1188     
## 93    0.3632  0.0413 0.0017 1.0227   0.0093 338.6570 0.0125 1.2536  0.0414     
## 94    2.5864  0.2816 0.0743 0.9543   0.0084 314.0590 0.0118 1.1818  0.2807     
## 95   -1.2490 -0.1353 0.0182 1.0057   0.0091 333.3324 0.0115 1.1537 -0.1353     
## 96    0.7834  0.0707 0.0050 1.0111   0.0092 338.0558 0.0080 0.8039  0.0707     
## 97   -0.4675 -0.0522 0.0028 1.0217   0.0093 338.1161 0.0126 1.2576 -0.0523     
## 98   -0.9850 -0.0697 0.0049 1.0051   0.0091 337.8482 0.0050 0.4987 -0.0697     
## 99   -1.1453 -0.1310 0.0171 1.0092   0.0091 331.8642 0.0129 1.2859 -0.1310     
## 100  -0.2611 -0.0279 0.0008 1.0218   0.0093 338.9954 0.0117 1.1663 -0.0279
dat %>% 
  mutate(g_excl = case_when(id == 85~ NA_real_,
                            TRUE~ g)) -> dat
summary(mod2<-rma(yi = g_excl, vi = gvar, mod=~college_deg_perc,  method = "REML", test = 't', data = dat, slab = id))
## Warning: 1 study with NAs omitted from model fitting.
## 
## Mixed-Effects Model (k = 99; tau^2 estimator: REML)
## 
##    logLik   deviance        AIC        BIC       AICc   
##   73.8086  -147.6172  -141.6172  -133.8931  -141.3592   
## 
## tau^2 (estimated amount of residual heterogeneity):     0.0080 (SE = 0.0018)
## tau (square root of estimated tau^2 value):             0.0896
## I^2 (residual heterogeneity / unaccounted variability): 66.75%
## H^2 (unaccounted variability / sampling variability):   3.01
## R^2 (amount of heterogeneity accounted for):            0.51%
## 
## Test for Residual Heterogeneity:
## QE(df = 97) = 297.9967, p-val < .0001
## 
## Test of Moderators (coefficient 2):
## F(df1 = 1, df2 = 97) = 1.4054, p-val = 0.2387
## 
## Model Results:
## 
##                   estimate      se     tval  df    pval    ci.lb   ci.ub      
## intrcpt             0.2637  0.0251  10.4933  97  <.0001   0.2138  0.3135  *** 
## college_deg_perc   -0.0005  0.0004  -1.1855  97  0.2387  -0.0014  0.0003      
## 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
predict(mod2, 81)
## 
##    pred     se  ci.lb  ci.ub  pi.lb  pi.ub 
##  0.2221 0.0172 0.1880 0.2562 0.0411 0.4031
summary(mod<-rma(yi = g_excl, vi = gvar, mod=~us_dc,  method = "REML",test = 't',data = dat, slab = id))
## Warning: 1 study with NAs omitted from model fitting.
## 
## Mixed-Effects Model (k = 99; tau^2 estimator: REML)
## 
##    logLik   deviance        AIC        BIC       AICc   
##   77.6641  -155.3282  -149.3282  -141.6040  -149.0701   
## 
## tau^2 (estimated amount of residual heterogeneity):     0.0071 (SE = 0.0017)
## tau (square root of estimated tau^2 value):             0.0842
## I^2 (residual heterogeneity / unaccounted variability): 63.96%
## H^2 (unaccounted variability / sampling variability):   2.77
## R^2 (amount of heterogeneity accounted for):            12.08%
## 
## Test for Residual Heterogeneity:
## QE(df = 97) = 271.3003, p-val < .0001
## 
## Test of Moderators (coefficient 2):
## F(df1 = 1, df2 = 97) = 9.5415, p-val = 0.0026
## 
## Model Results:
## 
##          estimate      se     tval  df    pval   ci.lb   ci.ub      
## intrcpt    0.2037  0.0155  13.1193  97  <.0001  0.1729  0.2345  *** 
## us_dc      0.0685  0.0222   3.0889  97  0.0026  0.0245  0.1125   ** 
## 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1