The metafor Package

A Meta-Analysis Package for R

User Tools

Site Tools


analyses:raudenbush1985

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
analyses:raudenbush1985 [2022/03/26 14:52] Wolfgang Viechtbaueranalyses:raudenbush1985 [2022/08/03 11:20] (current) Wolfgang Viechtbauer
Line 3: Line 3:
 ==== The Methods and Data ==== ==== The Methods and Data ====
  
-Raudenbush and Bryk (1985) describe the meta-analytic random- and mixed-effects models and describe restricted maximum likelihood estimation for the amount of (residual) heterogeneity (p. 80-82).((Raudenbush and Bryk (1985) do not explicitly mention that they are using restricted maximum likelihood estimation, but equation (27) in their article corresponds to the restricted log likelihood. So don't let the title of the paper confuse you. They do not use the empirical Bayes estimator for the amount of (residual) heterogeneity (e.g., as used by [[analyses:berkey1995|Berkey et al., 1995]]). However, they do obtain empirical Bayes estimates of the study-specific true effects and this is what the title is referring to.)) The models and methods are illustrated with  a meta-analytic dataset of studies examining how teachers' expectations about their pupils can influence actual IQ levels (Raudenbush, 1984). The data are provided in Table 1 and can be loaded with:+Raudenbush and Bryk (1985) describe the meta-analytic random- and mixed-effects models and describe restricted maximum likelihood estimation for the amount of (residual) heterogeneity (p. 80-82).((Raudenbush and Bryk (1985) do not explicitly mention that they are using restricted maximum likelihood estimation, but equation (27) in their article corresponds to the restricted log likelihood. So don't let the title of the paper confuse you. They do not use the empirical Bayes estimator for the amount of (residual) heterogeneity (e.g., as used by [[analyses:berkey1995|Berkey et al., 1995]]). However, they do obtain empirical Bayes estimates of the study-specific true effects and this is what the title is referring to.)) The models and methods are illustrated with  a meta-analytic dataset of studies examining how teachers' expectations about their pupils can influence actual IQ levels (Raudenbush, 1984). The data are provided in Table 1 of the article and can be loaded with:
 <code rsplus> <code rsplus>
 library(metafor) library(metafor)
Line 9: Line 9:
 dat dat
 </code> </code>
-(I copy the dataset into ''dat'', which is a bit shorter and therefore easier to type further below). The contents of the dataset are: +(I copy the dataset into ''dat'', which is a bit shorter and therefore easier to type further below). The contents of the dataset are:
 <code output> <code output>
    study               author year weeks setting tester n1i n2i      yi     vi    study               author year weeks setting tester n1i n2i      yi     vi
Line 49: Line 49:
 H^2 (total variability / sampling variability):  1.72 H^2 (total variability / sampling variability):  1.72
  
-Test for Heterogeneity: +Test for Heterogeneity:
 Q(df = 18) = 35.830, p-val = 0.007 Q(df = 18) = 35.830, p-val = 0.007
  
 Model Results: Model Results:
  
-estimate       se     zval     pval    ci.lb    ci.ub           +estimate     se   zval   pval   ci.lb  ci.ub 
-   0.084    0.052    1.621    0.105   -0.018    0.185          +   0.084  0.052  1.621  0.105  -0.018  0.185
  
 --- ---
-Signif. codes: ***’ 0.001 **’ 0.01 *’ 0.05 .’ 0.1 ‘ ’ 1+Signif. codes: '***0.001 '**0.01 '*0.05 '.0.1 ' ' 1
 </code> </code>
 REML estimation is the default for the ''rma()'' function, so these results reproduce what is reported in the article. In particular, $\hat{\tau}^2 = .019$ (p. 83), $Q(df=18) = 35.83$ (p. 85), $\hat{\mu} = .084$ (p. 85), and $z = 1.62$ (p. 86) for the test $H_0: \mu = 0$. REML estimation is the default for the ''rma()'' function, so these results reproduce what is reported in the article. In particular, $\hat{\tau}^2 = .019$ (p. 83), $Q(df=18) = 35.83$ (p. 85), $\hat{\mu} = .084$ (p. 85), and $z = 1.62$ (p. 86) for the test $H_0: \mu = 0$.
Line 112: Line 112:
 R^2 (amount of heterogeneity accounted for):            100.00% R^2 (amount of heterogeneity accounted for):            100.00%
  
-Test for Residual Heterogeneity: +Test for Residual Heterogeneity:
 QE(df = 17) = 16.571, p-val = 0.484 QE(df = 17) = 16.571, p-val = 0.484
  
-Test of Moderators (coefficient(s) 2): +Test of Moderators (coefficient 2):
 QM(df = 1) = 19.258, p-val < .001 QM(df = 1) = 19.258, p-val < .001
  
 Model Results: Model Results:
  
-         estimate     se    zval   pval   ci.lb   ci.ub     +         estimate     se    zval   pval   ci.lb   ci.ub
 intrcpt     0.407  0.087   4.678  <.001   0.237   0.578  *** intrcpt     0.407  0.087   4.678  <.001   0.237   0.578  ***
 weeks.c    -0.157  0.036  -4.388  <.001  -0.227  -0.087  *** weeks.c    -0.157  0.036  -4.388  <.001  -0.227  -0.087  ***
  
 --- ---
-Signif. codes: ***’ 0.001 **’ 0.01 *’ 0.05 .’ 0.1 ‘ ’ 1+Signif. codes: '***0.001 '**0.01 '*0.05 '.0.1 ' ' 1
 </code> </code>
 These results again match the findings from Raudenbush and Bryk (1985). The residual amount of heterogeneity is now $\hat{\tau}^2 \approx 0$ (p. 90) and the test statistic for $H_0: \tau^2 = 0$ is $Q_E(df=17) = 16.57$ (p. 90). The estimated model is $E(d_i) = .407 - 0.157 x_i$, where $x_i$ is the number of prior contact weeks (p. 90). The standard errors of the model coefficients are $SE[b_0] = .087$ and $SE[b_1] = .036$, so that the test statistics are $z_0 = 4.68$ and $z_1 = -4.39$, respectively (p. 92). These results again match the findings from Raudenbush and Bryk (1985). The residual amount of heterogeneity is now $\hat{\tau}^2 \approx 0$ (p. 90) and the test statistic for $H_0: \tau^2 = 0$ is $Q_E(df=17) = 16.57$ (p. 90). The estimated model is $E(d_i) = .407 - 0.157 x_i$, where $x_i$ is the number of prior contact weeks (p. 90). The standard errors of the model coefficients are $SE[b_0] = .087$ and $SE[b_1] = .036$, so that the test statistics are $z_0 = 4.68$ and $z_1 = -4.39$, respectively (p. 92).
Line 163: Line 163:
 Finally, we can draw a scatterplot of the observed standardized mean differences as a function of the weeks variable (with the radius of the points drawn proportional to the inverse standard errors and hence the area of the points drawn proportional to the inverse sampling variances) with: Finally, we can draw a scatterplot of the observed standardized mean differences as a function of the weeks variable (with the radius of the points drawn proportional to the inverse standard errors and hence the area of the points drawn proportional to the inverse sampling variances) with:
 <code rsplus> <code rsplus>
-preds <- predict(res, newmods=seq(0,3,0.1)) +regplot(res, xlab="Weeks of Prior Contact", bty="l", las=1digits=1refline=0, xaxt="n")
- +
-size <- 1 / sqrt(dat$vi) +
-size <- 0.05 * size / max(size) +
- +
-plot(NA, NA, xlim=c(0,3), ylim=range(dat$yi), bty="l", xaxt="n", +
-     xlab="Weeks of Prior Contact"ylab="Standardized Mean Difference")+
 axis(side=1, at=c(0,1,2,3), labels=c("0", "1", "2", ">2")) axis(side=1, at=c(0,1,2,3), labels=c("0", "1", "2", ">2"))
- 
-symbols(dat$weeks.c, dat$yi, circles=size, inches=FALSE, add=TRUE, bg="black") 
- 
-lines(seq(0,3,0.1), preds$pred) 
-lines(seq(0,3,0.1), preds$ci.lb, lty="dashed") 
-lines(seq(0,3,0.1), preds$ci.ub, lty="dashed") 
- 
-abline(h=0, lty="dotted") 
 </code> </code>
 The predicted (average) effect as a function of the weeks of prior contact (with 95% CI bounds) is also added to the plot. The resulting plot is shown below. The predicted (average) effect as a function of the weeks of prior contact (with 95% CI bounds) is also added to the plot. The resulting plot is shown below.
analyses/raudenbush1985.txt · Last modified: 2022/08/03 11:20 by Wolfgang Viechtbauer