[R-meta] Plotting interaction effect from a rma.mv() fit

Michael Dewey ||@t@ @end|ng |rom dewey@myzen@co@uk
Tue Mar 16 17:39:16 CET 2021


Dear Simon

If you do not want to load extra packages effect plots (or something 
similar) can be obtained with forest.default() once your have the 
required data from predict().

Michael

On 16/03/2021 14:25, Simon Harmel wrote:
> Highly appreciated, Wolfgang!
> 
> 
> 
> On Tue, Mar 16, 2021 at 5:12 AM Viechtbauer, Wolfgang (SP) <
> wolfgang.viechtbauer using maastrichtuniversity.nl> wrote:
> 
>> Dear Simon,
>>
>> Not aware of any packages that interface with rma.mv, but this is
>> relatively easy to do by hand. Just use predict() with the newmods argument
>> to compute the predicted values as a function of 'time' for each level of
>> 'outcome' and then create a plot with those lines.
>>
>> Best,
>> Wolfgang
>>
>>> -----Original Message-----
>>> From: R-sig-meta-analysis [mailto:
>> r-sig-meta-analysis-bounces using r-project.org] On
>>> Behalf Of Simon Harmel
>>> Sent: Tuesday, 16 March, 2021 5:25
>>> To: R meta
>>> Subject: [R-meta] Plotting interaction effect from a rma.mv() fit
>>>
>>> Dear All,
>>>
>>> Are there plotting packages (e.g., `effects::plot(allEffects())`,
>>> `sjPlot::plot_model()`, `emmeans::emmip()`  ) to plot the predictions of a
>>> say rma.mv() model?
>>>
>>> For example, is it possible to plot the interaction effect below?
>>>
>>> library(metafor)
>>> dat <- read.csv("https://raw.githubusercontent.com/hkil/m/master/tst.csv
>> ")
>>> fit <- rma.mv(d ~ factor(outcome)*time, V = SE^2, random= ~1|id, data =
>> dat)
>>
> 
> 	[[alternative HTML version deleted]]
> 
> _______________________________________________
> R-sig-meta-analysis mailing list
> R-sig-meta-analysis using r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-meta-analysis
> 

-- 
Michael
http://www.dewey.myzen.co.uk/home.html



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