[R-meta] Error in the Network plot

Dr. Gerta Rücker gert@@ruecker @end|ng |rom un|k||n|k-|re|burg@de
Sun Jun 30 19:36:08 CEST 2024


Hi Marimuthu,

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).

Attached you find your code adapted for R package netmeta which works fine.

Best,
Gerta



UNIVERSITÄTSKLINIKUM FREIBURG
Institute for Medical Biometry and Statistics

Dr. Gerta Rücker
Guest Scientist

Stefan-Meier-Straße 26 · 79104 Freiburg
gerta.ruecker using uniklinik-freiburg.de

https://www.uniklinik-freiburg.de/imbi-en/employees.html?imbiuser=ruecker

Von: Marimuthu S via R-sig-meta-analysis <r-sig-meta-analysis using r-project.org>
Gesendet: Dienstag, 25. Juni 2024 15:49
An: Marimuthu S via R-sig-meta-analysis <r-sig-meta-analysis using r-project.org>
Cc: Marimuthu S <sm using mcmaster.ca>
Betreff: [R-meta] Error in the Network plot

Good Morning everyone,

I am trying to plot a network graph using 'netconnection' R function. I got the below error message.

R code and Error:

library(netmeta)
dat <- dat.hasselblad1998
dat
table(dat$study)

# restructure to a wide format
dat.wide <- to.wide(dat, study="study", grp="trt", ref="no_contact", grpvars=6:7)
dat.wide

nc1 <- netconnection(trt.1,  trt.2, study, data = dat.wide)

Error in netconnection.default(trt.1, trt.2, study, data = dat.wide) :
  The following studies have a wrong number of comparisons: '2', '9'
  Please provide data for all treatment comparisons (two-arm: 1; three-arm: 3; four-arm: 6, ...).

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.


Marimuthu







Warm Regards,

Marimuthu S,
Ph.D. Student (Biostatistics)

[cid:image002.png using 01DACB22.760CD510]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://stat.ethz.ch/pipermail/r-sig-meta-analysis/attachments/20240630/6d24fce5/attachment-0001.html>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: image002.png
Type: image/png
Size: 26099 bytes
Desc: image002.png
URL: <https://stat.ethz.ch/pipermail/r-sig-meta-analysis/attachments/20240630/6d24fce5/attachment-0001.png>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: Hasselblad.R
Type: application/octet-stream
Size: 575 bytes
Desc: Hasselblad.R
URL: <https://stat.ethz.ch/pipermail/r-sig-meta-analysis/attachments/20240630/6d24fce5/attachment-0001.obj>


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