<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Thank you, Gerta. I will try this.</div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Marimuthu</div>
<div id="appendonsend"></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> Dr. Gerta Rücker <gerta.ruecker@uniklinik-freiburg.de><br>
<b>Sent:</b> Sunday, June 30, 2024 1:36 PM<br>
<b>To:</b> R Special Interest Group for Meta-Analysis <r-sig-meta-analysis@r-project.org><br>
<b>Cc:</b> Marimuthu S <sm@mcmaster.ca><br>
<b>Subject:</b> AW: Error in the Network plot</font>
<div> </div>
</div>
<style>
<!--
@font-face
        {font-family:"Cambria Math"}
@font-face
        {font-family:Calibri}
p.x_MsoNormal, li.x_MsoNormal, div.x_MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman",serif}
a:link, span.x_MsoHyperlink
        {color:#0563C1;
        text-decoration:underline}
a:visited, span.x_MsoHyperlinkFollowed
        {color:#954F72;
        text-decoration:underline}
p
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman",serif}
p.x_msonormal0, li.x_msonormal0, div.x_msonormal0
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman",serif}
span.x_E-MailFormatvorlage19
        {font-family:"Arial",sans-serif;
        color:windowtext}
.x_MsoChpDefault
        {font-size:10.0pt}
@page WordSection1
        {margin:70.85pt 70.85pt 2.0cm 70.85pt}
div.x_WordSection1
        {}
-->
</style>
<div lang="DE" link="#0563C1" vlink="#954F72">
<table border="0" cellspacing="0" cellpadding="0" width="100%" align="left" style="border:0; display:table; width:100%; table-layout:fixed; border-collapse:seperate; float:none">
<tbody style="display:block">
<tr>
<td valign="middle" width="1px" bgcolor="#A6A6A6" cellpadding="7px 2px 7px 2px" style="padding:7px 2px 7px 2px; background-color:#A6A6A6">
</td>
<td valign="middle" width="100%" bgcolor="#EAEAEA" cellpadding="7px 5px 7px 15px" color="#212121" style="width:100%; background-color:#EAEAEA; padding:7px 5px 7px 15px; font-family:wf_segoe-ui_normal,Segoe UI,Segoe WP,Tahoma,Arial,sans-serif; font-size:12px; font-weight:normal; color:#212121; text-align:left; word-wrap:break-word">
<div>You don't often get email from gerta.ruecker@uniklinik-freiburg.de. <a href="https://aka.ms/LearnAboutSenderIdentification">
Learn why this is important</a></div>
</td>
<td valign="middle" align="left" width="75px" bgcolor="#EAEAEA" cellpadding="7px 5px 7px 5px" color="#212121" style="width:75px; background-color:#EAEAEA; padding:7px 5px 7px 5px; font-family:wf_segoe-ui_normal,Segoe UI,Segoe WP,Tahoma,Arial,sans-serif; font-size:12px; font-weight:normal; color:#212121; text-align:left; word-wrap:break-word">
</td>
</tr>
</tbody>
</table>
<div>
<table border="0" cellspacing="0" cellpadding="0" align="left" width="100%">
<tbody>
<tr>
<td style="background:#7A003C; padding:5pt 2pt 5pt 2pt"></td>
<td width="100%" cellpadding="7px 6px 7px 15px" style="background:#ff000; padding:5pt 4pt 5pt 12pt; word-wrap:break-word">
<div style="color:#000000"><span style="color:#000000; font-weight:bold">Caution:
</span>External email. </div>
</td>
</tr>
</tbody>
</table>
<br>
<div>
<div class="x_WordSection1">
<p class="x_MsoNormal"><span style="font-size:11.0pt; font-family:"Arial",sans-serif">Hi Marimuthu,</span></p>
<p class="x_MsoNormal"><span style="font-size:11.0pt; font-family:"Arial",sans-serif"> </span></p>
<p class="x_MsoNormal"><span style="font-size:11.0pt; font-family:"Arial",sans-serif">It seems you had not yet an answer to this. The problem you encountered comes from mixing code from R packages netmeta and metafor. If you want to use netmeta, particularly
 function netconnection(), you have to use pairwise() instead of to.wide() (which is a metafor function).</span></p>
<p class="x_MsoNormal"><span style="font-size:11.0pt; font-family:"Arial",sans-serif"> </span></p>
<p class="x_MsoNormal"><span style="font-size:11.0pt; font-family:"Arial",sans-serif">Attached you find your code adapted for R package netmeta which works fine.</span></p>
<p class="x_MsoNormal"><span style="font-size:11.0pt; font-family:"Arial",sans-serif"> </span></p>
<p class="x_MsoNormal"><span style="font-size:11.0pt; font-family:"Arial",sans-serif">Best,</span></p>
<p class="x_MsoNormal"><span style="font-size:11.0pt; font-family:"Arial",sans-serif">Gerta</span></p>
<p class="x_MsoNormal"><span style="font-size:11.0pt; font-family:"Arial",sans-serif"> </span></p>
<div>
<p class="x_MsoNormal"><span style="font-size:11.0pt; font-family:"Arial",sans-serif"> </span></p>
<p class="x_MsoNormal"><span style="font-size:11.0pt; font-family:"Arial",sans-serif"> </span></p>
<p class="x_MsoNormal"><span style="font-size:11.0pt; font-family:"Arial",sans-serif">UNIVERSITÄTSKLINIKUM FREIBURG</span></p>
<p class="x_MsoNormal"><span style="font-size:11.0pt; font-family:"Arial",sans-serif">Institute for Medical Biometry and Statistics</span></p>
<p class="x_MsoNormal"><span style="font-size:11.0pt; font-family:"Arial",sans-serif"> </span></p>
<p class="x_MsoNormal"><span style="font-size:11.0pt; font-family:"Arial",sans-serif">Dr. Gerta Rücker</span></p>
<p class="x_MsoNormal"><span style="font-size:11.0pt; font-family:"Arial",sans-serif">Guest Scientist</span></p>
<p class="x_MsoNormal"><span style="font-size:11.0pt; font-family:"Arial",sans-serif"> </span></p>
<p class="x_MsoNormal"><span style="font-size:11.0pt; font-family:"Arial",sans-serif">Stefan-Meier-Straße 26 · 79104 Freiburg</span></p>
<p class="x_MsoNormal"><span style="font-size:11.0pt; font-family:"Arial",sans-serif">gerta.ruecker@uniklinik-freiburg.de</span></p>
<p class="x_MsoNormal"><span style="font-size:11.0pt; font-family:"Arial",sans-serif"> </span></p>
<p class="x_MsoNormal"><span style="font-size:11.0pt; font-family:"Arial",sans-serif">https://www.uniklinik-freiburg.de/imbi-en/employees.html?imbiuser=ruecker</span><span style="font-size:11.0pt; font-family:"Calibri",sans-serif"></span></p>
</div>
<p class="x_MsoNormal"><span style="font-size:11.0pt; font-family:"Arial",sans-serif"> </span></p>
<div>
<div style="border:none; border-top:solid #E1E1E1 1.0pt; padding:3.0pt 0cm 0cm 0cm">
<p class="x_MsoNormal"><b><span style="font-size:11.0pt; font-family:"Calibri",sans-serif">Von:</span></b><span style="font-size:11.0pt; font-family:"Calibri",sans-serif"> Marimuthu S via R-sig-meta-analysis <r-sig-meta-analysis@r-project.org>
<br>
<b>Gesendet:</b> Dienstag, 25. Juni 2024 15:49<br>
<b>An:</b> Marimuthu S via R-sig-meta-analysis <r-sig-meta-analysis@r-project.org><br>
<b>Cc:</b> Marimuthu S <sm@mcmaster.ca><br>
<b>Betreff:</b> [R-meta] Error in the Network plot</span></p>
</div>
</div>
<p class="x_MsoNormal"> </p>
<div>
<p class="x_MsoNormal"><span style="font-family:"Calibri",sans-serif; color:black">Good Morning everyone,</span></p>
</div>
<div>
<p class="x_MsoNormal"><span style="font-family:"Calibri",sans-serif; color:black"> </span></p>
</div>
<div>
<p class="x_MsoNormal"><span style="font-family:"Calibri",sans-serif; color:black">I am trying to plot a network graph using 'netconnection' R function. I got the below error message. </span></p>
</div>
<div>
<p class="x_MsoNormal"><span style="font-family:"Calibri",sans-serif; color:black"> </span></p>
</div>
<div>
<p class="x_MsoNormal"><span style="font-family:"Calibri",sans-serif; color:black">R code and Error:</span></p>
</div>
<div>
<p class="x_MsoNormal"><span style="font-family:"Calibri",sans-serif; color:black"> </span></p>
</div>
<p class="x_MsoNormal"><span style="font-family:"Calibri",sans-serif; color:black">library(netmeta)</span></p>
<p class="x_MsoNormal"><span style="font-family:"Calibri",sans-serif; color:black">dat <- dat.hasselblad1998</span></p>
<p class="x_MsoNormal"><span style="font-family:"Calibri",sans-serif; color:black">dat</span></p>
<p class="x_MsoNormal"><span style="font-family:"Calibri",sans-serif; color:black">table(dat$study)</span></p>
<p class="x_MsoNormal"><span style="font-family:"Calibri",sans-serif; color:black"> </span></p>
<p class="x_MsoNormal"><span style="font-family:"Calibri",sans-serif; color:black"># restructure to a wide format</span></p>
<p class="x_MsoNormal"><span style="font-family:"Calibri",sans-serif; color:black">dat.wide <- to.wide(dat, study="study", grp="trt", ref="no_contact", grpvars=6:7)</span></p>
<p class="x_MsoNormal"><span style="font-family:"Calibri",sans-serif; color:black">dat.wide</span></p>
<p class="x_MsoNormal"><span style="font-family:"Calibri",sans-serif; color:black"> </span></p>
<p class="x_MsoNormal"><span style="font-family:"Calibri",sans-serif; color:black">nc1 <- netconnection(trt.1,  trt.2, study, data = dat.wide)</span></p>
<p class="x_MsoNormal"><span style="font-family:"Calibri",sans-serif; color:black"> </span></p>
<div>
<p class="x_MsoNormal"><span style="font-family:"Calibri",sans-serif; color:black">Error in netconnection.default(trt.1, trt.2, study, data = dat.wide) :</span></p>
</div>
<div>
<p class="x_MsoNormal"><span style="font-family:"Calibri",sans-serif; color:black">  The following studies have a wrong number of comparisons: '2', '9'</span></p>
</div>
<div>
<p class="x_MsoNormal"><span style="font-family:"Calibri",sans-serif; color:black">  Please provide data for all treatment comparisons (two-arm: 1; three-arm: 3; four-arm: 6, ...).</span></p>
</div>
<div>
<p class="x_MsoNormal"><span style="font-family:"Calibri",sans-serif; color:black"> </span></p>
</div>
<div>
<p class="x_MsoNormal"><span style="font-family:"Calibri",sans-serif; color:black">I would appreciate it if someone could clarify this and let me know how to sort it out. Please note that studies 2 and 9 have 3 arms.</span></p>
</div>
<div>
<p class="x_MsoNormal"><span style="font-family:"Calibri",sans-serif; color:black"> </span></p>
</div>
<div>
<p class="x_MsoNormal"><span style="font-family:"Calibri",sans-serif; color:black"> </span></p>
</div>
<div>
<p class="x_MsoNormal"><span style="font-family:"Calibri",sans-serif; color:black">Marimuthu</span></p>
</div>
<div>
<p class="x_MsoNormal"><span style="font-family:"Calibri",sans-serif; color:black"> </span></p>
</div>
<div>
<p class="x_MsoNormal"><span style="font-family:"Calibri",sans-serif; color:black"> </span></p>
</div>
<div>
<p class="x_MsoNormal"><span style="font-family:"Calibri",sans-serif; color:black"> </span></p>
</div>
<div>
<p class="x_MsoNormal"><span style="font-family:"Calibri",sans-serif; color:black"> </span></p>
</div>
<div>
<p class="x_MsoNormal"><span style="font-family:"Calibri",sans-serif; color:black"> </span></p>
</div>
<div>
<p class="x_MsoNormal"><span style="font-family:"Calibri",sans-serif; color:black"> </span></p>
</div>
<div>
<p class="x_MsoNormal"><span style="font-family:"Calibri",sans-serif; color:black"> </span></p>
</div>
<div id="x_Signature">
<div>
<p class="x_MsoNormal"><span style="font-family:"Calibri",sans-serif; color:black">Warm Regards,</span></p>
</div>
<div>
<p class="x_MsoNormal"><span style="font-family:"Calibri",sans-serif; color:black"> </span></p>
</div>
<div>
<p class="x_MsoNormal"><b><span style="font-size:14.0pt; font-family:"Calibri",sans-serif; color:#861106">Marimuthu S,</span></b><span style="font-size:14.0pt; font-family:"Calibri",sans-serif; color:#861106"></span></p>
</div>
<div>
<p class="x_MsoNormal"><span style="font-family:"Calibri",sans-serif; color:black">Ph.D. Student
<span style="background:white">(Biostatistics)</span> </span></p>
</div>
<div>
<p class="x_MsoNormal"><span style="font-family:"Calibri",sans-serif; color:black"> </span></p>
</div>
<div>
<p class="x_MsoNormal"><span style="font-family:"Calibri",sans-serif; color:black"><img width="212" height="50" id="x_imageSelected0" style="width:2.2083in; height:.5208in" data-outlook-trace="F:1|T:1" src="cid:image002.png@01DACB22.760CD510"></span></p>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>