Reputation: 11
I'm trying to get a confidence interval for the I^2 heterogeneity statistic from a fixed-effect meta-analysis I've run using the R package metafor.
It seems like the confint() function doesn't work for fixed effect meta-analyses?
Appreciate any pointers!
Upvotes: 1
Views: 765
Reputation: 615
Newer versions of metafor
(> 4.6) seem to include I^2 in the output of equal/fixed-effects models. It uses the formula based on the Q statistics included in the metafor
FAQ.
I^2 = 100% * (Q-(k-1))/Q
The Q statistic measures the amount of heterogeneity (even if you don't model the heterogeneity in a fixed effects model). If you really need confidence intervals, you could use the bootstrap approach (as explained here for R^2). However, as mentioned by @Emily Kothe, if you think I^2 is very relevant for your data, then a random effects model would probably make more sense (which returns confidence intervals much simpler):
library(metafor)
dat <- escalc(measure="OR", ai=xTi, n1i=nTi, ci=xCi, n2i=nCi, add=1/2,
to="all", data=dat.viechtbauer2021)
fit <- rma(yi, vi, data=dat, method="REML")
confint(fit)
#>
#> estimate ci.lb ci.ub
#> tau^2 0.2943 0.1270 0.6863
#> tau 0.5425 0.3563 0.8284
#> I^2(%) 80.5415 64.1003 90.6119
#> H^2 5.1392 2.7855 10.6518
Created on 2024-12-11 with reprex v2.1.1
Upvotes: 1
Reputation: 872
The assumption of fixed effects meta-analysis is that there is no heterogeneity in the effect. All differences in the observed effects are assumed to be due to sampling variance. As I^2 is the proportion of observed variance attributable to heterogeneity rather than sampling variance, metafor does not estimate an I^2 value when you use a fixed effect model (see below for sample output using fixed and random effects). This is why you cannot obtain the confidence interval around the I^2 value.
library(metafor)
#> Warning: package 'metafor' was built under R version 3.5.2
#> Loading required package: Matrix
#> Loading 'metafor' package (version 2.0-0). For an overview
#> and introduction to the package please type: help(metafor).
rma(yi = yi, vi = vi, data = dat.bangertdrowns2004, method = "FE")
#>
#> Fixed-Effects Model (k = 48)
#>
#> Test for Heterogeneity:
#> Q(df = 47) = 107.1061, p-val < .0001
#>
#> Model Results:
#>
#> estimate se zval pval ci.lb ci.ub
#> 0.1656 0.0269 6.1499 <.0001 0.1128 0.2184 ***
#>
#> ---
#> Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
rma(yi = yi, vi = vi, data = dat.bangertdrowns2004)
#>
#> Random-Effects Model (k = 48; tau^2 estimator: REML)
#>
#> tau^2 (estimated amount of total heterogeneity): 0.0499 (SE = 0.0197)
#> tau (square root of estimated tau^2 value): 0.2235
#> I^2 (total heterogeneity / total variability): 58.37%
#> H^2 (total variability / sampling variability): 2.40
#>
#> Test for Heterogeneity:
#> Q(df = 47) = 107.1061, p-val < .0001
#>
#> Model Results:
#>
#> estimate se zval pval ci.lb ci.ub
#> 0.2219 0.0460 4.8209 <.0001 0.1317 0.3122 ***
#>
#> ---
#> Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Created on 2019-02-16 by the reprex package (v0.2.0).
Upvotes: 1