7.1 Subgroup Analyses using the Mixed-Effects-Model
To conduct subgroup analyses using the Mixed-Effects Model (random-effects model within subgroups, fixed-effects model between subgroups), you can use the
subgroup.analysis.mixed.effects function we prepared for you. This function is part of the
dmetar package. If you have the package installed already, you have to load it from your library first.
If you do not want to use the
dmetar package, you can find the source code for this function here. In this case, R does not know this function yet, so we have to let R learn it by copying and pasting the code in its entirety into the Console on the bottom left pane of RStudio, and then hit Enter ⏎. The function requires the
meta package to work.
subgroup.analysis.mixed.effects function, the following parameters have to be set:
|x||An object of class meta, generated by the metabin, metagen, metacont, metacor, metainc, or metaprop function.|
|subgroups||A character vector of the same length as the number of studies within the meta-analysis, with a unique code for the subgroup each study belongs to. Must have the same order as the studies in the meta object.|
|exclude||Single string or concatenated array of strings. The name(s) of the subgroup levels to be excluded from the subgroup analysis. If ‘none’ (default), all subgroup levels are used for the analysis.|
|plot||Logical. Should a forest plot for the mixed-effect subgroup analysis be generated? Calls the forest.meta function internally. TRUE by default.|
madata dataset, which i used previously to generate my meta-analysis output
m.hksj, i stored the subgroup variable
Control. This variable specifies which control group type was employed in which study. There are three subgroups:
WLC (waitlist control),
no intervention and
The function to do a subgroup analysis using the mixed-effects-model with these parameters looks like this.
subgroup.analysis.mixed.effects(x = m.hksj, subgroups = madata$Control)
## Subgroup Results: ## -------------- ## k TE seTE LLCI ULCI p Q ## information only 3 0.4048358 0.07875304 0.250 0.559 2.739011e-07 1.144426 ## no intervention 8 0.5107720 0.11945084 0.277 0.745 1.902797e-05 16.704467 ## WLC 7 0.7836032 0.20993337 0.372 1.195 1.894924e-04 22.167163 ## I2 I2.lower I2.upper ## information only 0.00 0.00 0.82 ## no intervention 0.58 0.08 0.81 ## WLC 0.73 0.42 0.87 ## ## Test for subgroup differences (mixed/fixed-effects (plural) model): ## -------------- ## Q df p ## Between groups 3.031562 2 0.2196365 ## ## - Total number of studies included in subgroup analysis: 18 ## - Tau estimator used for within-group pooling: SJ
The results of the subgroup analysis are displayed under
Subgroup Results. We also see that, while the pooled effects of the subgroups differ quite substantially (\(g\) = 0.41-0.78), this difference is not statistically significant.
This can be seen under
Test for subgroup differences (mixed/fixed-effects (plural) model) in the
Between groups row. We can see that \(Q=3.03\) and \(p=0.2196\). This information can be reported in our meta-analysis paper. We can also produce a forest plot for the subgroup analysis using
sgame <- subgroup.analysis.mixed.effects(x = m.hksj, subgroups = madata$Control) forest(sgame)