<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div dir="ltr"><meta http-equiv="content-type" content="text/html; charset=utf-8"><div dir="ltr"></div><div dir="ltr">I am not sure. Setting nearpd = TRUE transforms the vcov matrices in a way that is hard to interpret in substantive terms, and it’s hard to predict the implication of this for the meta-analytic results. </div><div dir="ltr"><br></div><div dir="ltr">As Gerta noted, network meta-analysis methods can deal with multi-arm trials in a principled way. It does so by making use of specialized contrast coding schemes, but the input effect sizes are still all calculated relative to a single control condition per study (e.g., all effects calculated relative to the passive control).</div><div dir="ltr"><br></div><div dir="ltr">James</div><div dir="ltr"><br><blockquote type="cite">On Jun 30, 2024, at 5:22 PM, Andreas Voldstad <andreas.voldstad@kellogg.ox.ac.uk> wrote:<br><br></blockquote></div><blockquote type="cite"><div dir="ltr">

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">


<div>
<div dir="ltr">
<div dir="ltr">Hi James, thank you for responding. Indeed, I am fitting a model across all the contrasts, and metafor did yell at me for the NPD V matrix. Is this a case where it might be appropriate to use the nearpd = T argument in vcalc?<span></span></div>
<div dir="ltr"><br>
</div>
<div dir="ltr">Best wish<span>es,<br>
Andreas</span><span><br>
</span></div>
<div dir="ltr"><br>
</div>
</div>
</div>
<div id="ms-outlook-mobile-signature">
<div><br>
</div>
Sent from <a href="https://aka.ms/o0ukef">Outlook for iOS</a></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> James Pustejovsky <jepusto@gmail.com><br>
<b>Sent:</b> Sunday, June 30, 2024 5:13:32 PM<br>
<b>To:</b> R Special Interest Group for Meta-Analysis <r-sig-meta-analysis@r-project.org><br>
<b>Cc:</b> Andreas Voldstad <andreas.voldstad@kellogg.ox.ac.uk><br>
<b>Subject:</b> Re: [R-meta] Non-positive definite covariance matrix for rma.mv</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">Hi Andreas,<br>
<br>
I think the NPD issue arises from having treatment contrasts that are perfectly collinear. Consider that if you know the contrasts Tx1 vs Passive, Tx2 vs Passive, and Tx1 vs Active, then you can infer the Tx2 vs Active contrast:
<br>
(Tx2 vs Passive) - (Tx1 vs Passive) + (Tx1 vs Active) = (Tx2 - Tx1)  + (Tx1 vs Active) = (Tx2 vs Active)<br>
<br>
As far as I can see, the only way to avoid this is to calculate all effect size contrasts relative to a common comparison condition.
<br>
<br>
Depending on the meta-analytic model in which you use this covariance matrix, the NPD issue might or might not be important—it really depends on the structure of the model. For example, if you are going to run separate models with the active control contrasts
 and passive control contrasts, then the fact that the whole covariance matrix is NPD is NBD—not a big deal. But if you’re fitting some sort of multilevel meta-analysis model across all the contrasts, then metafor will yell at you if you use an NBD matrix in
 the V argument.<br>
<br>
James<br>
<br>
> On Jun 30, 2024, at 8:37 AM, Andreas Voldstad via R-sig-meta-analysis <r-sig-meta-analysis@r-project.org> wrote:<br>
> <br>
> Dear everyone,<br>
> <br>
> I have one study in my meta-analysis with a covariance matrix that is non-positive definite.<br>
> <br>
> I am wondering what consequences this might have for my meta-analysis with rma.mv, and whether you have any suggestions of how to deal with the issue.<br>
> <br>
> The study had four arms and effect sizes are additionally correlated over time and within dyads.<br>
> <br>
> The correlations over time and dyad members used for creating the covariance matrix was based on the corresponding correlations between participants' scores, estimated from the study dataset.<br>
> <br>
> Because of the four arms, some effect sizes have no overlap, leading to blocks of zeros in the covariance matrix.<br>
> <br>
> The covariance matrix is reproduced below:<br>
> <br>
> study_escalc <- data.frame(  StudyID = c("StudyA", "StudyA", "StudyA", "StudyA", "StudyA", "StudyA", "StudyA", "StudyA", "StudyA", "StudyA", "StudyA", "StudyA", "StudyA", "StudyA", "StudyA", "StudyA"),  Role = c("Husband", "Husband", "Wife", "Wife", "Husband",
 "Husband", "Wife", "Wife", "Husband", "Husband", "Wife", "Wife", "Husband", "Husband", "Wife", "Wife"),  Timenum = c(2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3),  Tx = c("Tx1", "Tx1", "Tx1", "Tx1", "Tx2", "Tx2", "Tx2", "Tx2", "Tx1", "Tx1", "Tx1", "Tx1",
 "Tx2", "Tx2", "Tx2", "Tx2"),  Control = c("Passive", "Passive", "Passive", "Passive", "Passive", "Passive", "Passive", "Passive", "Active", "Active", "Active", "Active", "Active", "Active", "Active", "Active"),  Contrast = c("Tx1 vs Passive", "Tx1 vs Passive",
 "Tx1 vs Passive", "Tx1 vs Passive", "Tx2 vs Passive", "Tx2 vs Passive", "Tx2 vs Passive", "Tx2 vs Passive", "Tx1 vs Active", "Tx1 vs Active", "Tx1 vs Active", "Tx1 vs Active", "Tx2 vs Active", "Tx2 vs Active", "Tx2 vs Active", "Tx2 vs Active"),  delta = c(0.467304,
 0.429311, 0.145277, 0.248136, 0.684523, 0.537425, 0.380137, 0.335112, 0.432723, 0.480095, 0.145031, 0.252715, 0.628890, 0.572478, 0.373187, 0.338829),  v = c(0.053375, 0.053154, 0.051417, 0.051710, 0.056543, 0.056865, 0.052208, 0.052756, 0.053863, 0.053454,
 0.050774, 0.053052, 0.056766, 0.057132, 0.051522, 0.054108),  N_tx = c(38, 39, 39, 38, 36, 35, 39, 37, 38, 39, 39, 38, 36, 35, 39, 37),  N_Control = c(39, 38, 39, 40, 39, 38, 39, 40, 38, 38, 40, 38, 38, 38, 40, 38),  Category = c("Husband_2", "Husband_3",
 "Wife_2", "Wife_3", "Husband_2", "Husband_3", "Wife_2", "Wife_3", "Husband_2", "Husband_3", "Wife_2", "Wife_3", "Husband_2", "Husband_3", "Wife_2", "Wife_3"),  Effect = c("Tx1 vs Passive_Husband_2", "Tx1 vs Passive_Husband_3", "Tx1 vs Passive_Wife_2", "Tx1
 vs Passive_Wife_3", "Tx2 vs Passive_Husband_2", "Tx2 vs Passive_Husband_3", "Tx2 vs Passive_Wife_2", "Tx2 vs Passive_Wife_3", "Tx1 vs Active_Husband_2", "Tx1 vs Active_Husband_3", "Tx1 vs Active_Wife_2", "Tx1 vs Active_Wife_3", "Tx2 vs Active_Husband_2", "Tx2
 vs Active_Husband_3", "Tx2 vs Active_Wife_2", "Tx2 vs Active_Wife_3"))<br>
> <br>
> study_cormat <- matrix(c(  1.000000, 0.781447, 0.689538, 0.639455,  0.781447, 1.000000, 0.565192, 0.653545,  0.689538, 0.565192, 1.000000, 0.820650,  0.639455, 0.653545, 0.820650, 1.000000),  nrow=4, byrow=TRUE, dimnames = list(    c("Husband_2", "Husband_3",
 "Wife_2", "Wife_3"),    c("Husband_2", "Husband_3", "Wife_2", "Wife_3")))<br>
> <br>
> Study_Vmat <-   vcalc(vi = v,        cluster = StudyID,        obs = Category,                 grp1 = Tx,         grp2 = Control,                 w1 = N_tx,        w2 = N_Control,                rho = study_cormat,        data = study_escalc)<br>
> <br>
> # Warning message: The var-cov matrix appears to be not positive definite in cluster StudyA. cov2cor(Study_Vmat)<br>
> <br>
> <br>
> <br>
> Warm wishes,<br>
> <br>
> Andreas Voldstad (he/him)<br>
> PhD student in Psychiatry<br>
> University of Oxford<br>
> Please don’t feel obliged to read or respond to my email outside your own working hours.<br>
> <br>
>    [[alternative HTML version deleted]]<br>
> <br>
> _______________________________________________<br>
> R-sig-meta-analysis mailing list @ R-sig-meta-analysis@r-project.org<br>
> To manage your subscription to this mailing list, go to:<br>
> <a href="https://stat.ethz.ch/mailman/listinfo/r-sig-meta-analysis">https://stat.ethz.ch/mailman/listinfo/r-sig-meta-analysis</a><br>
</div>
</span></font></div>


</div></blockquote></div></body></html>