[R-meta] Metafor - regplot() for a categorical (and interaction) variable

Michael Dewey ||@t@ @end|ng |rom dewey@myzen@co@uk
Fri Sep 6 11:04:24 CEST 2024


Dear Emanuel

I think you will find that the parameter is named mods in rma.uni but 
mod in regplot.

Michael

On 06/09/2024 00:56, Emanuel Schembri via R-sig-meta-analysis wrote:
> Hi
> 
> I am trying to plot a bubble plot using the replot() function in
> Metafor. However, I cannot make it work for a categorical moderator
> (and an interaction between a categorical and numerical variable),
> while it does work when inputting a numerical or date.
> 
> Any help would be greatly appreciated.
> 
> Regards,
> 
> Emanuel
> 
> 
> 
> 
> res <- rma(yi, vi, mods = ~ Continent, data= df)
> 
> regplot(res, mods = ~ Continent)
> 
> 
> 
> Mixed-Effects Model (k = 24; tau^2 estimator: REML)
> 
> 
> 
> tau^2 (estimated amount of residual heterogeneity):     3.5128 (SE = 1.1529)
> 
> tau (square root of estimated tau^2 value):             1.8743
> 
> I^2 (residual heterogeneity / unaccounted variability): 99.79%
> 
> H^2 (unaccounted variability / sampling variability):   477.76
> 
> R^2 (amount of heterogeneity accounted for):            8.05%
> 
> 
> 
> Test for Residual Heterogeneity:
> 
> QE(df = 21) = 1150.4471, p-val < .0001
> 
> 
> 
> Test of Moderators (coefficients 2:3):
> 
> QM(df = 2) = 5.7609, p-val = 0.0561
> 
> 
> 
> Model Results:
> 
> 
> 
>                     estimate      se    zval    pval    ci.lb   ci.ub
> 
> intrcpt              2.2738  1.3346  1.7037  0.0884  -0.3420  4.8897  .
> 
> ContinentAsia      4.3152  1.8165  2.3756  0.0175   0.7549  7.8755  *
> 
> ContinentEurope    2.6747  1.4053  1.9032  0.0570  -0.0797  5.4291  .
> 
> 
> 
> ---
> 
> Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
> 
> 
> 
>> regplot(res, mods = ~ Continent)
> 
> Error in regplot.rma(res, mods = ~Continent) :
> 
>    Must specify 'mod' argument for models with multiple predictors.
> 
> _______________________________________________
> R-sig-meta-analysis mailing list @ R-sig-meta-analysis using r-project.org
> To manage your subscription to this mailing list, go to:
> https://stat.ethz.ch/mailman/listinfo/r-sig-meta-analysis
> 

-- 
Michael



More information about the R-sig-meta-analysis mailing list