Skip to content

[R-meta] nesting an inner | outer formula

2 messages · Ross Neville, Wolfgang Viechtbauer

#
Hi Wolfgang
Apologies for not linking this email to the mailing list.
See below.
Regards,
Ross

---------- Forwarded message ---------
From: Ross Neville <ross.neville at ucd.ie>
Date: Mon, 24 Feb 2025 at 10:03
Subject: Re: nesting an inner | outer formula
To: Viechtbauer, Wolfgang (NP) <wolfgang.viechtbauer at maastrichtuniversity.nl
Hi Wolfgang

Thanks so much for this detailed response, and for clarifying the current
position of the metafor package as far as negative variances are concerned.

In the meantime, I have settled on the set of random effects highlighted
yellow in the proc mixed programme below. I would very much like to be able
to reproduce this set of random effects and model (as far as possible) in
rma.mv.

Here's the full proc mixed programme:

proc mixed covtest data=dat2 cl;
class StudyID EstimateID Treatment Informant;
weight InvErr;
model PostInterventionMean = TreatmentGroup*Informant/noint s cl ddfm=sat
residual;
random Treatment/subject=StudyID type=un group=Informant s;
parms 1 1 1 1 1 1 1 1 1 1/hold=10;

The resulting variance components output provides a variance for each
treatment group within each study along with their covariance, grouped by
informant.

How would such a random effect be programmed in rma.mv?

Appreciate your continued correspondence and support.

Regards
Ross

On Wed, 19 Feb 2025 at 08:34, Viechtbauer, Wolfgang (NP) <
wolfgang.viechtbauer at maastrichtuniversity.nl> wrote:

            
-- 
Dr Ross D. Neville, PhD, ProfCert University Teaching and Learning
Head of Subject - Sport Management
School of Public Health, Physiotherapy and Sport Science
University College Dublin (UCD)
Room G6 - Woodview House
Belfield, Dublin 4
ross.neville at ucd.ie
+353 (0) 1 716 3419
#
Hi Ross,

rma.mv() does not have something like the 'group' option, but one should be able to accomplish the same thing with a bit of trickery. In essence, the two levels of Treatment and the three types of informats can be combined into a single variable with 6 levels:

dat$Treatment.Informant <- paste0(dat$Treatment, ".", dat$Informant)

which we then use in 'random' with an unstructured var-cov matrix:

random = ~ Treatment.Informant | StudyID, struct="UN"

This yields a 6x6 var-cov matrix of the random effects. But the model assumes that any covariances/correlations for non-identical informants are zero. So you need to use 'rho = c()' to set these correlations to zero (and use NA to indicate that a correlation should be estimated). See:

https://wviechtb.github.io/metafor/reference/rma.mv.html#fixing-variance-correlation-components

I *think* this should be 'rho = c(NA,0,0,0,0, 0,0,0,0, NA,0,0, 0,0, NA)' but you should double-check this.

This makes the estimation process more complicated, so it might require some pushing and prodding (via different optimizers, optimizer settings, initial values) to get things to converge.

Best,
Wolfgang