5.1 Fixed-Effects-Model
The idea behind the fixed-effects-model
The fixed-effects-model assumes that all observed effect sizes stem from a single true population effect (Borenstein et al. 2011). To calculate the overall effect, we therefore average all effect sizes, but give studies with greater precision a higher weight. Precision relates to the fact that studies with a larger N will provide more accurate estimates of the true population effect, as reflected by a smaller Standard Error of the effect size estimate.
For this weighing, we use the inverse of the variance \(1/\hat\sigma^2_k\) of each study \(k\). We then calculate a weighted average of all studies, our fixed effect size estimator \(\hat\theta_F\):
\[\begin{equation} \hat\theta_F = \frac{\sum\limits_{k=1}^K \hat\theta_k/ \hat\sigma^2_k}{\sum\limits_{k=1}^K 1/\hat\sigma^2_k} \end{equation}\]
First, let’s assume you already have a dataset with the calucated effects and SE for each study. The curry
data set will do (you’ve used it before to practice loading data from Excel).
This dataset has continuous outcome data. As our effect sizes are already calculated, we can directly use the rma
function. For this function, we can specify loads of parameters, all of which you can accessed by typing ?rma
in your console once the metafor
package is loaded, or selecting the function and pressing F1.
Here is a table with the most important parameters for our code:
Parameter | Function |
---|---|
yi | A vector with the effect sizes |
vi | A vector with the sampling variances |
method | A character string, indicating what type of meta-analysis to run. FE runs a fixed-effect model |
Let’s conduct our first fixed-effects-model Meta-Analysis. We we will give the results of this analysis the simple name m
.
m <- rma(yi = df$d, # The d-column of the df, which contains Cohen's d
vi = df$vi, # The vi-column of the df, which contains the variances
method = "FE") # Run a fixed-effect model
m
##
## Fixed-Effects Model (k = 56)
##
## Test for Heterogeneity:
## Q(df = 55) = 156.9109, p-val < .0001
##
## Model Results:
##
## estimate se zval pval ci.lb ci.ub
## 0.2059 0.0219 9.4135 <.0001 0.1630 0.2487 ***
##
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
We now see a summary of the results of our Meta-Analysis, including
- The total number of included studies (k)
- The overall effect (in our case, g = 0.2059) and its confidence interval and p-value
- The Q-test of heterogeneity
The object m
is a list: A collection of different types of data. A data.frame is a special kind of list, where every entry must have the same length. Using the $
command, we can look at parts of the list directly. For example, the estimates of heterogeneity:
m$I2
## [1] 64.94826
m$tau2
## [1] 0
There are many ways to export results from R. The function sink()
redirects
output, which would normally be printed to the console, to a text file:
sink("results.txt")
print(m)
sink()
References
Borenstein, Michael, Larry V Hedges, Julian PT Higgins, and Hannah R Rothstein. 2011. Introduction to Meta-Analysis. John Wiley & Sons.